From 5cd17efcf6523503bbf192fd25df6872c401f77c Mon Sep 17 00:00:00 2001 From: smb2268 Date: Tue, 6 Aug 2024 15:25:06 -0400 Subject: [PATCH] Swap out 96 well plate defs for ones with big enough touch targets --- .../QuickTransferFlow/SelectDestWells.tsx | 17 +++++++++++-- .../QuickTransferFlow/SelectSourceWells.tsx | 24 +++++++++++++++++-- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/app/src/organisms/QuickTransferFlow/SelectDestWells.tsx b/app/src/organisms/QuickTransferFlow/SelectDestWells.tsx index da2119fdd0d3..beca27e8a88a 100644 --- a/app/src/organisms/QuickTransferFlow/SelectDestWells.tsx +++ b/app/src/organisms/QuickTransferFlow/SelectDestWells.tsx @@ -10,12 +10,17 @@ import { LegacyStyledText, JUSTIFY_CENTER, } from '@opentrons/components' +import { getAllDefinitions } from '@opentrons/shared-data' import { getTopPortalEl } from '../../App/portal' import { OddModal } from '../../molecules/OddModal' import { ChildNavigation } from '../../organisms/ChildNavigation' import { useToaster } from '../../organisms/ToasterOven' import { WellSelection } from '../../organisms/WellSelection' +import { + CIRCULAR_WELL_96_PLATE_DEFINITION_URI, + RECTANGULAR_WELL_96_PLATE_DEFINITION_URI, +} from './SelectSourceWells' import type { SmallButton } from '../../atoms/buttons' import type { OddModalHeaderBaseProps } from '../../molecules/OddModal/types' @@ -107,9 +112,17 @@ export function SelectDestWells(props: SelectDestWellsProps): JSX.Element { setSelectedWells({}) }, } - const labwareDefinition = + let labwareDefinition = state.destination === 'source' ? state.source : state.destination - + if (labwareDefinition?.parameters.format === '96Standard') { + const allDefinitions = getAllDefinitions() + if (Object.values(labwareDefinition.wells)[0].shape === 'circular') { + labwareDefinition = allDefinitions[CIRCULAR_WELL_96_PLATE_DEFINITION_URI] + } else { + labwareDefinition = + allDefinitions[RECTANGULAR_WELL_96_PLATE_DEFINITION_URI] + } + } return ( <> {createPortal( diff --git a/app/src/organisms/QuickTransferFlow/SelectSourceWells.tsx b/app/src/organisms/QuickTransferFlow/SelectSourceWells.tsx index d7628bbcefe0..32869fe0a05d 100644 --- a/app/src/organisms/QuickTransferFlow/SelectSourceWells.tsx +++ b/app/src/organisms/QuickTransferFlow/SelectSourceWells.tsx @@ -7,6 +7,7 @@ import { POSITION_FIXED, SPACING, } from '@opentrons/components' +import { getAllDefinitions } from '@opentrons/shared-data' import { ChildNavigation } from '../../organisms/ChildNavigation' import { WellSelection } from '../../organisms/WellSelection' @@ -24,6 +25,11 @@ interface SelectSourceWellsProps { dispatch: React.Dispatch } +export const CIRCULAR_WELL_96_PLATE_DEFINITION_URI = + 'opentrons/thermoscientificnunc_96_wellplate_2000ul/1' +export const RECTANGULAR_WELL_96_PLATE_DEFINITION_URI = + 'opentrons/usascientific_96_wellplate_2.4ml_deep/1' + export function SelectSourceWells(props: SelectSourceWellsProps): JSX.Element { const { onNext, onBack, state, dispatch } = props const { i18n, t } = useTranslation(['quick_transfer', 'shared']) @@ -50,6 +56,20 @@ export function SelectSourceWells(props: SelectSourceWellsProps): JSX.Element { setSelectedWells({}) }, } + let displayLabwareDefinition = state.source + if (state.source?.parameters.format === '96Standard') { + const allDefinitions = getAllDefinitions() + if (Object.values(state.source.wells)[0].shape === 'circular') { + displayLabwareDefinition = + allDefinitions[CIRCULAR_WELL_96_PLATE_DEFINITION_URI] + console.log('circle') + } else { + displayLabwareDefinition = + allDefinitions[RECTANGULAR_WELL_96_PLATE_DEFINITION_URI] + console.log('rect') + } + console.log(displayLabwareDefinition) + } return ( <> @@ -71,14 +91,14 @@ export function SelectSourceWells(props: SelectSourceWellsProps): JSX.Element { left="0" width="100%" > - {state.source != null ? ( + {state.source != null && displayLabwareDefinition != null ? ( { setSelectedWells(prevWells => without(Object.keys(prevWells), ...wells).reduce(