From 27f89737c0bcdc5a19355e355bdae0cd39b484cd Mon Sep 17 00:00:00 2001 From: Jethary Date: Fri, 23 Jun 2023 10:38:47 -0400 Subject: [PATCH] change all OT-3 Standard strings to FLEX_ROBOT_TYPE const --- components/src/slotmap/SlotMap.tsx | 4 ++-- components/src/slotmap/__tests__/SlotMap.test.tsx | 5 +++-- .../src/components/modules/ModuleRow.tsx | 12 ++++++------ protocol-designer/src/step-forms/reducers/index.ts | 3 ++- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/components/src/slotmap/SlotMap.tsx b/components/src/slotmap/SlotMap.tsx index ad51503e197..e3c08cd7e7f 100644 --- a/components/src/slotmap/SlotMap.tsx +++ b/components/src/slotmap/SlotMap.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import cx from 'classnames' -import { RobotType } from '@opentrons/shared-data' +import { FLEX_ROBOT_TYPE, RobotType } from '@opentrons/shared-data' import { Icon } from '../icons' import styles from './styles.css' @@ -40,7 +40,7 @@ const numCols = 3 export function SlotMap(props: SlotMapProps): JSX.Element { const { collisionSlots, occupiedSlots, isError, robotType } = props const slots = - robotType === 'OT-3 Standard' ? FLEX_SLOT_MAP_SLOTS : OT2_SLOT_MAP_SLOTS + robotType === FLEX_ROBOT_TYPE ? FLEX_SLOT_MAP_SLOTS : OT2_SLOT_MAP_SLOTS return ( { it('should render 12 slots for flex', () => { const wrapper = shallow( - + ) expect(wrapper.find('rect')).toHaveLength(12) }) @@ -42,7 +43,7 @@ describe('SlotMap', () => { ) expect(wrapper.find(Icon)).toHaveLength(1) diff --git a/protocol-designer/src/components/modules/ModuleRow.tsx b/protocol-designer/src/components/modules/ModuleRow.tsx index c1304e45c49..1c87d93cfa7 100644 --- a/protocol-designer/src/components/modules/ModuleRow.tsx +++ b/protocol-designer/src/components/modules/ModuleRow.tsx @@ -12,6 +12,10 @@ import { SIZE_1, SPACING, } from '@opentrons/components' +import { + FLEX_ROBOT_TYPE, + THERMOCYCLER_MODULE_TYPE, +} from '@opentrons/shared-data' import { i18n } from '../../localization' import { actions as stepFormActions, ModuleOnDeck } from '../../step-forms' import { @@ -22,11 +26,7 @@ import { ModuleDiagram } from './ModuleDiagram' import { isModuleWithCollisionIssue } from './utils' import styles from './styles.css' -import { - ModuleType, - RobotType, - THERMOCYCLER_MODULE_TYPE, -} from '@opentrons/shared-data' +import type { ModuleType, RobotType } from '@opentrons/shared-data' interface Props { robotType?: RobotType @@ -44,7 +44,7 @@ export function ModuleRow(props: Props): JSX.Element { robotType, } = props const type: ModuleType = moduleOnDeck?.type || props.type - const isFlex = robotType === 'OT-3 Standard' + const isFlex = robotType === FLEX_ROBOT_TYPE const model = moduleOnDeck?.model const slot = moduleOnDeck?.slot diff --git a/protocol-designer/src/step-forms/reducers/index.ts b/protocol-designer/src/step-forms/reducers/index.ts index 10c72d94c5c..2b3fb861daa 100644 --- a/protocol-designer/src/step-forms/reducers/index.ts +++ b/protocol-designer/src/step-forms/reducers/index.ts @@ -7,6 +7,7 @@ import omit from 'lodash/omit' import omitBy from 'lodash/omitBy' import reduce from 'lodash/reduce' import { + FLEX_ROBOT_TYPE, getLabwareDefaultEngageHeight, getLabwareDefURI, getModuleType, @@ -1285,7 +1286,7 @@ export const additionalEquipmentInvariantProperties = handleActions 0 // @ts-expect-error (jr, 6/22/23): OT-3 Standard doesn't exist on schemav6 - const isOt3 = file.robot.model === 'OT-3 Standard' + const isOt3 = file.robot.model === FLEX_ROBOT_TYPE const additionalEquipmentId = uuid() const updatedEquipment = { [additionalEquipmentId]: {