Skip to content

Commit

Permalink
fix(app): fix labware location on labware details modal (#16164)
Browse files Browse the repository at this point in the history
On ProtocolSetupLabware, we open a labware modal, either single or
stacked, when a labware is clicked. That modal's header contains a
location icon that is meant to specify that labware's/stack's initial
position. The bug here arises because the location used for the modal
header is the analysis's labware location, which contains the labware's
final location. Here, I pull the location from load commands.

Closes RQA-2800, Closes RQA-3132
  • Loading branch information
ncdiehl11 authored Aug 29, 2024
1 parent f401e94 commit f05d1e5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
1 change: 1 addition & 0 deletions app/src/assets/localization/en/protocol_setup.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@
"offset_data": "Offset Data",
"offsets_applied_plural": "{{count}} offsets applied",
"offsets_applied": "{{count}} offset applied",
"offsets_confirmed": "Offsets confirmed",
"offsets_ready": "Offsets ready",
"on_adapter_in_mod": "on {{adapterName}} in {{moduleName}}",
"on_adapter": "on {{adapterName}}",
Expand Down
24 changes: 15 additions & 9 deletions app/src/organisms/ProtocolSetupLabware/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,20 @@ export function ProtocolSetupLabware({
const nickName = onDeckItems.find(
item => getLabwareDefURI(item.definition) === foundLabware.definitionUri
)?.nickName
setSelectedLabware({
...labwareDef,
location: foundLabware.location,
nickName: nickName ?? null,
id: labwareId,
})
setShowLabwareDetailsModal(true)
const location = onDeckItems.find(
item => item.labwareId === foundLabware.id
)?.initialLocation
if (location != null) {
setSelectedLabware({
...labwareDef,
location: location,
nickName: nickName ?? null,
id: labwareId,
})
setShowLabwareDetailsModal(true)
} else {
console.warn('no initial labware location found')
}
}
}
const selectedLabwareIsTopOfStack = mostRecentAnalysis?.commands.some(
Expand Down Expand Up @@ -176,9 +183,8 @@ export function ProtocolSetupLabware({
<Chip
background
iconName="ot-check"
text={t('placements_ready')}
text={t('placements_confirmed')}
type="success"
chipSize="small"
/>
) : (
<SmallButton
Expand Down
1 change: 0 additions & 1 deletion app/src/organisms/ProtocolSetupLiquids/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ export function ProtocolSetupLiquids({
iconName="ot-check"
text={t('liquids_confirmed')}
type="success"
chipSize="small"
/>
) : (
<SmallButton
Expand Down
3 changes: 1 addition & 2 deletions app/src/organisms/ProtocolSetupOffsets/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,8 @@ export function ProtocolSetupOffsets({
<Chip
background
iconName="ot-check"
text={t('placements_ready')}
text={t('offsets_confirmed')}
type="success"
chipSize="small"
/>
) : (
<SmallButton
Expand Down

0 comments on commit f05d1e5

Please sign in to comment.