Skip to content

Commit

Permalink
Use slot level detail for lpc headers
Browse files Browse the repository at this point in the history
  • Loading branch information
smb2268 committed Nov 21, 2024
1 parent 9c559ca commit 812cf62
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
11 changes: 9 additions & 2 deletions app/src/organisms/LabwarePositionCheck/CheckItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,13 @@ export const CheckItem = (props: CheckItemProps): JSX.Element | null => {
t as TFunction,
i18n
)
const slotOnlyDisplayLocation = getDisplayLocation(
location,
labwareDefs,
t as TFunction,
i18n,
true
)
const labwareDisplayName = getLabwareDisplayName(labwareDef)

let placeItemInstruction: JSX.Element = (
Expand Down Expand Up @@ -445,7 +452,7 @@ export const CheckItem = (props: CheckItemProps): JSX.Element | null => {
<JogToWell
header={t('check_item_in_location', {
item: isTiprack ? t('tip_rack') : t('labware'),
location: displayLocation,
location: slotOnlyDisplayLocation,
})}
body={
<Trans
Expand Down Expand Up @@ -483,7 +490,7 @@ export const CheckItem = (props: CheckItemProps): JSX.Element | null => {
{...props}
header={t('prepare_item_in_location', {
item: isTiprack ? t('tip_rack') : t('labware'),
location: displayLocation,
location: slotOnlyDisplayLocation,
})}
body={
<UnorderedList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ export function getDisplayLocation(
location: LabwareOffsetLocation,
labwareDefinitions: LabwareDefinition2[],
t: TFunction,
i18n: i18n
i18n: i18n,
slotOnly?: boolean
): string {
const slotDisplayLocation = i18n.format(
t('slot_name', { slotName: location.slotName }),
'titleCase'
)
if (slotOnly) {
return slotDisplayLocation
}

if ('definitionUri' in location && location.definitionUri != null) {
const adapterDisplayName = labwareDefinitions.find(
Expand Down

0 comments on commit 812cf62

Please sign in to comment.