Skip to content

Commit

Permalink
Merge pull request #1877 from sanger/remove-pre-push-from-lefthook
Browse files Browse the repository at this point in the history
Remove pre push from lefthook
  • Loading branch information
stevieing authored Aug 13, 2024
2 parents 543b668 + da4d975 commit 9bdc3cc
Show file tree
Hide file tree
Showing 9 changed files with 1,912 additions and 119 deletions.
6 changes: 0 additions & 6 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# Refer for explanation to following link:
# https://github.com/Arkweid/lefthook/blob/master/docs/full_guide.md
#
pre-push:
commands:
packages-audit:
tags: security
run: npm audit --audit-level=high

pre-commit:
parallel: true
Expand Down
25 changes: 14 additions & 11 deletions src/lib/LabelPrintingHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@
* It is now in the state that it can be used ny multiple components / views
* I also think we could create a composables ... but that is for another day
* A bit more workand this could be a truly reusable library
* @module LabelPrintingHelpers
*/

/*
* @param {Array [Object, ...]} WorkflowList
/**
* @param {Array} {[Object, ...]} WorkflowList
* @param {String} the attribute to extract from each object
* @returns [Array] e.g. [attribute, attribute ...]
* @returns {Array} e.g. [attribute, attribute ...]
* for each object return the named attribute
*/
const byAttribute = (objects, attribute) => {
return objects.map((object) => object[attribute])
}

/*
* @param {Array [Object, ...]} WorkflowList
/**
* @param {Array}: {[Object, ...]} WorkflowList
* @returns {Array} A list which can be used as a drop-down in the format
* example: [{ label: 'workflow', options: [{text:'text', value: 'value', ...}, ..., { text: 'No suffix', value: null }]}]
* @example: [{ label: 'workflow', options: [{text:'text', value: 'value', ...}, ..., { text: 'No suffix', value: null }]}]
* The last item returned is a no suffix option
*/
const createWorkflowDropdownOptions = (WorkflowList) => {
Expand All @@ -31,8 +32,8 @@ const createWorkflowDropdownOptions = (WorkflowList) => {
})).concat([{ text: 'No suffix', value: null }])
}

/*
* @param {Array [Object, ...]} WorkflowList
/**
* @param {Array} {[Object, ...]} WorkflowList
* @returns {Object} e.g. { suffix: {options}, ...}
*/
const workflowByOptions = (options) => {
Expand All @@ -44,8 +45,8 @@ const workflowByOptions = (options) => {
}, {})
}

/*
* @param {Array [Object, ...]} WorkflowList
/**
* @param {Array} {[Object, ...]} WorkflowList
* @returns {Object} A list with the suffix as the key and the option as the value.
* For each item Ignores the workflow and flattens all options into a single object
* This allows for searching by suffix
Expand All @@ -60,7 +61,9 @@ const createWorkflowOptions = (WorkflowList) => {
}, {})
}

// @returns {Object} - An empty WorkflowOptions with all attributes set to null
/**
* @returns {Object} - An empty WorkflowOptions with all attributes set to null
*/
const NullWorkflowItem = {
stage: '',
suffix: null,
Expand Down
Loading

0 comments on commit 9bdc3cc

Please sign in to comment.