Skip to content

Commit 7ce9ebc

Browse files
fixI(app): Allow waste chute with cover fixtures on DeckConfiguration component (#18983)
1 parent bea89c1 commit 7ce9ebc

File tree

8 files changed

+52
-54
lines changed

8 files changed

+52
-54
lines changed

app/src/organisms/DeviceDetailsDeckConfiguration/AddFixtureModal.tsx

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
import { useState } from 'react'
22
import { useTranslation } from 'react-i18next'
3-
import { css } from 'styled-components'
43

54
import {
6-
Btn,
7-
COLORS,
85
DIRECTION_COLUMN,
96
FixtureOption,
107
Flex,
118
ListTable,
129
Modal,
1310
SPACING,
1411
StyledText,
15-
TYPOGRAPHY,
1612
} from '@opentrons/components'
1713
import {
1814
useModulesQuery,
@@ -24,6 +20,7 @@ import {
2420
replaceCutoutFixtureWithComboFixture,
2521
replaceFixtureToFakeFixtureAndTransformCutoutFixturesToAA,
2622
SINGLE_CENTER_CUTOUTS,
23+
WASTE_CHUTE_CUTOUT,
2724
} from '@opentrons/shared-data'
2825

2926
import { ODDFixtureOption } from '/app/molecules/ODDFixtureOption'
@@ -161,6 +158,23 @@ export function AddFixtureModal({
161158
/>
162159
</>
163160
)
161+
} else if (
162+
optionStage === 'fixtureOptions' &&
163+
cutoutId === WASTE_CHUTE_CUTOUT &&
164+
addressableAreaId === 'D3'
165+
) {
166+
nextStageOptions = (
167+
<>
168+
<FixtureOption
169+
key="wasteChuteStageOption"
170+
optionName="Waste chute"
171+
buttonText={t('select_options')}
172+
onClickHandler={() => {
173+
setOptionStage('wasteChuteOptions')
174+
}}
175+
/>
176+
</>
177+
)
164178
}
165179

166180
const sendIdentifyStacker = useSendIdentifyStacker()
@@ -333,32 +347,8 @@ export function AddFixtureModal({
333347
{nextStageOptions}
334348
</ListTable>
335349
</Flex>
336-
{optionStage === 'wasteChuteOptions' ? (
337-
<Btn
338-
onClick={() => {
339-
setOptionStage('fixtureOptions')
340-
}}
341-
aria-label="back"
342-
paddingX={SPACING.spacing16}
343-
marginTop="1.44rem"
344-
marginBottom="0.56rem"
345-
>
346-
<StyledText css={GO_BACK_BUTTON_STYLE}>
347-
{t('shared:go_back')}
348-
</StyledText>
349-
</Btn>
350-
) : null}
351350
</Modal>
352351
)}
353352
</>
354353
)
355354
}
356-
357-
const GO_BACK_BUTTON_STYLE = css`
358-
${TYPOGRAPHY.pSemiBold};
359-
color: ${COLORS.grey50};
360-
361-
&:hover {
362-
opacity: 70%;
363-
}
364-
`

app/src/organisms/DeviceDetailsDeckConfiguration/__tests__/AddFixtureModal.test.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,10 @@ describe('Desktop AddFixtureModal', () => {
114114
screen.getByText('Modules')
115115
fireEvent.click(screen.getAllByText('Add')[0])
116116
screen.getByText('Trash bin')
117-
screen.getByText('Waste chute')
118-
expect(screen.getAllByRole('button', { name: 'Add' }).length).toBe(2)
117+
expect(screen.getAllByRole('button', { name: 'Add' }).length).toBe(1)
118+
expect(
119+
screen.getAllByRole('button', { name: 'Select options' }).length
120+
).toBe(1)
119121
})
120122

