Skip to content

refactor(labware-library, app, shared-data): add adapter/labware comb… #18180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions app/src/organisms/Desktop/Labware/LabwareCard/index.tsx
Original file line number Diff line number Diff line change
@@ -18,7 +18,10 @@
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 @@
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)

Check warning on line 40 in app/src/organisms/Desktop/Labware/LabwareCard/index.tsx

Codecov / codecov/patch

app/src/organisms/Desktop/Labware/LabwareCard/index.tsx#L40

Added line #L40 was not covered by tests
const displayCategory = startCase(definition.metadata.displayCategory)
const isCustomDefinition = !getLabwareDefIsStandard(definition)
const xDimensionOverride =
6 changes: 4 additions & 2 deletions app/src/organisms/Desktop/Labware/LabwareDetails/index.tsx
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@
} from '@opentrons/components'
import {
getLabwareDefIsStandard,
getLabwareDisplayName,
getUniqueWellProperties,
} from '@opentrons/shared-data'

@@ -73,7 +74,8 @@
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

Check warning on line 78 in app/src/organisms/Desktop/Labware/LabwareDetails/index.tsx

Codecov / codecov/patch

app/src/organisms/Desktop/Labware/LabwareDetails/index.tsx#L77-L78

Added lines #L77 - L78 were not covered by tests
const { displayVolumeUnits } = metadata
const wellGroups = getUniqueWellProperties(definition)
const wellLabel = getWellLabel(definition)
@@ -114,7 +116,7 @@
justifyContent={JUSTIFY_SPACE_BETWEEN}
>
<LegacyStyledText css={TYPOGRAPHY.h2SemiBold}>
{props.labware.definition.metadata.displayName}
{displayName}

Check warning on line 119 in app/src/organisms/Desktop/Labware/LabwareDetails/index.tsx

Codecov / codecov/patch

app/src/organisms/Desktop/Labware/LabwareDetails/index.tsx#L119

Added line #L119 was not covered by tests
</LegacyStyledText>
<Link
onClick={props.onClose}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// labware details page title and category
import { getLabwareDisplayName } from '@opentrons/shared-data'

import { CATEGORY, CATEGORY_LABELS_BY_CATEGORY } from '../../localization'
import { LABEL_LEFT, LabelText, Value } from '../ui'
import styles from './styles.module.css'
@@ -12,10 +14,9 @@

export function LabwareTitle(props: LabwareTitleProps): JSX.Element {
const { definition, className } = props
const { metadata } = definition
const { displayCategory } = definition.metadata
const displayName = getLabwareDisplayName(definition)

Check warning on line 17 in labware-library/src/components/LabwareDetails/LabwareTitle.tsx

Codecov / codecov/patch

labware-library/src/components/LabwareDetails/LabwareTitle.tsx#L17

Added line #L17 was not covered by tests
const category =
CATEGORY_LABELS_BY_CATEGORY[displayCategory] ||
CATEGORY_LABELS_BY_CATEGORY[definition.metadata.displayCategory] ||

Check warning on line 19 in labware-library/src/components/LabwareDetails/LabwareTitle.tsx

Codecov / codecov/patch

labware-library/src/components/LabwareDetails/LabwareTitle.tsx#L19

Added line #L19 was not covered by tests
CATEGORY_LABELS_BY_CATEGORY.other

return (
@@ -24,7 +25,7 @@
<LabelText position={LABEL_LEFT}>{CATEGORY}</LabelText>
<Value>{category}</Value>
</div>
<h2 className={styles.title}>{metadata.displayName}</h2>
<h2 className={styles.title}>{displayName}</h2>

Check warning on line 28 in labware-library/src/components/LabwareDetails/LabwareTitle.tsx

Codecov / codecov/patch

labware-library/src/components/LabwareDetails/LabwareTitle.tsx#L28

Added line #L28 was not covered by tests
</div>
)
}
7 changes: 4 additions & 3 deletions labware-library/src/components/LabwareList/LabwareCard.tsx
Original file line number Diff line number Diff line change
@@ -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 Title(props: LabwareCardProps): JSX.Element {
const { loadName } = props.definition.parameters
const { displayName } = props.definition.metadata
const { definition } = props
const displayName = getLabwareDisplayName(definition)

Check warning on line 78 in labware-library/src/components/LabwareList/LabwareCard.tsx

Codecov / codecov/patch

labware-library/src/components/LabwareList/LabwareCard.tsx#L77-L78

Added lines #L77 - L78 were not covered by tests

return (
<Link to={'/'} search={`loadName=${loadName}`}>
<Link to={'/'} search={`loadName=${definition.parameters.loadName}`}>

Check warning on line 81 in labware-library/src/components/LabwareList/LabwareCard.tsx

Codecov / codecov/patch

labware-library/src/components/LabwareList/LabwareCard.tsx#L81

Added line #L81 was not covered by tests
<h2 className={styles.title}>
<span className={styles.title_text}>{displayName}</span>
<Icon className={styles.title_icon} name="chevron-right" />
6 changes: 6 additions & 0 deletions shared-data/js/helpers/index.ts
Original file line number Diff line number Diff line change
@@ -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 = (
Loading
Oops, something went wrong.