From 0e8b095a6311c3bc6b1b83b70a2052e8ab1d0c78 Mon Sep 17 00:00:00 2001 From: Jethary Date: Wed, 21 Feb 2024 10:12:40 -0500 Subject: [PATCH] rename slotMap to OT2SlotMap --- components/src/slotmap/{SlotMap.tsx => OT2SlotMap.tsx} | 2 +- .../__tests__/{SlotMap.test.tsx => OT2SlotMap.test.tsx} | 2 +- components/src/slotmap/index.ts | 2 +- .../EditModulesModal/__tests__/EditModulesModal.test.tsx | 6 +++--- .../src/components/modals/EditModulesModal/index.tsx | 6 +++--- protocol-designer/src/components/modules/ModuleRow.tsx | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) rename components/src/slotmap/{SlotMap.tsx => OT2SlotMap.tsx} (96%) rename components/src/slotmap/__tests__/{SlotMap.test.tsx => OT2SlotMap.test.tsx} (60%) diff --git a/components/src/slotmap/SlotMap.tsx b/components/src/slotmap/OT2SlotMap.tsx similarity index 96% rename from components/src/slotmap/SlotMap.tsx rename to components/src/slotmap/OT2SlotMap.tsx index 8e7c95af41b..9c90826a462 100644 --- a/components/src/slotmap/SlotMap.tsx +++ b/components/src/slotmap/OT2SlotMap.tsx @@ -28,7 +28,7 @@ const iconSize = 20 const numRows = 4 const numCols = 3 -export function SlotMap(props: SlotMapProps): JSX.Element { +export function OT2SlotMap(props: SlotMapProps): JSX.Element { const { collisionSlots, occupiedSlots, isError } = props const slots = OT2_SLOT_MAP_SLOTS return ( diff --git a/components/src/slotmap/__tests__/SlotMap.test.tsx b/components/src/slotmap/__tests__/OT2SlotMap.test.tsx similarity index 60% rename from components/src/slotmap/__tests__/SlotMap.test.tsx rename to components/src/slotmap/__tests__/OT2SlotMap.test.tsx index 4b939110602..47483cd8ca2 100644 --- a/components/src/slotmap/__tests__/SlotMap.test.tsx +++ b/components/src/slotmap/__tests__/OT2SlotMap.test.tsx @@ -1,3 +1,3 @@ -describe('SlotMap', () => { +describe('OT2SlotMap', () => { it.todo('replace deprecated enzyme test') }) diff --git a/components/src/slotmap/index.ts b/components/src/slotmap/index.ts index a7b03221e16..b0abb4530e3 100644 --- a/components/src/slotmap/index.ts +++ b/components/src/slotmap/index.ts @@ -1 +1 @@ -export * from './SlotMap' +export * from './OT2SlotMap' diff --git a/protocol-designer/src/components/modals/EditModulesModal/__tests__/EditModulesModal.test.tsx b/protocol-designer/src/components/modals/EditModulesModal/__tests__/EditModulesModal.test.tsx index f91d8d5b93e..a0cf0a17c7f 100644 --- a/protocol-designer/src/components/modals/EditModulesModal/__tests__/EditModulesModal.test.tsx +++ b/protocol-designer/src/components/modals/EditModulesModal/__tests__/EditModulesModal.test.tsx @@ -4,7 +4,7 @@ import { FLEX_ROBOT_TYPE, OT2_ROBOT_TYPE } from '@opentrons/shared-data' import { DeckLocationSelect, renderWithProviders, - SlotMap, + OT2SlotMap, } from '@opentrons/components' import { i18n } from '../../../../localization' import { getRobotType } from '../../../../file-data/selectors' @@ -37,7 +37,7 @@ const mockGetLabwareIsCompatible = getLabwareIsCompatible as jest.MockedFunction const mockGetDisableModuleRestrictions = getDisableModuleRestrictions as jest.MockedFunction< typeof getDisableModuleRestrictions > -const mockSlotMap = SlotMap as jest.MockedFunction +const mockOT2SlotMap = OT2SlotMap as jest.MockedFunction const render = (props: React.ComponentProps) => { return renderWithProviders(, { i18nInstance: i18n, @@ -92,7 +92,7 @@ describe('Edit Modules Modal', () => { mockGetLabwareIsCompatible.mockReturnValue(true) mockGetDisableModuleRestrictions.mockReturnValue(false) mockDeckLocationSelect.mockReturnValue(
mock DeckLocationSelect
) - mockSlotMap.mockReturnValue(
mock SlotMap
) + mockOT2SlotMap.mockReturnValue(
mock SlotMap
) }) it('renders the edit modules modal for a temp on a flex', () => { render(props) diff --git a/protocol-designer/src/components/modals/EditModulesModal/index.tsx b/protocol-designer/src/components/modals/EditModulesModal/index.tsx index 79fe13715e0..356b33cfa2d 100644 --- a/protocol-designer/src/components/modals/EditModulesModal/index.tsx +++ b/protocol-designer/src/components/modals/EditModulesModal/index.tsx @@ -27,7 +27,7 @@ import { ALIGN_CENTER, JUSTIFY_SPACE_BETWEEN, JUSTIFY_FLEX_END, - SlotMap, + OT2SlotMap, usePrevious, } from '@opentrons/components' import { @@ -413,9 +413,9 @@ const EditModulesModalComponent = ( paddingY={SPACING.spacing16} > {moduleType === THERMOCYCLER_MODULE_TYPE ? ( - + ) : ( - diff --git a/protocol-designer/src/components/modules/ModuleRow.tsx b/protocol-designer/src/components/modules/ModuleRow.tsx index 5ca4ccbd0e2..fd44ad768df 100644 --- a/protocol-designer/src/components/modules/ModuleRow.tsx +++ b/protocol-designer/src/components/modules/ModuleRow.tsx @@ -5,7 +5,7 @@ import upperFirst from 'lodash/upperFirst' import { LabeledValue, OutlineButton, - SlotMap, + OT2SlotMap, Tooltip, useHoverTooltip, ModuleIcon, @@ -51,7 +51,7 @@ export function ModuleRow(props: Props): JSX.Element { const slot = moduleOnDeck?.slot /* TODO (ka 2020-2-3): This logic is very specific to this individual implementation - of SlotMap. Kept it here (for now?) because it spells out the different cases. + of OT2SlotMap. Kept it here (for now?) because it spells out the different cases. */ let slotDisplayName = null let occupiedSlotsForMap: string[] = [] @@ -160,7 +160,7 @@ export function ModuleRow(props: Props): JSX.Element { /> ) : (
-