From 176e49499b132c2780ac1824ce1685969b6abe88 Mon Sep 17 00:00:00 2001 From: Brent Hagen Date: Tue, 10 Sep 2024 15:37:29 -0400 Subject: [PATCH] fix(app): display only one conflict with thermocycler in run setup (#16228) there are several combinations of labware, fixtures, and modules in A1 and B1 that generate two conflicts with a configured thermocycler. this PR filters out one of 2 conflicts from display when both conflicts are with single slot labware in a protocol. other scenarios should be covered by the modules or fixtures lists. closes RQA-3112 --- .../LocationConflictModal.tsx | 11 ++--- .../SetupModuleAndDeck/SetupFixtureList.tsx | 37 ++++++++++++++++- .../FixtureTable.tsx | 40 ++++++++++++++++++- 3 files changed, 79 insertions(+), 9 deletions(-) diff --git a/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/LocationConflictModal.tsx b/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/LocationConflictModal.tsx index babcf5ba830..16cfa01c125 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/LocationConflictModal.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/LocationConflictModal.tsx @@ -191,9 +191,10 @@ export const LocationConflictModal = ( protocolSpecifiesDisplayName = getModuleDisplayName(requiredModule) } - const displaySlotName = isThermocyclerRequired - ? 'A1 + B1' - : getCutoutDisplayName(cutoutId) + const displaySlotName = + isThermocyclerRequired || isThermocyclerCurrentFixture + ? 'A1 + B1' + : getCutoutDisplayName(cutoutId) if (showModuleSelect && requiredModule != null) { return createPortal( @@ -232,7 +233,7 @@ export const LocationConflictModal = ( } values={{ currentFixture: currentFixtureDisplayName, - cutout: getCutoutDisplayName(cutoutId), + cutout: displaySlotName, }} components={{ block: , @@ -341,7 +342,7 @@ export const LocationConflictModal = ( } values={{ currentFixture: currentFixtureDisplayName, - cutout: getCutoutDisplayName(cutoutId), + cutout: displaySlotName, }} components={{ block: , diff --git a/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/SetupFixtureList.tsx b/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/SetupFixtureList.tsx index 82ec086b983..57764f08a34 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/SetupFixtureList.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/SetupFixtureList.tsx @@ -23,6 +23,9 @@ import { getCutoutDisplayName, getDeckDefFromRobotType, getFixtureDisplayName, + TC_MODULE_LOCATION_OT3, + THERMOCYCLER_V2_FRONT_FIXTURE, + THERMOCYCLER_V2_REAR_FIXTURE, } from '@opentrons/shared-data' import { StatusLabel } from '../../../../atoms/StatusLabel' import { TertiaryButton } from '../../../../atoms/buttons/TertiaryButton' @@ -47,9 +50,32 @@ interface SetupFixtureListProps { export const SetupFixtureList = (props: SetupFixtureListProps): JSX.Element => { const { deckConfigCompatibility, robotName } = props const deckDef = getDeckDefFromRobotType(FLEX_ROBOT_TYPE) + + const hasTwoLabwareThermocyclerConflicts = + deckConfigCompatibility.some( + ({ cutoutFixtureId, missingLabwareDisplayName }) => + cutoutFixtureId === THERMOCYCLER_V2_FRONT_FIXTURE && + missingLabwareDisplayName != null + ) && + deckConfigCompatibility.some( + ({ cutoutFixtureId, missingLabwareDisplayName }) => + cutoutFixtureId === THERMOCYCLER_V2_REAR_FIXTURE && + missingLabwareDisplayName != null + ) + + // if there are two labware conflicts with the thermocycler, don't show the conflict with the thermocycler rear fixture + const filteredDeckConfigCompatibility = deckConfigCompatibility.filter( + ({ cutoutFixtureId }) => { + return ( + !hasTwoLabwareThermocyclerConflicts || + !(cutoutFixtureId === THERMOCYCLER_V2_REAR_FIXTURE) + ) + } + ) + return ( <> - {deckConfigCompatibility.map(cutoutConfigAndCompatibility => { + {filteredDeckConfigCompatibility.map(cutoutConfigAndCompatibility => { // filter out all fixtures that only provide usb module addressable areas // (i.e. everything but MagBlockV1 and StagingAreaWithMagBlockV1) // as they're handled in the Modules Table @@ -89,6 +115,11 @@ export function FixtureListItem({ const isRequiredSingleSlotMissing = missingLabwareDisplayName != null const isConflictingFixtureConfigured = cutoutFixtureId != null && !SINGLE_SLOT_FIXTURES.includes(cutoutFixtureId) + + const isThermocyclerCurrentFixture = + cutoutFixtureId === THERMOCYCLER_V2_FRONT_FIXTURE || + cutoutFixtureId === THERMOCYCLER_V2_REAR_FIXTURE + let statusLabel if (!isCurrentFixtureCompatible) { statusLabel = ( @@ -215,7 +246,9 @@ export function FixtureListItem({ - {getCutoutDisplayName(cutoutId)} + {isThermocyclerCurrentFixture && isRequiredSingleSlotMissing + ? TC_MODULE_LOCATION_OT3 + : getCutoutDisplayName(cutoutId)} + cutoutFixtureId === THERMOCYCLER_V2_FRONT_FIXTURE && + missingLabwareDisplayName != null + ) && + requiredDeckConfigCompatibility.some( + ({ cutoutFixtureId, missingLabwareDisplayName }) => + cutoutFixtureId === THERMOCYCLER_V2_REAR_FIXTURE && + missingLabwareDisplayName != null + ) + + // if there are two labware conflicts with the thermocycler, don't show the conflict with the thermocycler rear fixture + const filteredDeckConfigCompatibility = requiredDeckConfigCompatibility.filter( + ({ cutoutFixtureId }) => { + return ( + !hasTwoLabwareThermocyclerConflicts || + !(cutoutFixtureId === THERMOCYCLER_V2_REAR_FIXTURE) + ) + } + ) + // list not configured/conflicted fixtures first - const sortedDeckConfigCompatibility = requiredDeckConfigCompatibility.sort( + const sortedDeckConfigCompatibility = filteredDeckConfigCompatibility.sort( a => a.cutoutFixtureId != null && a.compatibleCutoutFixtureIds.includes(a.cutoutFixtureId) @@ -139,6 +164,11 @@ function FixtureTableItem({ cutoutFixtureId != null && compatibleCutoutFixtureIds.includes(cutoutFixtureId) const isRequiredSingleSlotMissing = missingLabwareDisplayName != null + + const isThermocyclerCurrentFixture = + cutoutFixtureId === THERMOCYCLER_V2_FRONT_FIXTURE || + cutoutFixtureId === THERMOCYCLER_V2_REAR_FIXTURE + let chipLabel: JSX.Element if (!isCurrentFixtureCompatible) { const isConflictingFixtureConfigured = @@ -219,7 +249,13 @@ function FixtureTableItem({ - +