Skip to content

Commit 21572f0

Browse files
authored
fix(app): instead filter magnetic blocks (not magnetic modules) out of the required modules (#15232)
Fix bug where we were accidentally filtering magnetic modules instead of magnetic blocks from the required modules list from analysis. Closes [RQA-2754](https://opentrons.atlassian.net/browse/RQA-2754)
1 parent 4dfd608 commit 21572f0

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

app/src/pages/ProtocolDetails/Hardware.tsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import {
1919
getModuleType,
2020
getFixtureDisplayName,
2121
GRIPPER_V1_2,
22+
MAGNETIC_BLOCK_FIXTURES,
23+
MAGNETIC_BLOCK_TYPE,
2224
} from '@opentrons/shared-data'
2325

2426
import {
@@ -119,26 +121,33 @@ function HardwareItem({
119121
<LocationIcon slotName={getCutoutDisplayName(hardware.location.cutout)} />
120122
)
121123
}
124+
const isMagneticBlockFixture =
125+
hardware.hardwareType === 'fixture' &&
126+
hardware.cutoutFixtureId != null &&
127+
MAGNETIC_BLOCK_FIXTURES.includes(hardware.cutoutFixtureId)
128+
let iconModuleType = null
129+
if (hardware.hardwareType === 'module') {
130+
iconModuleType = getModuleType(hardware.moduleModel)
131+
} else if (isMagneticBlockFixture) {
132+
iconModuleType = MAGNETIC_BLOCK_TYPE
133+
}
122134
return (
123135
<TableRow>
124136
<TableDatum>
125137
<Flex paddingLeft={SPACING.spacing24}>{location}</Flex>
126138
</TableDatum>
127139
<TableDatum>
128140
<Flex paddingLeft={SPACING.spacing24}>
129-
{hardware.hardwareType === 'module' && (
141+
{iconModuleType != null ? (
130142
<Flex
131143
alignItems={ALIGN_CENTER}
132144
height="2rem"
133145
paddingBottom={SPACING.spacing4}
134146
paddingRight={SPACING.spacing8}
135147
>
136-
<ModuleIcon
137-
moduleType={getModuleType(hardware.moduleModel)}
138-
size="1.75rem"
139-
/>
148+
<ModuleIcon moduleType={iconModuleType} size="1.75rem" />
140149
</Flex>
141-
)}
150+
) : null}
142151
<StyledText as="p">{hardwareName}</StyledText>
143152
</Flex>
144153
</TableDatum>

app/src/pages/Protocols/hooks/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import {
1414
getCutoutFixturesForModuleModel,
1515
FLEX_MODULE_ADDRESSABLE_AREAS,
1616
getModuleType,
17-
MAGNETIC_MODULE_TYPE,
1817
FLEX_USB_MODULE_ADDRESSABLE_AREAS,
18+
MAGNETIC_BLOCK_TYPE,
1919
} from '@opentrons/shared-data'
2020
import { getLabwareSetupItemGroups } from '../utils'
2121
import { getProtocolUsesGripper } from '../../../organisms/ProtocolSetupInstruments/utils'
@@ -111,7 +111,8 @@ export const useRequiredProtocolHardwareFromAnalysis = (
111111
: []
112112

113113
const requiredModules: ProtocolModule[] = analysis.modules
114-
.filter(m => getModuleType(m.model) !== MAGNETIC_MODULE_TYPE)
114+
// remove magnetic blocks, they're handled by required fixtures
115+
.filter(m => getModuleType(m.model) !== MAGNETIC_BLOCK_TYPE)
115116
.map(({ location, model }) => {
116117
const cutoutIdForSlotName = getCutoutIdForSlotName(
117118
location.slotName,

0 commit comments

Comments
 (0)