Skip to content

Commit

Permalink
Merge pull request #1958 from sanger/develop
Browse files Browse the repository at this point in the history
release version 10.7.4
  • Loading branch information
sabrine33 authored Sep 24, 2024
2 parents 16566e2 + 712e97d commit 738b968
Show file tree
Hide file tree
Showing 14 changed files with 506 additions and 758 deletions.
1 change: 0 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ VITE_SAMPLEEXTRACTION_BASE_URL=http://sampleextraction
VITE_SEQUENCESCAPE_BASE_URL=http://sequencescape
VITE_SEQUENCESCAPE_API_KEY=development
VITE_LOG=false
VITE_TUBE_LABEL_TEMPLATE_NAME=traction_tube_label_template
VITE_ENVIRONMENT=development
2 changes: 1 addition & 1 deletion .release-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.7.3
10.7.4
550 changes: 234 additions & 316 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,32 @@
},
"dependencies": {
"@sanger/ui-styling": "^4.1.0",
"@vitejs/plugin-vue": "^5.1.3",
"@vitejs/plugin-vue": "^5.1.4",
"autoprefixer": "^10.4.20",
"axios": "^1.7.7",
"csv-parse": "^5.5.6",
"global": "^4.4.0",
"lodash-es": "^4.17.21",
"pinia": "^2.2.2",
"postcss": "^8.4.41",
"postcss": "^8.4.47",
"swrv": "^1.0.4",
"tailwindcss": "3.4.9",
"vite": "^5.4.3",
"vue": "^3.4.38",
"vue-router": "^4.4.3",
"tailwindcss": "3.4.12",
"vite": "^5.4.7",
"vue": "^3.5.8",
"vue-router": "^4.4.5",
"vue3-selecto": "^1.12.3",
"vuex": "^4.1.0"
},
"devDependencies": {
"@eslint/js": "^9.9.0",
"@eslint/js": "^9.11.0",
"@pinia/testing": "^0.1.5",
"@vue/test-utils": "^2.4.6",
"better-docs": "^2.7.3",
"clean-jsdoc-theme": "^4.3.0",
"cypress": "^13.14.1",
"cypress": "^13.14.2",
"cypress-file-upload": "^5.0.8",
"dotenv": "^16.4.5",
"eslint": "^9.9.1",
"eslint": "^9.10.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-cypress": "^3.5.0",
"eslint-plugin-vue": "^9.28.0",
Expand All @@ -61,6 +61,6 @@
"postcss-cli": "^11.0.0",
"prettier": "3.3.3",
"rollup-plugin-visualizer": "^5.12.0",
"vitest": "^2.0.5"
"vitest": "^2.1.1"
}
}
3 changes: 3 additions & 0 deletions src/api/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ const config = [
{
name: 'printers',
},
{
name: 'workflows',
},
],
pipelines: [
{
Expand Down
37 changes: 24 additions & 13 deletions src/components/labelPrinting/LabelPrintingForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</div>
</fieldset>

<DataFetcher :fetcher="fetchPrinters">
<DataFetcher :fetcher="fetchResources">
<fieldset>
<traction-heading level="3" show-border>Choice of Printer</traction-heading>
<traction-heading level="5">Select label type</traction-heading>
Expand Down Expand Up @@ -131,7 +131,6 @@ import {
createWorkflowPlateBarcodeLabel,
NullWorkflowItem,
} from '@/lib/LabelPrintingHelpers.js'
import WorkflowList from '@/config/WorkflowList.json'
import { nextTick } from 'vue'
import LabelTypes from '@/config/LabelTypes.json'
Expand All @@ -149,9 +148,15 @@ const labelOptions = reactive({ suffix: '', labelTypeKey: 'tube2d' }) // label o
let printJob = reactive(PrintJobType()) // Create a reactive for the print job
const workflowOptions = reactive(createWorkflowOptions(WorkflowList)) // Create a reactive for the workflow options
//Create a review for the barcode to be printed
const workflowOptions = computed(() => {
return createWorkflowOptions(Object.values(printingStore.pipelines.steps))
})
const workflowDropdownOptions = reactive(createWorkflowDropdownOptions(WorkflowList)) // Create a reactive for the workflow dropdown options
//Create the workflow dropdown options
const workflowDropdownOptions = computed(() => {
return createWorkflowDropdownOptions(printingStore.pipelines)
})
/**
* Creates a map of functions to create labels
Expand Down Expand Up @@ -200,7 +205,7 @@ const labelType = computed(() => {
const workflowBarcodeItems = computed(() => {
const date = getCurrentDate()
// without this we get an undefined error
const workflowItem = workflowOptions[labelOptions.suffix] || NullWorkflowItem
const workflowItem = workflowOptions.value[labelOptions.suffix] || NullWorkflowItem
// it is possible for there to be no barcodes so we need to add a guard
// we filter to remove any nulls
Expand Down Expand Up @@ -250,15 +255,21 @@ const onReset = () => {
})
}
// fetch printers
// if no printers are in the store, fetch them
// if no printers or workflows in the store, fetch them
// if there are printers in the store, return success prevents error in DataFetcher
// @returns {Promise} - Promise
const fetchPrinters = async () => {
if (printingStore.printers().length === 0) {
return await printingStore.fetchPrinters()
} else {
return { success: true }
}
const fetchResources = async () => {
const { printers, fetchPrinters, fetchWorkflows, pipelines } = printingStore
const responses = await Promise.all([
Object.keys(printers).length === 0 ? fetchPrinters() : { success: true, errors: [] },
pipelines.workflows.length === 0 || pipelines.steps.length === 0
? fetchWorkflows()
: { success: true, errors: [] },
])
const success = responses.every((response) => response.success)
const errors = responses.flatMap((response) => response.errors)
return { success, errors }
}
</script>
Loading

0 comments on commit 738b968

Please sign in to comment.