diff --git a/protocol-designer/src/components/DeckSetup/SlotLabels.tsx b/protocol-designer/src/components/DeckSetup/SlotLabels.tsx index a357197e98c..0efcc8a5a3b 100644 --- a/protocol-designer/src/components/DeckSetup/SlotLabels.tsx +++ b/protocol-designer/src/components/DeckSetup/SlotLabels.tsx @@ -15,6 +15,7 @@ import type { RobotType } from '@opentrons/shared-data' interface SlotLabelsProps { robotType: RobotType hasStagingAreas: boolean + hasWasteChute: boolean } /** @@ -25,6 +26,7 @@ interface SlotLabelsProps { export const SlotLabels = ({ robotType, hasStagingAreas, + hasWasteChute, }: SlotLabelsProps): JSX.Element | null => { return robotType === FLEX_ROBOT_TYPE ? ( <> @@ -59,7 +61,7 @@ export const SlotLabels = ({ height="2.5rem" width={hasStagingAreas ? '40.5rem' : '30.375rem'} x="-15" - y="-65" + y={hasWasteChute ? '-90' : '-65'} > { ] const wasteChuteFixtures = Object.values( activeDeckSetup.additionalEquipmentOnDeck - ).filter(aE => - WASTE_CHUTE_ADDRESSABLE_AREAS.includes(aE.name as AddressableAreaName) - ) + ).filter(aE => WASTE_CHUTE_CUTOUT.includes(aE.location as CutoutId)) const stagingAreaFixtures: AdditionalEquipmentEntity[] = Object.values( activeDeckSetup.additionalEquipmentOnDeck - ).filter(aE => - FLEX_STAGING_AREA_SLOT_ADDRESSABLE_AREAS.includes( - aE.name as AddressableAreaName - ) - ) + ).filter(aE => STAGING_AREA_CUTOUTS.includes(aE.location as CutoutId)) + + const hasWasteChute = wasteChuteFixtures.length > 0 const filteredAddressableAreas = deckDef.locations.addressableAreas.filter( aa => isAddressableAreaStandardSlot(aa.id, deckDef) @@ -561,7 +556,11 @@ export const DeckSetup = (): JSX.Element => { {({ getRobotCoordsFromDOMCoords }) => ( <> @@ -647,6 +646,7 @@ export const DeckSetup = (): JSX.Element => { 0} + hasWasteChute={hasWasteChute} /> )} diff --git a/protocol-designer/src/components/modules/StagingAreasModal.tsx b/protocol-designer/src/components/modules/StagingAreasModal.tsx index a5fd5a258ec..6a4cada13d3 100644 --- a/protocol-designer/src/components/modules/StagingAreasModal.tsx +++ b/protocol-designer/src/components/modules/StagingAreasModal.tsx @@ -23,6 +23,7 @@ import { STAGING_AREA_CUTOUTS, STAGING_AREA_RIGHT_SLOT_FIXTURE, } from '@opentrons/shared-data' +import { getStagingAreaSlots } from '../../utils' import { i18n } from '../../localization' import { createDeckFixture, @@ -31,8 +32,7 @@ import { import { getSlotIsEmpty } from '../../step-forms' import { getInitialDeckSetup } from '../../step-forms/selectors' import { PDAlert } from '../alerts/PDAlert' -import { AdditionalEquipmentEntity } from '@opentrons/step-generation' -import { getStagingAreaSlots } from '../../utils' +import type { AdditionalEquipmentEntity } from '@opentrons/step-generation' export interface StagingAreasValues { selectedSlots: string[] @@ -107,15 +107,15 @@ const StagingAreasModalComponent = ( const handleClickRemove = (cutoutId: string): void => { const modifiedSlots: DeckConfiguration = updatedSlots.map(slot => { if (slot.cutoutId === cutoutId) { - return { ...slot, loadName: SINGLE_RIGHT_SLOT_FIXTURE } + return { ...slot, cutoutFixtureId: SINGLE_RIGHT_SLOT_FIXTURE } } return slot }) setUpdatedSlots(modifiedSlots) - const updatedSelectedSlots = values.selectedSlots.filter( - item => item !== cutoutId + setFieldValue( + 'selectedSlots', + values.selectedSlots.filter(item => item !== cutoutId) ) - setFieldValue('selectedSlots', updatedSelectedSlots) } return (