Skip to content

Commit

Permalink
change all OT-3 Standard strings to FLEX_ROBOT_TYPE const
Browse files Browse the repository at this point in the history
  • Loading branch information
jerader committed Jun 23, 2023
1 parent 0515d9e commit 27f8973
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions components/src/slotmap/SlotMap.tsx
Original file line number Diff line number Diff line change
@@ -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'

Expand Down Expand Up @@ -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 (
<svg
Expand Down
5 changes: 3 additions & 2 deletions components/src/slotmap/__tests__/SlotMap.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react'
import { shallow } from 'enzyme'

import { FLEX_ROBOT_TYPE } from '@opentrons/shared-data'
import { SlotMap } from '../SlotMap'
import { Icon } from '../../icons'

Expand Down Expand Up @@ -32,7 +33,7 @@ describe('SlotMap', () => {

it('should render 12 slots for flex', () => {
const wrapper = shallow(
<SlotMap occupiedSlots={['D1']} robotType="OT-3 Standard" />
<SlotMap occupiedSlots={['D1']} robotType={FLEX_ROBOT_TYPE} />
)
expect(wrapper.find('rect')).toHaveLength(12)
})
Expand All @@ -42,7 +43,7 @@ describe('SlotMap', () => {
<SlotMap
occupiedSlots={['D1']}
collisionSlots={['D2']}
robotType="OT-3 Standard"
robotType={FLEX_ROBOT_TYPE}
/>
)
expect(wrapper.find(Icon)).toHaveLength(1)
Expand Down
12 changes: 6 additions & 6 deletions protocol-designer/src/components/modules/ModuleRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion protocol-designer/src/step-forms/reducers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -1285,7 +1286,7 @@ export const additionalEquipmentInvariantProperties = handleActions<NormalizedAd
)
const hasGripper = gripper.length > 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]: {
Expand Down

0 comments on commit 27f8973

Please sign in to comment.