Skip to content

Commit

Permalink
fix(protocol-designer): custom labware <> adapter combos (#17266)
Browse files Browse the repository at this point in the history
closes RQA-3855
  • Loading branch information
jerader authored Jan 14, 2025
1 parent 18f9fb4 commit 7cb3add
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
12 changes: 5 additions & 7 deletions protocol-designer/src/pages/Designer/DeckSetup/LabwareTools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ export function LabwareTools(props: LabwareToolsProps): JSX.Element {
/>

{uri === selectedLabwareDefUri &&
getLabwareCompatibleWithAdapter(loadName)
getLabwareCompatibleWithAdapter(defs, loadName)
?.length > 0 && (
<ListButtonAccordionContainer
id={`nestedAccordionContainer_${loadName}`}
Expand Down Expand Up @@ -435,12 +435,10 @@ export function LabwareTools(props: LabwareToolsProps): JSX.Element {
)
}
)
: [
...getLabwareCompatibleWithAdapter(
loadName
),
...Object.keys(customLabwareDefs),
].map(nestedDefUri => {
: getLabwareCompatibleWithAdapter(
{ ...defs, ...customLabwareDefs },
loadName
).map(nestedDefUri => {
const nestedDef =
defs[nestedDefUri] ??
customLabwareDefs[nestedDefUri]
Expand Down
6 changes: 2 additions & 4 deletions protocol-designer/src/pages/Designer/DeckSetup/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
getModuleType,
} from '@opentrons/shared-data'

import { getOnlyLatestDefs } from '../../../labware-defs'
import { getStagingAreaAddressableAreas } from '../../../utils'
import {
FLEX_MODULE_MODELS,
Expand All @@ -33,6 +32,7 @@ import type {
ModuleModel,
RobotType,
} from '@opentrons/shared-data'
import type { LabwareDefByDefURI } from '../../../labware-defs'
import type {
AllTemporalPropertiesForTimelineFrame,
InitialDeckSetup,
Expand Down Expand Up @@ -132,14 +132,12 @@ export const getLabwareIsRecommended = (
}

export const getLabwareCompatibleWithAdapter = (
defs: LabwareDefByDefURI,
adapterLoadName?: string
): string[] => {
const defs = getOnlyLatestDefs()

if (adapterLoadName == null) {
return []
}

return Object.entries(defs)
.filter(
([, { stackingOffsetWithLabware }]) =>
Expand Down

0 comments on commit 7cb3add

Please sign in to comment.