-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DPL 950 - NT barcodes import #1453
Conversation
Feature flag removed for Sequencescapr V1 SequencescapeTubes added Common functions moved to sequencescapeUtils.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few things to look at but looking good.
src/lib/receptions/Sequencescape.js
Outdated
* | ||
* @returns {Array} Array of attribute keys | ||
*/ | ||
const getAttributeKeys = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can turn this into a 1 liner
return Object.keys(labwareTypes).flatMap((type) => labwareTypes[type].attributes)
...buildRequestAndSample({ aliquot, study, sample, sample_metadata, requestOptions }), | ||
} | ||
} | ||
const labwareTypes = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
labwareTypes seem to be the same in both receptions. Maybe we can move it to the utils?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually they are different in both -
For Sequencescape it contains both plates and tubes,
const labwareTypes = { plates: { type: 'plates', attributes: 'plates_attributes', transformFunction: transformPlate, }, tubes: { type: 'tubes', attributes: 'tubes_attributes', transformFunction: transformTube, }, }
For SequenceTubes , it contains only tubes
const labwareTypes = { tubes: { type: 'tubes', attributes: 'tubes_attributes', transformFunction: transformTube, }, }
Probably , we can have the default in utils as only having tubes
const labwareTypes = { tubes: { type: 'tubes', attributes: 'tubes_attributes', transformFunction: transformTube, }, }
and in Sequencescape , we can modify this generic type to append the 'plates' as well. But , I am not sure whether it improves much as there are only two of them. Please comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the default have both plates and tubes and then each reception uses the appropriate one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds good. I will make the changes 👍
src/lib/receptions/index.js
Outdated
name: 'sequencescape-tubes', | ||
text: 'Sequencescape Tubes', | ||
value: 'SequencescapeTubes', | ||
}, | ||
} | ||
|
||
// TO MODIFY - remove versions once dpl_877_reception_request is enabled by default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can remove this comment now you have removed the flag?
} | ||
} | ||
|
||
const labwareTypes = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per my previous comment I think we could put this back to remove duplication in the receptions.
// labwareData is used to store the input barcodes as well as the data fetched from sequencescape which is then imported into traction | ||
labwareData: { | ||
inputBarcodes: [], // inputBarcodes is used to store the barcodes that the user has inputted | ||
foundBarcodes: new Set(), // foundBarcodes is used to store the barcodes that have been found in sequencescape |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Using sets is a great way to prevent duplicates.
src/views/GeneralReception.vue
Outdated
showModal(message) { | ||
this.modalState = { visible: true, message } | ||
}, | ||
importFailed({ message }) { | ||
//Handler for deleting barcodes from the input field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirey sure what is going on here but you may be able to turn it into a map.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This handler is designed for an edge case that addresses inconsistencies arising when the user enters barcodes and subsequently deletes them using the backspace or delete key. When the user inputs data, we fetch that information upon pressing the enter key, and our labwareData
object keeps the necessary details from sequencescape fetch (used for printing or importing).
However, if the user removes the barcode by pressing delete or backspace, the data stored in our state may become inconsistent with what is present in the input barcode field. Therefore, it is essential to delete all information corresponding to the deleted input barcode. Failing to do so could result in printing or importing information related to barcodes that are no longer in the input barcode field.
Hope it make sense.
As we are keeping three different array fields in labwareData
for inputBarcodes, foundBarcdes(from SS) and attributes (again from SS for import) I thought forEach is better to make changes for each of them.
Please let me know your thoughts on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alternative solution to completely eliminate this issue and this handler is to inform the user that, after making any changes in input barcode field( whether it is delete or any edit), they should press 'Enter'. This action will ensure that the labwareData state aligns consistently with the barcodes in the input field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe worth a call about this? Function seems to work fine but looks like there could be room for simplifying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes sure. Do you have some time tomorrow after 10.30 , for a quick call?
- Removed feature flag comment - Code enhancements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, couple comments.
.env.production
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can unstage this if its not intentional.
include: 'receptacles.aliquots.sample.sample_metadata,receptacles.aliquots.study', | ||
fields: { | ||
tubes: 'labware_barcode,receptacles', | ||
wells: 'position,aliquots', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont think we need to fetch wells as this is only for tubes.
src/views/GeneralReception.vue
Outdated
showModal(message) { | ||
this.modalState = { visible: true, message } | ||
}, | ||
importFailed({ message }) { | ||
//Handler for deleting barcodes from the input field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe worth a call about this? Function seems to work fine but looks like there could be room for simplifying.
- labwareTypes, transformTube, transformPlate moved to utils
src/views/GeneralReception.vue
Outdated
@@ -272,6 +272,7 @@ export default { | |||
attributes: [], // attributes is used to store the attributes that have been found in sequencescape | |||
}, | |||
printerName: '', | |||
debounceTimer: 1000, // debounce timer for barcode deletion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be set to null by default since its not the time its the timer itself. I think thats my mistake when we went over it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BenTopping
No, you helped a lot. It's bit stupid of me that I didn't realise that it's a timerId returned by setTimeout and not a timer value.
Updated to null now 👍
GeneralReception page update
SequencescapeTubes added in receptions
sequencescapeUils.js added - all generic functions used between receptions/Sequencescape and receptions/SequenscapeTubes
Unit and e2e test case updates
Resolving import paths