Skip to content

Commit 3fb516b

Browse files
committed
refactor labwareLocationUpdate
1 parent 5ca1bca commit 3fb516b

File tree

14 files changed

+160
-338
lines changed

14 files changed

+160
-338
lines changed

protocol-designer/src/labware-ingred/__tests__/actions.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ describe('createContainer', () => {
122122
labwareDefURI: 'someLabwareDefURI',
123123
slot: '4',
124124
displayCategory: 'wellPlate',
125-
isOnHopper: false,
126125
},
127126
},
128127
]
@@ -169,7 +168,6 @@ describe('createContainer', () => {
169168
labwareDefURI: 'someLabwareDefURI',
170169
slot: '3',
171170
displayCategory: 'wellPlate',
172-
isOnHopper: false,
173171
},
174172
},
175173
]
@@ -266,7 +264,6 @@ describe('createContainer', () => {
266264
labwareDefURI: 'someLabwareDefURI',
267265
slot: '4',
268266
displayCategory: 'tipRack',
269-
isOnHopper: false,
270267
},
271268
},
272269
{

protocol-designer/src/labware-ingred/actions/actions.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ export interface CreateContainerArgs {
7979
// NOTE: if slot is omitted, next available slot will be used.
8080
slot?: DeckSlot
8181
updateSelectedLabwareId?: boolean
82-
isOnHopper?: boolean
8382
}
8483

8584
export interface CreateContainerAction {
@@ -89,7 +88,6 @@ export interface CreateContainerAction {
8988
slot: DeckSlot
9089
id: string
9190
displayCategory: LabwareDisplayCategory
92-
isOnHopper: boolean
9391
}
9492
}
9593
export interface DeleteContainerAction {
@@ -126,7 +124,6 @@ export interface DuplicateLabwareAction {
126124
duplicateLabwareNickname: string
127125
slot: DeckSlot
128126
displayCategory: LabwareDisplayCategory
129-
isOnHopper: boolean
130127
}
131128
}
132129

protocol-designer/src/labware-ingred/actions/thunks.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const createContainer: (
6363
| ZoomedIntoSlotAction
6464
| OpenIngredientSelectorAction
6565
> = args => (dispatch, getState) => {
66-
const { labwareDefURIStack, slot, updateSelectedLabwareId, isOnHopper } = args
66+
const { labwareDefURIStack, slot, updateSelectedLabwareId } = args
6767
const state = getState()
6868
const initialDeckSetup = stepFormSelectors.getInitialDeckSetup(state)
6969
const robotType = getRobotType(state)
@@ -89,7 +89,6 @@ export const createContainer: (
8989
labwareDefURI: labwareUri,
9090
slot: currentSlot,
9191
displayCategory: labwareDisplayCategory,
92-
isOnHopper: isOnHopper ?? false,
9392
},
9493
})
9594

@@ -126,12 +125,11 @@ export const createContainer: (
126125

127126
interface DuplicateLabwareProps {
128127
templateLabwareIds: string[]
129-
isOnHopper?: boolean
130128
}
131129
export const duplicateLabware: (
132130
props: DuplicateLabwareProps
133131
) => ThunkAction<DuplicateLabwareAction> = args => (dispatch, getState) => {
134-
const { isOnHopper, templateLabwareIds } = args
132+
const { templateLabwareIds } = args
135133
const state = getState()
136134
const robotType = state.fileData.robotType
137135
const labwareEntities = stepFormSelectors.getLabwareEntities(state)
@@ -186,7 +184,6 @@ export const duplicateLabware: (
186184
duplicateLabwareId,
187185
slot,
188186
displayCategory,
189-
isOnHopper: isOnHopper ?? false,
190187
},
191188
})
192189

protocol-designer/src/load-file/migration/8_8_0.ts

Lines changed: 0 additions & 62 deletions
This file was deleted.

protocol-designer/src/load-file/migration/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { migrateFile as migrateFileEightFive } from './8_5_0'
1919
import { migrateFile as migrateFileEightFiveFive } from './8_5_5'
2020
import { migrateFile as migrateFileEightSix } from './8_6_0'
2121
import { migrateFile as migrateFileEightSeven } from './8_7_0'
22-
import { migrateFile as migrateFileEightEight } from './8_8_0'
2322

2423
import type {
2524
PDProtocolFile,
@@ -78,8 +77,6 @@ const allMigrationsByVersion: MigrationsByVersion = {
7877
'8.6.0': migrateFileEightSix,
7978
// @ts-expect-error
8079
'8.7.0': migrateFileEightSeven,
81-
// @ts-expect-error
82-
'8.8.0': migrateFileEightEight,
8380
}
8481
export const migration = (
8582
file: any

protocol-designer/src/pages/Designer/DeckSetup/DeckSetupToolbox.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ import {
1919
Toolbox,
2020
TYPOGRAPHY,
2121
} from '@opentrons/components'
22-
import { ABSORBANCE_READER_V1 } from '@opentrons/shared-data'
22+
import {
23+
ABSORBANCE_READER_V1,
24+
FLEX_STACKER_MODULE_V1,
25+
} from '@opentrons/shared-data'
2326
import {
2427
getIsSlotAHopper,
2528
HOPPER_LOCATION_MAP,
@@ -151,12 +154,15 @@ export function DeckSetupToolbox(
151154
const isOffDeck = slot === 'offDeck'
152155
const hasModule = selectedModuleModel != null
153156
const isHopperSlot = getIsSlotAHopper(slot)
157+
const isOnShuttle =
158+
!isHopperSlot && selectedModuleModel === FLEX_STACKER_MODULE_V1
154159

155160
// handle clear for if you are changing the adapter/labware combo
156161
if (!isOffDeck) {
157162
handleClear()
158163
}
159-
if (hasModule) {
164+
// NOTE: labware on the Flex Stacker shuttle is not on any module ;)
165+
if (hasModule && !isOnShuttle) {
160166
dispatch(
161167
createContainerAboveModule({
162168
slot: isHopperSlot
@@ -169,7 +175,6 @@ export function DeckSetupToolbox(
169175
: []),
170176
...(selectedLidLabware != null ? [selectedLidLabware] : []),
171177
],
172-
isOnHopper: isHopperSlot,
173178
})
174179
)
175180
} else {

protocol-designer/src/pages/Designer/DeckSetup/SlotOverflowMenu.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
} from '@opentrons/components'
1818
import {
1919
getFullStackFromLabwares,
20-
getIsSlotAHopper,
2120
getTopLocationInStack,
2221
} from '@opentrons/step-generation'
2322

@@ -82,7 +81,6 @@ export function SlotOverflowMenu(
8281
invertY = false,
8382
} = props
8483
const { t } = useTranslation('starting_deck_state')
85-
const isOnHopper = getIsSlotAHopper(location)
8684
const savedSteps = useSelector(getSavedStepForms)
8785
const dispatch = useDispatch<ThunkDispatch<any>>()
8886
const [showDeleteLabwareModal, setShowDeleteLabwareModal] =
@@ -140,9 +138,7 @@ export function SlotOverflowMenu(
140138
makeSnackbar(t('deck_slots_full') as string)
141139
return
142140
}
143-
dispatch(
144-
duplicateLabware({ templateLabwareIds: labwareStackOnSlot, isOnHopper })
145-
)
141+
dispatch(duplicateLabware({ templateLabwareIds: labwareStackOnSlot }))
146142
setShowMenuList(false)
147143
}
148144

protocol-designer/src/step-forms/actions/thunks.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import type { CreateModuleAction } from './modules'
2222
export interface CreateContainerAboveModuleArgs {
2323
slot: DeckSlotId
2424
labwareDefURIStack: string[]
25-
isOnHopper: boolean
2625
}
2726

2827
export const createContainerAboveModule: (
@@ -33,7 +32,7 @@ export const createContainerAboveModule: (
3332
| ZoomedIntoSlotAction
3433
| OpenIngredientSelectorAction
3534
> = args => (dispatch, getState) => {
36-
const { slot, labwareDefURIStack, isOnHopper } = args
35+
const { slot, labwareDefURIStack } = args
3736
const state = getState()
3837
const deckSetup = getDeckSetupForActiveItem(state)
3938
const modules = deckSetup.modules
@@ -44,7 +43,6 @@ export const createContainerAboveModule: (
4443
createContainer({
4544
slot: moduleId,
4645
labwareDefURIStack,
47-
isOnHopper,
4846
})
4947
)
5048
}

0 commit comments

Comments
 (0)