121123
it('should render text and buttons slot A1', () => {
@@ -169,7 +171,10 @@ describe('Desktop AddFixtureModal', () => {
169171
it('should display appropriate Waste Chute options when the generic Waste Chute button is clicked', () => {
170172
render(props)
171173
fireEvent.click(screen.getAllByRole('button', { name: 'Add' })[0]) // click fixtures
172-
expect(screen.getAllByRole('button', { name: 'Add' }).length).toBe(2)
174+
expect(screen.getAllByRole('button', { name: 'Add' }).length).toBe(1)
175+
expect(
176+
screen.getAllByRole('button', { name: 'Select options' }).length
177+
).toBe(1)
173178

174179
const displayText = getFixtureDisplayName(
175180
WASTE_CHUTE_RIGHT_ADAPTER_NO_COVER_FIXTURE

app/src/organisms/DeviceDetailsDeckConfiguration/__tests__/utils.test.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
MAGNETIC_BLOCK_V1_FIXTURE,
1111
THERMOCYCLER_MODULE_TYPE,
1212
THERMOCYCLER_MODULE_V2,
13+
WASTE_CHUTE_RIGHT_ADAPTER_COVERED_FIXTURE,
1314
WASTE_CHUTE_RIGHT_ADAPTER_NO_COVER_FIXTURE,
1415
} from '@opentrons/shared-data'
1516

@@ -208,13 +209,6 @@ describe('getFixtureOptions', () => {
208209
addressableAreaId: 'movableTrashD3',
209210
},
210211
],
211-
[
212-
{
213-
cutoutId: 'cutoutD3',
214-
cutoutFixtureId: 'wasteChuteRightAdapterNoCover',
215-
addressableAreaId: '96ChannelWasteChute',
216-
},
217-
],
218212
])
219213
})
220214
it('Should get staging area for cutoutD3 and aa fakeD4', () => {
@@ -250,6 +244,13 @@ describe('getWasteChuteOptions', () => {
250244
addressableAreaId: DEFAULT_AA_FOR_WASTE_CHUTE,
251245
},
252246
],
247+
[
248+
{
249+
cutoutId: 'cutoutD3',
250+
cutoutFixtureId: WASTE_CHUTE_RIGHT_ADAPTER_COVERED_FIXTURE,
251+
addressableAreaId: DEFAULT_AA_FOR_WASTE_CHUTE,
252+
},
253+
],
253254
])
254255
})
255256
})

app/src/organisms/DeviceDetailsDeckConfiguration/utils.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
THERMOCYCLER_MODULE_V2,
1111
TRASH_BIN_ADAPTER_FIXTURE,
1212
WASTE_CHUTE_CUTOUT,
13+
WASTE_CHUTE_RIGHT_ADAPTER_COVERED_FIXTURE,
1314
WASTE_CHUTE_RIGHT_ADAPTER_NO_COVER_FIXTURE,
1415
} from '@opentrons/shared-data'
1516

@@ -204,6 +205,13 @@ export const getWasteChuteOptions = (
204205
addressableAreaId: DEFAULT_AA_FOR_WASTE_CHUTE,
205206
},
206207
],
208+
[
209+
{
210+
cutoutId,
211+
cutoutFixtureId: WASTE_CHUTE_RIGHT_ADAPTER_COVERED_FIXTURE,
212+
addressableAreaId: DEFAULT_AA_FOR_WASTE_CHUTE,
213+
},
214+
],
207215
]
208216
} else {
209217
return []
@@ -252,10 +260,6 @@ export const getFixtureOptions = (
252260
]
253261
}
254262

255-
if (cutoutId === 'cutoutD3' && addressableAreaId === 'D3') {
256-
const wasteChuteOptions = getWasteChuteOptions(cutoutId)
257-
availableOptions = [...availableOptions, ...wasteChuteOptions]
258-
}
259263
return availableOptions
260264
}
261265

components/src/hardware-sim/DeckConfigurator/index.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -336,11 +336,7 @@ export function DeckConfigurator(props: DeckConfiguratorProps): JSX.Element {
336336
<SlotLabels
337337
robotType={FLEX_ROBOT_TYPE}
338338
color={darkFill}
339-
show4thColumn={
340-
stagingAreaItems.length > 0 ||
341-
absorbanceReaderItems.length > 0 ||
342-
flexStackerItems.length > 0
343-
}
339+
show4thColumn={true}
344340
/>
345341
{children}
346342
</RobotCoordinateSpace>

shared-data/js/__tests__/fixtures.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ describe('getAddressableAreaWithFakesMatchForAreaId', () => {
176176
'wasteChuteRightAdapterNoCover',
177177
'D3'
178178
)
179-
expect(result).toEqual('96ChannelWasteChute')
179+
expect(result).toEqual('1ChannelWasteChute')
180180
})
181181

