Skip to content

Commit

Permalink
fix(app): fix labware location on labware details modal (ODD protocol…
Browse files Browse the repository at this point in the history
… details) (#16198)

On ODD Protocol Details > Deck tab, we render the protocol deck with
clickable labware. Clicking a
labware or stack should render the appropriate modal, whose header
should be the location of that
labware or stack. However, similar to how we handle this in Protocol
Setup, we need to find the
__initial__ locaiton of the labware at load time, rather than the final
location of the labware.
Here, I access that initial location to properly display the slot
location icon for labware that is
moved.

Closes [RQA-3149](https://opentrons.atlassian.net/browse/RQA-3149)
  • Loading branch information
ncdiehl11 authored Sep 5, 2024
1 parent d045115 commit 8713caa
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions app/src/pages/ProtocolDetails/Deck.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,23 @@ export const Deck = (props: { protocolId: string }): JSX.Element => {
labware => labware.id === labwareId
)
if (foundLabware != null) {
const location = onDeckItems.find(
item => item.labwareId === foundLabware.id
)?.initialLocation
const nickName = onDeckItems.find(
item => getLabwareDefURI(item.definition) === foundLabware.definitionUri
)?.nickName
setSelectedLabware({
...labwareDef,
location: foundLabware.location,
nickName: nickName ?? null,
id: labwareId,
})
setShowLabwareDetailsModal(true)
if (location != null) {
setSelectedLabware({
...labwareDef,
location: location,
nickName: nickName ?? null,
id: labwareId,
})
setShowLabwareDetailsModal(true)
} else {
console.warn('no initial labware location found')
}
}
}

Expand Down

0 comments on commit 8713caa

Please sign in to comment.