Skip to content

Commit 7cb3add

Browse files
authored
fix(protocol-designer): custom labware <> adapter combos (#17266)
closes RQA-3855
1 parent 18f9fb4 commit 7cb3add

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

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

+5-7
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ export function LabwareTools(props: LabwareToolsProps): JSX.Element {
385385
/>
386386

387387
{uri === selectedLabwareDefUri &&
388-
getLabwareCompatibleWithAdapter(loadName)
388+
getLabwareCompatibleWithAdapter(defs, loadName)
389389
?.length > 0 && (
390390
<ListButtonAccordionContainer
391391
id={`nestedAccordionContainer_${loadName}`}
@@ -435,12 +435,10 @@ export function LabwareTools(props: LabwareToolsProps): JSX.Element {
435435
)
436436
}
437437
)
438-
: [
439-
...getLabwareCompatibleWithAdapter(
440-
loadName
441-
),
442-
...Object.keys(customLabwareDefs),
443-
].map(nestedDefUri => {
438+
: getLabwareCompatibleWithAdapter(
439+
{ ...defs, ...customLabwareDefs },
440+
loadName
441+
).map(nestedDefUri => {
444442
const nestedDef =
445443
defs[nestedDefUri] ??
446444
customLabwareDefs[nestedDefUri]

protocol-designer/src/pages/Designer/DeckSetup/utils.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
getModuleType,
1515
} from '@opentrons/shared-data'
1616

17-
import { getOnlyLatestDefs } from '../../../labware-defs'
1817
import { getStagingAreaAddressableAreas } from '../../../utils'
1918
import {
2019
FLEX_MODULE_MODELS,
@@ -33,6 +32,7 @@ import type {
3332
ModuleModel,
3433
RobotType,
3534
} from '@opentrons/shared-data'
35+
import type { LabwareDefByDefURI } from '../../../labware-defs'
3636
import type {
3737
AllTemporalPropertiesForTimelineFrame,
3838
InitialDeckSetup,
@@ -132,14 +132,12 @@ export const getLabwareIsRecommended = (
132132
}
133133

134134
export const getLabwareCompatibleWithAdapter = (
135+
defs: LabwareDefByDefURI,
135136
adapterLoadName?: string
136137
): string[] => {
137-
const defs = getOnlyLatestDefs()
138-
139138
if (adapterLoadName == null) {
140139
return []
141140
}
142-
143141
return Object.entries(defs)
144142
.filter(
145143
([, { stackingOffsetWithLabware }]) =>

0 commit comments

Comments
 (0)