Skip to content

Commit fa33c33

Browse files
authored
fix(app): show labware def display name in lpc summary screen, fix nested lw render condition (#9614)
1 parent 474c448 commit fa33c33

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

app/src/organisms/ProtocolSetup/LabwarePositionCheck/StepDetailText.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ export const StepDetailText = (
3030
] = React.useState<boolean>(false)
3131
if (protocolData == null) return null
3232
const labwareDefId = protocolData.labware[labwareId].definitionId
33-
const displayName =
34-
protocolData.labwareDefinitions[labwareDefId].metadata.displayName
33+
const labwareDef = protocolData.labwareDefinitions[labwareDefId]
34+
const { displayName } = labwareDef.metadata
35+
const { isTiprack } = labwareDef.parameters
3536

3637
return (
3738
<React.Fragment>
@@ -48,7 +49,7 @@ export const StepDetailText = (
4849
<Trans
4950
t={t}
5051
i18nKey={
51-
displayName.includes('Tip Rack')
52+
isTiprack
5253
? 'labware_step_detail_tiprack'
5354
: 'labware_step_detail_labware'
5455
}

app/src/organisms/ProtocolSetup/LabwarePositionCheck/SummaryScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const SummaryScreen = (props: {
4141
labwareOffsets.length === 0 && setLabwareOffsets(offsets)
4242
})
4343
.catch((e: Error) =>
44-
console.error(`error getting labware offsetsL ${e.message}`)
44+
console.error(`error getting labware offsets: ${e.message}`)
4545
)
4646
const { createLabwareOffset } = useCreateLabwareOffsetMutation()
4747
const runId = useCurrentRunId()

app/src/organisms/ProtocolSetup/LabwarePositionCheck/__tests__/SummaryScreen.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ describe('SummaryScreen', () => {
8888
labware: {
8989
'1d57fc10-67ad-11ea-9f8b-3b50068bd62d:opentrons/opentrons_96_filtertiprack_200ul/1': {
9090
slot: '1',
91-
displayName: 'someDislpayName',
91+
displayName: 'someDisplayName',
9292
definitionId: LABWARE_DEF_ID,
9393
},
9494
},

app/src/organisms/ProtocolSetup/LabwarePositionCheck/hooks/useLabwareOffsets.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import reduce from 'lodash/reduce'
22
import { useTranslation, TFunction } from 'react-i18next'
33
import {
44
getModuleDisplayName,
5+
getLabwareDisplayName,
56
getModuleType,
67
ProtocolFile,
78
THERMOCYCLER_MODULE_TYPE,
@@ -79,7 +80,10 @@ export const useLabwareOffsets = (
7980
protocolData.labware,
8081
protocolData.labwareDefinitions
8182
)
82-
const displayName = protocolData.labware[labwareId].displayName ?? ''
83+
const { definitionId } = protocolData.labware[labwareId]
84+
const displayName = getLabwareDisplayName(
85+
protocolData.labwareDefinitions[definitionId]
86+
)
8387
const vectorPromise = offsetDataByLabwareId.then(result => ({
8488
...result[labwareId],
8589
}))

app/src/organisms/ProtocolSetup/RunSetupCard/LabwareSetup/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,7 @@ export const LabwareSetup = (): JSX.Element | null => {
194194
: {}
195195
}
196196
>
197-
{nestedLabwareDef != null &&
198-
nestedLabwareId != null &&
199-
nestedLabwareDisplayName ? (
197+
{nestedLabwareDef != null && nestedLabwareId != null ? (
200198
<React.Fragment
201199
key={`LabwareSetup_Labware_${nestedLabwareDef.metadata.displayName}_${x}${y}`}
202200
>

0 commit comments

Comments
 (0)