From 5b575232fefd9c5d7f93fc405aa0cf83498eae67 Mon Sep 17 00:00:00 2001 From: Jethary Date: Fri, 25 Apr 2025 09:10:18 -0400 Subject: [PATCH] refactor(labware-library, app, shared-data): add adapter/labware combos to retired labware closes RQA-4107 --- app/src/organisms/Desktop/Labware/LabwareCard/index.tsx | 7 +++++-- .../organisms/Desktop/Labware/LabwareDetails/index.tsx | 6 ++++-- .../src/components/LabwareDetails/LabwareTitle.tsx | 9 +++++---- .../src/components/LabwareList/LabwareCard.tsx | 7 ++++--- shared-data/js/helpers/index.ts | 6 ++++++ 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/app/src/organisms/Desktop/Labware/LabwareCard/index.tsx b/app/src/organisms/Desktop/Labware/LabwareCard/index.tsx index c954a292510..e815ccf259a 100644 --- a/app/src/organisms/Desktop/Labware/LabwareCard/index.tsx +++ b/app/src/organisms/Desktop/Labware/LabwareCard/index.tsx @@ -18,7 +18,10 @@ import { SPACING, TYPOGRAPHY, } from '@opentrons/components' -import { getLabwareDefIsStandard } from '@opentrons/shared-data' +import { + getLabwareDefIsStandard, + getLabwareDisplayName, +} from '@opentrons/shared-data' import { UNIVERSAL_FLAT_ADAPTER_X_DIMENSION } from '../LabwareDetails/Gallery' import { CustomLabwareOverflowMenu } from './CustomLabwareOverflowMenu' @@ -34,7 +37,7 @@ export function LabwareCard(props: LabwareCardProps): JSX.Element { const { t } = useTranslation(['labware_landing', 'branded']) const { definition, modified, filename } = props.labware const apiName = definition.parameters.loadName - const displayName = definition?.metadata.displayName + const displayName = getLabwareDisplayName(definition) const displayCategory = startCase(definition.metadata.displayCategory) const isCustomDefinition = !getLabwareDefIsStandard(definition) const xDimensionOverride = diff --git a/app/src/organisms/Desktop/Labware/LabwareDetails/index.tsx b/app/src/organisms/Desktop/Labware/LabwareDetails/index.tsx index ee668732258..f2533cb67f5 100644 --- a/app/src/organisms/Desktop/Labware/LabwareDetails/index.tsx +++ b/app/src/organisms/Desktop/Labware/LabwareDetails/index.tsx @@ -24,6 +24,7 @@ import { } from '@opentrons/components' import { getLabwareDefIsStandard, + getLabwareDisplayName, getUniqueWellProperties, } from '@opentrons/shared-data' @@ -73,7 +74,8 @@ export function LabwareDetails(props: LabwareDetailsProps): JSX.Element { const { t } = useTranslation(['labware_landing', 'branded']) const { definition, modified, filename } = props.labware const { metadata, parameters, brand, wells, ordering } = definition - const apiName = definition.parameters.loadName + const displayName = getLabwareDisplayName(definition) + const apiName = parameters.loadName const { displayVolumeUnits } = metadata const wellGroups = getUniqueWellProperties(definition) const wellLabel = getWellLabel(definition) @@ -114,7 +116,7 @@ export function LabwareDetails(props: LabwareDetailsProps): JSX.Element { justifyContent={JUSTIFY_SPACE_BETWEEN} > - {props.labware.definition.metadata.displayName} + {displayName} {CATEGORY} {category} -

{metadata.displayName}

+

{displayName}

) } diff --git a/labware-library/src/components/LabwareList/LabwareCard.tsx b/labware-library/src/components/LabwareList/LabwareCard.tsx index fe504df4118..56e8fc528c3 100644 --- a/labware-library/src/components/LabwareList/LabwareCard.tsx +++ b/labware-library/src/components/LabwareList/LabwareCard.tsx @@ -1,6 +1,7 @@ // labware display card import uniq from 'lodash/uniq' import { Icon } from '@opentrons/components' +import { getLabwareDisplayName } from '@opentrons/shared-data' import { isNewLabware } from '../../definitions' import { @@ -73,11 +74,11 @@ function TopBar(props: LabwareCardProps): JSX.Element { } function Title(props: LabwareCardProps): JSX.Element { - const { loadName } = props.definition.parameters - const { displayName } = props.definition.metadata + const { definition } = props + const displayName = getLabwareDisplayName(definition) return ( - +

{displayName} diff --git a/shared-data/js/helpers/index.ts b/shared-data/js/helpers/index.ts index 8fc2b8ac5d8..775a3c6d067 100644 --- a/shared-data/js/helpers/index.ts +++ b/shared-data/js/helpers/index.ts @@ -108,6 +108,12 @@ export const RETIRED_LABWARE = [ // Replaced by opentrons_96_wellplate_200ul_pcr_full_skirt // https://opentrons.atlassian.net/browse/RLAB-230 'armadillo_96_wellplate_200ul_pcr_full_skirt', + // adapter/labware combo defs + 'opentrons_universal_flat_adapter_corning_384_wellplate_112ul_flat', + 'opentrons_96_pcr_adapter_nest_wellplate_100ul_pcr_full_skirt', + 'opentrons_96_flat_bottom_adapter_nest_wellplate_200ul_flat', + 'opentrons_96_deep_well_adapter_nest_wellplate_2ml_deep', + 'opentrons_96_pcr_adapter_armadillo_wellplate_200ul', ] export const getLabwareDisplayName = (