182182
it('Should find an aa for staging area', () => {
@@ -320,7 +320,7 @@ describe('getFlexDeckDefAAByFixtureIdForCutoutId', () => {
320320
],
321321
fakeStagingAreaRightSlot: ['D3', 'fakeD4'],
322322
fakeStagingSlotWithMagBlockV1: ['magneticBlockV1D3', 'fakeD4'],
323-
fakeWasteChuteWithEmptySlot: ['96ChannelWasteChute', 'fakeD4'],
323+
fakeWasteChuteWithEmptySlot: ['1ChannelWasteChute', 'fakeD4'],
324324
flexStackerModuleV1: ['D3', 'flexStackerModuleV1D4'],
325325
flexStackerModuleV1WithMagneticBlockV1: [
326326
'flexStackerModuleV1D4',

shared-data/js/constants.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -690,21 +690,21 @@ export const SINGLE_SLOT_FIXTURES: CutoutFixtureIdsWithFakes[] = [
690690
]
691691

692692
export const WASTE_CHUTE_FIXTURES: CutoutFixtureId[] = [
693-
// TODO (tz, 6-14-25): we need to remove this from our code base?
694693
WASTE_CHUTE_RIGHT_ADAPTER_COVERED_FIXTURE,
695694
WASTE_CHUTE_RIGHT_ADAPTER_NO_COVER_FIXTURE,
696695
STAGING_AREA_SLOT_WITH_WASTE_CHUTE_RIGHT_ADAPTER_COVERED_FIXTURE,
697696
STAGING_AREA_SLOT_WITH_WASTE_CHUTE_RIGHT_ADAPTER_NO_COVER_FIXTURE,
698697
FLEX_STACKER_WTIH_WASTE_CHUTE_ADAPTER_NO_COVER_FIXTURE,
698+
FLEX_STACKER_WITH_WASTE_CHUTE_ADAPTER_COVERED_FIXTURE,
699699
]
700700

701701
export const WASTE_CHUTE_WITH_FAKE_FIXTURES: CutoutFixtureIdsWithFakes[] = [
702-
// TODO (tz, 6-14-25): we need to remove this from our code base?
703702
WASTE_CHUTE_RIGHT_ADAPTER_COVERED_FIXTURE,
704703
WASTE_CHUTE_RIGHT_ADAPTER_NO_COVER_FIXTURE,
705704
STAGING_AREA_SLOT_WITH_WASTE_CHUTE_RIGHT_ADAPTER_COVERED_FIXTURE,
706705
STAGING_AREA_SLOT_WITH_WASTE_CHUTE_RIGHT_ADAPTER_NO_COVER_FIXTURE,
707706
FLEX_STACKER_WTIH_WASTE_CHUTE_ADAPTER_NO_COVER_FIXTURE,
707+
FLEX_STACKER_WITH_WASTE_CHUTE_ADAPTER_COVERED_FIXTURE,
708708
FAKE_WASTE_CHUTE_WITH_EMPTY_SLOT,
709709
]
710710

@@ -737,11 +737,12 @@ export const COMBO_FIXTURES: CutoutFixtureIdsWithFakes[] = [
737737
STAGING_AREA_RIGHT_SLOT_FIXTURE,
738738
]
739739

740+
export const DEFAULT_AA_FOR_WASTE_CHUTE = ONE_CHANNEL_WASTE_CHUTE_ADDRESSABLE_AREA
741+
740742
export const STAGING_AREA_FIXTURES: CutoutFixtureId[] = [
741743
STAGING_AREA_RIGHT_SLOT_FIXTURE,
742744
STAGING_AREA_SLOT_WITH_MAGNETIC_BLOCK_V1_FIXTURE,
743745
]
744-
export const DEFAULT_AA_FOR_WASTE_CHUTE = '96ChannelWasteChute'
745746

746747
export const LOW_VOLUME_PIPETTES = ['p50_single_flex', 'p50_multi_flex']
747748

shared-data/js/fixtures.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ export const FAKE_FIXTURES_AND_AA: DeckDefinitionWithFakes = {
315315
providesAddressableAreas: {
316316
cutoutD1: [],
317317
cutoutD2: [],
318-
cutoutD3: ['96ChannelWasteChute', 'fakeD4'],
318+
cutoutD3: ['1ChannelWasteChute', 'fakeD4'],
319319
cutoutC1: [],
320320
cutoutC2: [],
321321
cutoutC3: [],
@@ -703,6 +703,7 @@ export function getAAComboFixtureDisplayName(
703703
const translationFileName = 'deck_configuration'
704704
switch (cutoutFixtureId) {
705705
case FLEX_STACKER_WTIH_WASTE_CHUTE_ADAPTER_NO_COVER_FIXTURE:
706+
case FLEX_STACKER_WITH_WASTE_CHUTE_ADAPTER_COVERED_FIXTURE:
706707
if (aaItem.areaType === 'flexStacker') {
707708
return usbPortNumber != null
708709
? t(`${translationFileName}:module_in_port`, {
@@ -755,7 +756,7 @@ export function getFixtureDisplayName(
755756
case WASTE_CHUTE_RIGHT_ADAPTER_NO_COVER_FIXTURE:
756757
return 'Waste chute'
757758
case WASTE_CHUTE_RIGHT_ADAPTER_COVERED_FIXTURE:
758-
return 'Waste chute only with cover'
759+
return 'Waste chute with cover'
759760
case STAGING_AREA_SLOT_WITH_WASTE_CHUTE_RIGHT_ADAPTER_NO_COVER_FIXTURE:
760761
return 'Waste chute with staging area slot'
761762
case STAGING_AREA_SLOT_WITH_WASTE_CHUTE_RIGHT_ADAPTER_COVERED_FIXTURE:

0 commit comments

Comments
 (0)