From e668882851f1f2ea8413074814149dd8d7d1c880 Mon Sep 17 00:00:00 2001 From: shiyaochen Date: Tue, 19 Nov 2024 16:16:51 -0500 Subject: [PATCH 1/2] fix(protocol-designer): switching pipettes when source and/or dest labware field are unselected fix RQA-3622 --- .../dependentFieldsUpdateMoveLiquid.ts | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/protocol-designer/src/steplist/formLevel/handleFormChange/dependentFieldsUpdateMoveLiquid.ts b/protocol-designer/src/steplist/formLevel/handleFormChange/dependentFieldsUpdateMoveLiquid.ts index c473af451ea..4e5203f6c3e 100644 --- a/protocol-designer/src/steplist/formLevel/handleFormChange/dependentFieldsUpdateMoveLiquid.ts +++ b/protocol-designer/src/steplist/formLevel/handleFormChange/dependentFieldsUpdateMoveLiquid.ts @@ -543,16 +543,24 @@ const updatePatchOnPipetteChannelChange = ( const sourceLabwareId: string = appliedPatch.aspirate_labware as string const destLabwareId: string = appliedPatch.dispense_labware as string const sourceLabware = labwareEntities[sourceLabwareId] - const sourceLabwareDef = sourceLabware.def const destLabware = labwareEntities[destLabwareId] update = { - aspirate_wells: getAllWellsFromPrimaryWells( - appliedPatch.aspirate_wells as string[], - sourceLabwareDef, - channels as 8 | 96 - ), + aspirate_wells: + sourceLabwareId === null + ? getDefaultWells({ + labwareId: sourceLabwareId, + pipetteId, + labwareEntities, + pipetteEntities, + }) + : getAllWellsFromPrimaryWells( + appliedPatch.aspirate_wells as string[], + sourceLabware.def, + channels as 8 | 96 + ), dispense_wells: + destLabwareId === null || destLabwareId.includes('trashBin') || destLabwareId.includes('wasteChute') ? getDefaultWells({ From 26560e1cdb8f076b15af67191c7cf0fb8a2dc493 Mon Sep 17 00:00:00 2001 From: shiyaochen Date: Tue, 19 Nov 2024 16:30:40 -0500 Subject: [PATCH 2/2] check if labware id is not null before update --- .../dependentFieldsUpdateMoveLiquid.ts | 51 ++++++++----------- 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/protocol-designer/src/steplist/formLevel/handleFormChange/dependentFieldsUpdateMoveLiquid.ts b/protocol-designer/src/steplist/formLevel/handleFormChange/dependentFieldsUpdateMoveLiquid.ts index 4e5203f6c3e..d7a35e4ec59 100644 --- a/protocol-designer/src/steplist/formLevel/handleFormChange/dependentFieldsUpdateMoveLiquid.ts +++ b/protocol-designer/src/steplist/formLevel/handleFormChange/dependentFieldsUpdateMoveLiquid.ts @@ -545,35 +545,28 @@ const updatePatchOnPipetteChannelChange = ( const sourceLabware = labwareEntities[sourceLabwareId] const destLabware = labwareEntities[destLabwareId] - update = { - aspirate_wells: - sourceLabwareId === null - ? getDefaultWells({ - labwareId: sourceLabwareId, - pipetteId, - labwareEntities, - pipetteEntities, - }) - : getAllWellsFromPrimaryWells( - appliedPatch.aspirate_wells as string[], - sourceLabware.def, - channels as 8 | 96 - ), - dispense_wells: - destLabwareId === null || - destLabwareId.includes('trashBin') || - destLabwareId.includes('wasteChute') - ? getDefaultWells({ - labwareId: destLabwareId, - pipetteId, - labwareEntities, - pipetteEntities, - }) - : getAllWellsFromPrimaryWells( - appliedPatch.dispense_wells as string[], - destLabware.def, - channels as 8 | 96 - ), + if (sourceLabwareId != null && destLabwareId != null) { + update = { + aspirate_wells: getAllWellsFromPrimaryWells( + appliedPatch.aspirate_wells as string[], + sourceLabware.def, + channels as 8 | 96 + ), + dispense_wells: + destLabwareId.includes('trashBin') || + destLabwareId.includes('wasteChute') + ? getDefaultWells({ + labwareId: destLabwareId, + pipetteId, + labwareEntities, + pipetteEntities, + }) + : getAllWellsFromPrimaryWells( + appliedPatch.dispense_wells as string[], + destLabware.def, + channels as 8 | 96 + ), + } } }