Skip to content

Commit

Permalink
fix(components): fix logic for whether TC is selected in DeckConfigur…
Browse files Browse the repository at this point in the history
…ator

In our `DeckConfigurator` component, there is an insufficient equality check for selected cutout ID
with configured thermocycler cutout. The situation arises when a thermocycler is configured in
cutout A1 and the selected cutout ID is B1, or vice versa. These point to the thermocycler being
configured in the same physical location, so we should check whether both selected and configured
cutout IDs are included in thermocycler cutouts ([cutoutA1, cutoutB1]).

Closes RQA-3237
  • Loading branch information
ncdiehl11 committed Oct 14, 2024
1 parent 83cec18 commit f8fe01e
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions components/src/hardware-sim/DeckConfigurator/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
MAGNETIC_BLOCK_V1_FIXTURE,
ABSORBANCE_READER_V1_FIXTURE,
STAGING_AREA_SLOT_WITH_MAGNETIC_BLOCK_V1_FIXTURE,
THERMOCYCLER_MODULE_CUTOUTS,
} from '@opentrons/shared-data'

import { COLORS } from '../../helix-design-system'
Expand Down Expand Up @@ -228,18 +229,26 @@ export function DeckConfigurator(props: DeckConfiguratorProps): JSX.Element {
}
/>
))}
{thermocyclerFixtures.map(({ cutoutId, cutoutFixtureId }) => (
<ThermocyclerFixture
key={cutoutId}
deckDefinition={deckDef}
handleClickRemove={
editableCutoutIds.includes(cutoutId) ? handleClickRemove : undefined
}
fixtureLocation={cutoutId}
cutoutFixtureId={cutoutFixtureId}
selected={cutoutId === selectedCutoutId}
/>
))}
{thermocyclerFixtures.map(({ cutoutId, cutoutFixtureId }) => {
return (
<ThermocyclerFixture
key={cutoutId}
deckDefinition={deckDef}
handleClickRemove={
editableCutoutIds.includes(cutoutId)
? handleClickRemove
: undefined
}
fixtureLocation={cutoutId}
cutoutFixtureId={cutoutFixtureId}
selected={
selectedCutoutId != null &&
THERMOCYCLER_MODULE_CUTOUTS.includes(selectedCutoutId) &&
THERMOCYCLER_MODULE_CUTOUTS.includes(cutoutId)
}
/>
)
})}
{absorbanceReaderFixtures.map(({ cutoutId, cutoutFixtureId }) => (
<AbsorbanceReaderFixture
key={cutoutId}
Expand Down

0 comments on commit f8fe01e

Please sign in to comment.