diff --git a/app/src/organisms/Devices/ProtocolRun/utils/getStandardDeckViewLayerBlockList.ts b/app/src/local-resources/deck_configuration/getStandardDeckViewLayerBlockList.ts similarity index 100% rename from app/src/organisms/Devices/ProtocolRun/utils/getStandardDeckViewLayerBlockList.ts rename to app/src/local-resources/deck_configuration/getStandardDeckViewLayerBlockList.ts diff --git a/app/src/local-resources/deck_configuration/index.ts b/app/src/local-resources/deck_configuration/index.ts new file mode 100644 index 00000000000..9028755b545 --- /dev/null +++ b/app/src/local-resources/deck_configuration/index.ts @@ -0,0 +1 @@ +export * from './getStandardDeckViewLayerBlockList' diff --git a/app/src/resources/instruments/__tests__/hooks.test.ts b/app/src/local-resources/instruments/__tests__/hooks.test.ts similarity index 97% rename from app/src/resources/instruments/__tests__/hooks.test.ts rename to app/src/local-resources/instruments/__tests__/hooks.test.ts index ab21c81525d..94b6043a125 100644 --- a/app/src/resources/instruments/__tests__/hooks.test.ts +++ b/app/src/local-resources/instruments/__tests__/hooks.test.ts @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' -import { useIsOEMMode } from '../../robot-settings/hooks' +import { useIsOEMMode } from '/app/resources/robot-settings/hooks' import { useGripperDisplayName, @@ -11,7 +11,7 @@ import { import type { PipetteV2Specs } from '@opentrons/shared-data' -vi.mock('../../robot-settings/hooks') +vi.mock('/app/resources/robot-settings/hooks') const BRANDED_P1000_FLEX_DISPLAY_NAME = 'Flex 1-Channel 1000 μL' const ANONYMOUS_P1000_FLEX_DISPLAY_NAME = '1-Channel 1000 μL' diff --git a/app/src/resources/instruments/hooks.ts b/app/src/local-resources/instruments/hooks.ts similarity index 96% rename from app/src/resources/instruments/hooks.ts rename to app/src/local-resources/instruments/hooks.ts index 32135d716a4..713dd6f1c83 100644 --- a/app/src/resources/instruments/hooks.ts +++ b/app/src/local-resources/instruments/hooks.ts @@ -5,7 +5,7 @@ import { getPipetteSpecsV2, GRIPPER_MODELS, } from '@opentrons/shared-data' -import { useIsOEMMode } from '../robot-settings/hooks' +import { useIsOEMMode } from '/app/resources/robot-settings/hooks' import type { GripperModel, diff --git a/app/src/local-resources/instruments/index.ts b/app/src/local-resources/instruments/index.ts new file mode 100644 index 00000000000..fc78d35129c --- /dev/null +++ b/app/src/local-resources/instruments/index.ts @@ -0,0 +1 @@ +export * from './hooks' diff --git a/app/src/organisms/Devices/getModulePrepCommands.ts b/app/src/local-resources/modules/getModulePrepCommands.ts similarity index 100% rename from app/src/organisms/Devices/getModulePrepCommands.ts rename to app/src/local-resources/modules/getModulePrepCommands.ts diff --git a/app/src/local-resources/modules/index.ts b/app/src/local-resources/modules/index.ts new file mode 100644 index 00000000000..2ea3bee5cf6 --- /dev/null +++ b/app/src/local-resources/modules/index.ts @@ -0,0 +1 @@ +export * from './getModulePrepCommands' diff --git a/app/src/molecules/PythonLabwareOffsetSnippet/createSnippet.ts b/app/src/molecules/PythonLabwareOffsetSnippet/createSnippet.ts index 4b6a1d4c236..79a5a70fad2 100644 --- a/app/src/molecules/PythonLabwareOffsetSnippet/createSnippet.ts +++ b/app/src/molecules/PythonLabwareOffsetSnippet/createSnippet.ts @@ -1,7 +1,7 @@ import isEqual from 'lodash/isEqual' import { getLoadedLabwareDefinitionsByUri } from '@opentrons/shared-data' -import { getLabwareDefinitionUri } from '/app/organisms/Devices/ProtocolRun/utils/getLabwareDefinitionUri' -import { getLabwareOffsetLocation } from '/app/organisms/Devices/ProtocolRun/utils/getLabwareOffsetLocation' +import { getLabwareDefinitionUri } from '/app/transformations/protocols' +import { getLabwareOffsetLocation } from '/app/transformations/analysis' import type { LabwareOffset } from '@opentrons/api-client' import type { LoadedLabware, diff --git a/app/src/organisms/CalibrationTaskList/__tests__/CalibrationTaskList.test.tsx b/app/src/organisms/CalibrationTaskList/__tests__/CalibrationTaskList.test.tsx index fe175420b4a..faba626ef11 100644 --- a/app/src/organisms/CalibrationTaskList/__tests__/CalibrationTaskList.test.tsx +++ b/app/src/organisms/CalibrationTaskList/__tests__/CalibrationTaskList.test.tsx @@ -18,15 +18,13 @@ import { expectedIncompleteRightMountTaskList, expectedIncompleteLeftMountTaskList, } from '../../Devices/hooks/__fixtures__/taskListFixtures' -import { - useCalibrationTaskList, - useRunHasStarted, - useAttachedPipettes, -} from '../../Devices/hooks' +import { useCalibrationTaskList, useRunHasStarted } from '../../Devices/hooks' +import { useAttachedPipettes } from '/app/resources/instruments' import { mockLeftProtoPipette } from '/app/redux/pipettes/__fixtures__' vi.mock('../../Devices/hooks') vi.mock('/app/resources/runs') +vi.mock('/app/resources/instruments') const render = (robotName: string = 'otie') => { return renderWithProviders( diff --git a/app/src/organisms/CalibrationTaskList/index.tsx b/app/src/organisms/CalibrationTaskList/index.tsx index 069e6ba4ebf..033c0b47390 100644 --- a/app/src/organisms/CalibrationTaskList/index.tsx +++ b/app/src/organisms/CalibrationTaskList/index.tsx @@ -21,10 +21,10 @@ import { StatusLabel } from '/app/atoms/StatusLabel' import { TaskList } from '../TaskList' import { - useAttachedPipettes, useCalibrationTaskList, useRunHasStarted, } from '/app/organisms/Devices/hooks' +import { useAttachedPipettes } from '/app/resources/instruments' import { useCurrentRunId } from '/app/resources/runs' import type { diff --git a/app/src/organisms/ChangePipette/__tests__/ChangePipette.test.tsx b/app/src/organisms/ChangePipette/__tests__/ChangePipette.test.tsx index f627265493c..026f46def96 100644 --- a/app/src/organisms/ChangePipette/__tests__/ChangePipette.test.tsx +++ b/app/src/organisms/ChangePipette/__tests__/ChangePipette.test.tsx @@ -15,7 +15,7 @@ import { SUCCESS, useDispatchApiRequests, } from '/app/redux/robot-api' -import { useAttachedPipettes } from '../../Devices/hooks' +import { useAttachedPipettes } from '/app/resources/instruments' import { PipetteSelection } from '../PipetteSelection' import { ExitModal } from '../ExitModal' import { ConfirmPipette } from '../ConfirmPipette' @@ -51,7 +51,7 @@ vi.mock('../PipetteSelection') vi.mock('../ExitModal') vi.mock('/app/molecules/InProgressModal/InProgressModal') vi.mock('../ConfirmPipette') -vi.mock('../../Devices/hooks') +vi.mock('/app/resources/instruments') vi.mock('/app/assets/images') const render = (props: React.ComponentProps) => { diff --git a/app/src/organisms/ChangePipette/index.tsx b/app/src/organisms/ChangePipette/index.tsx index cd91b04529e..afa694e9992 100644 --- a/app/src/organisms/ChangePipette/index.tsx +++ b/app/src/organisms/ChangePipette/index.tsx @@ -31,7 +31,7 @@ import { import { WizardHeader } from '/app/molecules/WizardHeader' import { InProgressModal } from '/app/molecules/InProgressModal/InProgressModal' -import { useAttachedPipettes } from '../Devices/hooks' +import { useAttachedPipettes } from '/app/resources/instruments' import { ExitModal } from './ExitModal' import { Instructions } from './Instructions' import { ConfirmPipette } from './ConfirmPipette' diff --git a/app/src/organisms/Devices/HistoricalProtocolRunDrawer.tsx b/app/src/organisms/Devices/HistoricalProtocolRunDrawer.tsx index bb0b419f830..691af54074d 100644 --- a/app/src/organisms/Devices/HistoricalProtocolRunDrawer.tsx +++ b/app/src/organisms/Devices/HistoricalProtocolRunDrawer.tsx @@ -28,7 +28,7 @@ import { } from '@opentrons/shared-data' import { useCsvFileQuery } from '@opentrons/react-api-client' import { DownloadCsvFileLink } from './DownloadCsvFileLink' -import { useMostRecentCompletedAnalysis } from '../LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' import { useDeckCalibrationData } from './hooks' import { OffsetVector } from '/app/molecules/OffsetVector' import type { RunData } from '@opentrons/api-client' diff --git a/app/src/organisms/Devices/InstrumentsAndModules.tsx b/app/src/organisms/Devices/InstrumentsAndModules.tsx index 2c375d83e12..2a9cdfbbb3f 100644 --- a/app/src/organisms/Devices/InstrumentsAndModules.tsx +++ b/app/src/organisms/Devices/InstrumentsAndModules.tsx @@ -26,7 +26,7 @@ import { useCurrentRunId } from '/app/resources/runs' import { useIsFlex } from '/app/redux-resources/robots' import { ModuleCard } from '../ModuleCard' import { useIsRobotViewable, useRunStatuses } from './hooks' -import { getShowPipetteCalibrationWarning } from './utils' +import { getShowPipetteCalibrationWarning } from '/app/transformations/instruments' import { PipetteCard } from './PipetteCard' import { FlexPipetteCard } from './PipetteCard/FlexPipetteCard' import { GripperCard } from '../GripperCard' diff --git a/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderContent/ActionButton/hooks/useIsFixtureMismatch.ts b/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderContent/ActionButton/hooks/useIsFixtureMismatch.ts index ebac2a7bec3..aa49528efa2 100644 --- a/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderContent/ActionButton/hooks/useIsFixtureMismatch.ts +++ b/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderContent/ActionButton/hooks/useIsFixtureMismatch.ts @@ -1,4 +1,4 @@ -import { useMostRecentCompletedAnalysis } from '../../../../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' import { useRobotType } from '/app/redux-resources/robots' import { getIsFixtureMismatch, diff --git a/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderContent/ActionButton/index.tsx b/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderContent/ActionButton/index.tsx index 00bca7d21b7..8664d8c78f5 100644 --- a/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderContent/ActionButton/index.tsx +++ b/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderContent/ActionButton/index.tsx @@ -16,12 +16,15 @@ import { import { useModuleCalibrationStatus, - useRunCalibrationStatus, useUnmatchedModulesForProtocol, } from '../../../../hooks' import { useRobot } from '/app/redux-resources/robots' import { useRobotAnalyticsData } from '/app/redux-resources/analytics' -import { useCurrentRunId, useProtocolDetailsForRun } from '/app/resources/runs' +import { + useCurrentRunId, + useProtocolDetailsForRun, + useRunCalibrationStatus, +} from '/app/resources/runs' import { useActionBtnDisabledUtils, useActionButtonProperties } from './hooks' import { getFallbackRobotSerialNumber, isRunAgainStatus } from '../../utils' import { useIsRobotOnWrongVersionOfSoftware } from '/app/redux/robot-update' diff --git a/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderModalContainer/RunHeaderModalContainer.tsx b/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderModalContainer/RunHeaderModalContainer.tsx index 57d85a7e5c4..99f582e32ad 100644 --- a/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderModalContainer/RunHeaderModalContainer.tsx +++ b/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderModalContainer/RunHeaderModalContainer.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { ErrorRecoveryFlows } from '../../../../ErrorRecoveryFlows' import { DropTipWizardFlows } from '../../../../DropTipWizardFlows' -import { useMostRecentCompletedAnalysis } from '../../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' import { ConfirmCancelModal, HeaterShakerIsRunningModal, diff --git a/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderModalContainer/modals/HeaterShakerIsRunningModal/HeaterShakerIsRunningModal.tsx b/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderModalContainer/modals/HeaterShakerIsRunningModal/HeaterShakerIsRunningModal.tsx index ff69b0f9102..2f372a35d44 100644 --- a/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderModalContainer/modals/HeaterShakerIsRunningModal/HeaterShakerIsRunningModal.tsx +++ b/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderModalContainer/modals/HeaterShakerIsRunningModal/HeaterShakerIsRunningModal.tsx @@ -18,7 +18,7 @@ import { } from '@opentrons/components' import { HEATERSHAKER_MODULE_TYPE } from '@opentrons/shared-data' -import { useAttachedModules } from '../../../../../hooks' +import { useAttachedModules } from '/app/resources/modules' import { HeaterShakerModuleCard } from './HeaterShakerModuleCard' import { getActiveHeaterShaker } from './utils' import { useIsHeaterShakerInProtocol } from '../../../../../../ModuleCard/hooks' diff --git a/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderModalContainer/modals/HeaterShakerIsRunningModal/__tests__/HeaterShakerIsRunningModal.test.tsx b/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderModalContainer/modals/HeaterShakerIsRunningModal/__tests__/HeaterShakerIsRunningModal.test.tsx index bcda9d52c3a..62da66f6aa3 100644 --- a/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderModalContainer/modals/HeaterShakerIsRunningModal/__tests__/HeaterShakerIsRunningModal.test.tsx +++ b/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderModalContainer/modals/HeaterShakerIsRunningModal/__tests__/HeaterShakerIsRunningModal.test.tsx @@ -9,8 +9,8 @@ import { renderWithProviders } from '/app/__testing-utils__' import { mockHeaterShaker } from '/app/redux/modules/__fixtures__' import { HeaterShakerIsRunningModal } from '../HeaterShakerIsRunningModal' import { HeaterShakerModuleCard } from '../HeaterShakerModuleCard' -import { useAttachedModules } from '../../../../../../hooks' -import { useMostRecentCompletedAnalysis } from '../../../../../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { useAttachedModules } from '/app/resources/modules' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' import type * as ReactApiClient from '@opentrons/react-api-client' @@ -21,10 +21,8 @@ vi.mock('@opentrons/react-api-client', async importOriginal => { useCreateLiveCommandMutation: vi.fn(), } }) -vi.mock('../../../../../../hooks') -vi.mock( - '../../../../../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' -) +vi.mock('/app/resources/modules') +vi.mock('/app/resources/runs') vi.mock('../HeaterShakerModuleCard') const mockMovingHeaterShakerOne = { diff --git a/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderModalContainer/modals/HeaterShakerIsRunningModal/__tests__/hooks.test.tsx b/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderModalContainer/modals/HeaterShakerIsRunningModal/__tests__/hooks.test.tsx index 75941043fd3..1f9f71bab6d 100644 --- a/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderModalContainer/modals/HeaterShakerIsRunningModal/__tests__/hooks.test.tsx +++ b/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderModalContainer/modals/HeaterShakerIsRunningModal/__tests__/hooks.test.tsx @@ -7,15 +7,13 @@ import { renderHook } from '@testing-library/react' import { HEATERSHAKER_MODULE_V1 } from '@opentrons/shared-data' import { RUN_ID_1 } from '/app/resources/runs/__fixtures__' -import { useMostRecentCompletedAnalysis } from '../../../../../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' import { useHeaterShakerModuleIdsFromRun } from '../hooks' import type { Store } from 'redux' import type { State } from '/app/redux/types' -vi.mock( - '../../../../../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' -) +vi.mock('/app/resources/runs') describe('useHeaterShakerModuleIdsFromRun', () => { const store: Store = createStore(vi.fn(), {}) diff --git a/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderModalContainer/modals/HeaterShakerIsRunningModal/hooks.tsx b/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderModalContainer/modals/HeaterShakerIsRunningModal/hooks.tsx index 680077a1aa6..903327c8834 100644 --- a/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderModalContainer/modals/HeaterShakerIsRunningModal/hooks.tsx +++ b/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderModalContainer/modals/HeaterShakerIsRunningModal/hooks.tsx @@ -1,4 +1,4 @@ -import { useMostRecentCompletedAnalysis } from '../../../../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' export interface ModuleIdsFromRun { moduleIdsFromRun: string[] diff --git a/app/src/organisms/Devices/ProtocolRun/ProtocolRunRunTimeParameters.tsx b/app/src/organisms/Devices/ProtocolRun/ProtocolRunRunTimeParameters.tsx index 27990c8e798..c1d0b3b8dfa 100644 --- a/app/src/organisms/Devices/ProtocolRun/ProtocolRunRunTimeParameters.tsx +++ b/app/src/organisms/Devices/ProtocolRun/ProtocolRunRunTimeParameters.tsx @@ -33,8 +33,11 @@ import { } from '@opentrons/components' import { Divider } from '/app/atoms/structure' -import { useMostRecentCompletedAnalysis } from '../../LabwarePositionCheck/useMostRecentCompletedAnalysis' -import { useNotifyRunQuery, useRunStatus } from '/app/resources/runs' +import { + useMostRecentCompletedAnalysis, + useNotifyRunQuery, + useRunStatus, +} from '/app/resources/runs' import type { RunTimeParameter } from '@opentrons/shared-data' import type { RunStatus } from '@opentrons/api-client' diff --git a/app/src/organisms/Devices/ProtocolRun/ProtocolRunSetup.tsx b/app/src/organisms/Devices/ProtocolRun/ProtocolRunSetup.tsx index e216298f07a..257a5c28529 100644 --- a/app/src/organisms/Devices/ProtocolRun/ProtocolRunSetup.tsx +++ b/app/src/organisms/Devices/ProtocolRun/ProtocolRunSetup.tsx @@ -34,12 +34,14 @@ import { useStoredProtocolAnalysis } from '/app/resources/analysis' import { useModuleCalibrationStatus, useProtocolAnalysisErrors, - useRunCalibrationStatus, useRunHasStarted, - useRunPipetteInfoByMount, useUnmatchedModulesForProtocol, } from '../hooks' -import { useMostRecentCompletedAnalysis } from '../../LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { + useMostRecentCompletedAnalysis, + useRunPipetteInfoByMount, + useRunCalibrationStatus, +} from '/app/resources/runs' import { SetupLabware } from './SetupLabware' import { SetupLabwarePositionCheck } from './SetupLabwarePositionCheck' import { SetupRobotCalibration } from './SetupRobotCalibration' diff --git a/app/src/organisms/Devices/ProtocolRun/SetupFlexPipetteCalibrationItem.tsx b/app/src/organisms/Devices/ProtocolRun/SetupFlexPipetteCalibrationItem.tsx index fda16d0fa2a..212553976d2 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupFlexPipetteCalibrationItem.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupFlexPipetteCalibrationItem.tsx @@ -15,7 +15,7 @@ import { } from '@opentrons/shared-data' import { useInstrumentsQuery } from '@opentrons/react-api-client' import { TertiaryButton } from '/app/atoms/buttons' -import { useMostRecentCompletedAnalysis } from '../../LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' import { useStoredProtocolAnalysis } from '/app/resources/analysis' import { PipetteWizardFlows } from '../../PipetteWizardFlows' import { FLOWS } from '../../PipetteWizardFlows/constants' diff --git a/app/src/organisms/Devices/ProtocolRun/SetupInstrumentCalibration.tsx b/app/src/organisms/Devices/ProtocolRun/SetupInstrumentCalibration.tsx index e2ff193bcd9..011c09c4d7c 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupInstrumentCalibration.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupInstrumentCalibration.tsx @@ -10,15 +10,17 @@ import { TYPOGRAPHY, } from '@opentrons/components' import * as PipetteConstants from '/app/redux/pipettes/constants' -import { getShowPipetteCalibrationWarning } from '../utils' +import { getShowPipetteCalibrationWarning } from '/app/transformations/instruments' import { PipetteRecalibrationWarning } from '../PipetteCard/PipetteRecalibrationWarning' -import { useRunPipetteInfoByMount } from '../hooks' import { useStoredProtocolAnalysis } from '/app/resources/analysis' import { useIsFlex } from '/app/redux-resources/robots' import { SetupPipetteCalibrationItem } from './SetupPipetteCalibrationItem' import { SetupFlexPipetteCalibrationItem } from './SetupFlexPipetteCalibrationItem' import { SetupGripperCalibrationItem } from './SetupGripperCalibrationItem' -import { useMostRecentCompletedAnalysis } from '../../LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { + useRunPipetteInfoByMount, + useMostRecentCompletedAnalysis, +} from '/app/resources/runs' import { useInstrumentsQuery } from '@opentrons/react-api-client' import { isGripperInCommands } from '/app/resources/protocols/utils' diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLabware/CurrentOffsetsModal.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLabware/CurrentOffsetsModal.tsx index 6af52e06a3c..4bb40f1c715 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLabware/CurrentOffsetsModal.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLabware/CurrentOffsetsModal.tsx @@ -24,7 +24,7 @@ import { getIsLabwareOffsetCodeSnippetsOn } from '/app/redux/config' import { LabwareOffsetTabs } from '../../../LabwareOffsetTabs' import { OffsetVector } from '/app/molecules/OffsetVector' import { PythonLabwareOffsetSnippet } from '/app/molecules/PythonLabwareOffsetSnippet' -import { getLatestCurrentOffsets } from '../SetupLabwarePositionCheck/utils' +import { getLatestCurrentOffsets } from '/app/transformations/runs' import type { LabwareOffset } from '@opentrons/api-client' import type { diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLabware/LabwareListItem.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLabware/LabwareListItem.tsx index 0b950e16720..b9b7f4ef31d 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLabware/LabwareListItem.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLabware/LabwareListItem.tsx @@ -51,9 +51,11 @@ import type { LoadLabwareRunTimeCommand, } from '@opentrons/shared-data' import type { ModuleRenderInfoForProtocol } from '../../hooks' -import type { LabwareSetupItem } from '/app/transformations/commands' +import type { + LabwareSetupItem, + NestedLabwareInfo, +} from '/app/transformations/commands' import type { ModuleTypesThatRequireExtraAttention } from '../utils/getModuleTypesThatRequireExtraAttention' -import type { NestedLabwareInfo } from './getNestedLabwareInfo' const LabwareRow = styled.div` display: ${DISPLAY_GRID}; diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLabware/LabwareStackModal.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLabware/LabwareStackModal.tsx index a50be194f45..ec930ef8234 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLabware/LabwareStackModal.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLabware/LabwareStackModal.tsx @@ -18,7 +18,7 @@ import { } from '@opentrons/components' import { OddModal } from '/app/molecules/OddModal' import { getIsOnDevice } from '/app/redux/config' -import { getLocationInfoNames } from '../utils/getLocationInfoNames' +import { getLocationInfoNames } from '/app/transformations/commands' import { getSlotLabwareDefinition } from '../utils/getSlotLabwareDefinition' import { Divider } from '/app/atoms/structure' import { getModuleImage } from '../SetupModuleAndDeck/utils' diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLabware/SetupLabwareList.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLabware/SetupLabwareList.tsx index 61f836dffd5..6000a37eca0 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLabware/SetupLabwareList.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLabware/SetupLabwareList.tsx @@ -7,9 +7,11 @@ import { StyledText, COLORS, } from '@opentrons/components' -import { getLabwareSetupItemGroups } from '/app/transformations/commands' +import { + getLabwareSetupItemGroups, + getNestedLabwareInfo, +} from '/app/transformations/commands' import { LabwareListItem } from './LabwareListItem' -import { getNestedLabwareInfo } from './getNestedLabwareInfo' import type { RunTimeCommand } from '@opentrons/shared-data' import type { ModuleRenderInfoForProtocol } from '../../hooks' diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLabware/SetupLabwareMap.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLabware/SetupLabwareMap.tsx index feb3b1be340..602cb7dbad0 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLabware/SetupLabwareMap.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLabware/SetupLabwareMap.tsx @@ -18,9 +18,11 @@ import { import { getLabwareSetupItemGroups } from '/app/transformations/commands' import { LabwareInfoOverlay } from '../LabwareInfoOverlay' -import { getLabwareRenderInfo } from '../utils/getLabwareRenderInfo' -import { getProtocolModulesInfo } from '../utils/getProtocolModulesInfo' -import { getStandardDeckViewLayerBlockList } from '../utils/getStandardDeckViewLayerBlockList' +import { + getProtocolModulesInfo, + getLabwareRenderInfo, +} from '/app/transformations/analysis' +import { getStandardDeckViewLayerBlockList } from '/app/local-resources/deck_configuration' import { OffDeckLabwareList } from './OffDeckLabwareList' import type { diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLabware/__tests__/SetupLabware.test.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLabware/__tests__/SetupLabware.test.tsx index fee5fe31dae..f475aa3456d 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLabware/__tests__/SetupLabware.test.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLabware/__tests__/SetupLabware.test.tsx @@ -12,14 +12,13 @@ import { getModuleTypesThatRequireExtraAttention } from '../../utils/getModuleTy import { getIsLabwareOffsetCodeSnippetsOn } from '/app/redux/config' import { useLPCDisabledReason, - useRunCalibrationStatus, useRunHasStarted, useUnmatchedModulesForProtocol, } from '../../../hooks' import { SetupLabwareList } from '../SetupLabwareList' import { SetupLabwareMap } from '../SetupLabwareMap' import { SetupLabware } from '..' -import { useNotifyRunQuery } from '/app/resources/runs' +import { useNotifyRunQuery, useRunCalibrationStatus } from '/app/resources/runs' vi.mock('../SetupLabwareList') vi.mock('../SetupLabwareMap') diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLabware/__tests__/SetupLabwareMap.test.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLabware/__tests__/SetupLabwareMap.test.tsx index 288a73b2a6e..40311723ea2 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLabware/__tests__/SetupLabwareMap.test.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLabware/__tests__/SetupLabwareMap.test.tsx @@ -15,7 +15,7 @@ import { renderWithProviders } from '/app/__testing-utils__' import { i18n } from '/app/i18n' import { getAttachedProtocolModuleMatches } from '../../../../ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/utils' import { LabwareInfoOverlay } from '../../LabwareInfoOverlay' -import { getLabwareRenderInfo } from '../../utils/getLabwareRenderInfo' +import { getLabwareRenderInfo } from '/app/transformations/analysis' import { SetupLabwareMap } from '../SetupLabwareMap' import type { @@ -42,7 +42,7 @@ vi.mock('@opentrons/shared-data', async importOriginal => { vi.mock('../../../../ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/utils') vi.mock('../../LabwareInfoOverlay') -vi.mock('../../utils/getLabwareRenderInfo') +vi.mock('/app/transformations/analysis/getLabwareRenderInfo') vi.mock('../../utils/getModuleTypesThatRequireExtraAttention') vi.mock('../../../../RunTimeControl/hooks') vi.mock('../../../hooks') diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLabware/index.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLabware/index.tsx index 502d2dd5c8a..35647346392 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLabware/index.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLabware/index.tsx @@ -10,7 +10,7 @@ import { } from '@opentrons/components' import { useToggleGroup } from '/app/molecules/ToggleGroup/useToggleGroup' import { getModuleTypesThatRequireExtraAttention } from '../utils/getModuleTypesThatRequireExtraAttention' -import { useMostRecentCompletedAnalysis } from '../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' import { useIsFlex } from '/app/redux-resources/robots' import { useStoredProtocolAnalysis } from '/app/resources/analysis' import { useModuleRenderInfoForProtocolById } from '../../hooks' diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/__tests__/CurrentOffsetsTable.test.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/__tests__/CurrentOffsetsTable.test.tsx index 69e0b7ed44f..eb5e708d98a 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/__tests__/CurrentOffsetsTable.test.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/__tests__/CurrentOffsetsTable.test.tsx @@ -12,7 +12,7 @@ import { i18n } from '/app/i18n' import { getIsLabwareOffsetCodeSnippetsOn } from '/app/redux/config' import { LabwarePositionCheck } from '../../../../LabwarePositionCheck' import { useLPCDisabledReason } from '../../../hooks' -import { getLatestCurrentOffsets } from '../utils' +import { getLatestCurrentOffsets } from '/app/transformations/runs' import { CurrentOffsetsTable } from '../CurrentOffsetsTable' import type { CompletedProtocolAnalysis } from '@opentrons/shared-data' @@ -21,7 +21,7 @@ import type { LabwareOffset } from '@opentrons/api-client' vi.mock('../../../hooks') vi.mock('../../../../LabwarePositionCheck') vi.mock('/app/redux/config') -vi.mock('../utils') +vi.mock('/app/transformations/runs') vi.mock('@opentrons/shared-data', async importOriginal => { const actual = await importOriginal() diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/__tests__/SetupLabwarePositionCheck.test.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/__tests__/SetupLabwarePositionCheck.test.tsx index 59b78ba440c..7a5f09f5a59 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/__tests__/SetupLabwarePositionCheck.test.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/__tests__/SetupLabwarePositionCheck.test.tsx @@ -18,12 +18,11 @@ import { useLaunchLPC } from '../../../../LabwarePositionCheck/useLaunchLPC' import { getIsLabwareOffsetCodeSnippetsOn } from '/app/redux/config' import { useLPCDisabledReason, - useRunCalibrationStatus, useRunHasStarted, useUnmatchedModulesForProtocol, } from '../../../hooks' import { SetupLabwarePositionCheck } from '..' -import { useNotifyRunQuery } from '/app/resources/runs' +import { useNotifyRunQuery, useRunCalibrationStatus } from '/app/resources/runs' import { useRobotType } from '/app/redux-resources/robots' import type { Mock } from 'vitest' diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/index.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/index.tsx index c0813f5b36d..644837431f3 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/index.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/index.tsx @@ -19,14 +19,16 @@ import { } from '@opentrons/components' import { useProtocolQuery } from '@opentrons/react-api-client' -import { useMostRecentCompletedAnalysis } from '../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' import { useLPCSuccessToast } from '../../hooks/useLPCSuccessToast' import { useLPCDisabledReason } from '../../hooks' import { useStoredProtocolAnalysis } from '/app/resources/analysis' import { CurrentOffsetsTable } from './CurrentOffsetsTable' import { useLaunchLPC } from '../../../LabwarePositionCheck/useLaunchLPC' -import { getLatestCurrentOffsets } from './utils' -import { useNotifyRunQuery } from '/app/resources/runs' +import { getLatestCurrentOffsets } from '/app/transformations/runs' +import { + useNotifyRunQuery, + useMostRecentCompletedAnalysis, +} from '/app/resources/runs' import { useRobotType } from '/app/redux-resources/robots' import type { LabwareOffset } from '@opentrons/api-client' diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/LiquidDetailCard.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLiquids/LiquidDetailCard.tsx index 7178a8b6404..0e3f97fb525 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/LiquidDetailCard.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLiquids/LiquidDetailCard.tsx @@ -25,7 +25,7 @@ import { ANALYTICS_HIGHLIGHT_LIQUID_IN_DETAIL_MODAL, } from '/app/redux/analytics' import { getIsOnDevice } from '/app/redux/config' -import { getWellRangeForLiquidLabwarePair } from './utils' +import { getWellRangeForLiquidLabwarePair } from '/app/transformations/analysis' export const CARD_OUTLINE_BORDER_STYLE = css` border-style: ${BORDERS.styleSolid}; diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/LiquidsLabwareDetailsModal.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLiquids/LiquidsLabwareDetailsModal.tsx index 733d767e8cd..4dfa54f6c0f 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/LiquidsLabwareDetailsModal.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLiquids/LiquidsLabwareDetailsModal.tsx @@ -22,8 +22,8 @@ import { import { OddModal } from '/app/molecules/OddModal' import { getIsOnDevice } from '/app/redux/config' -import { useMostRecentCompletedAnalysis } from '../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' -import { getLocationInfoNames } from '../utils/getLocationInfoNames' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' +import { getLocationInfoNames } from '/app/transformations/commands' import { getSlotLabwareDefinition } from '../utils/getSlotLabwareDefinition' import { LiquidDetailCard } from './LiquidDetailCard' import { @@ -31,7 +31,7 @@ import { getDisabledWellFillFromLabwareId, getWellGroupForLiquidId, getDisabledWellGroupForLiquidId, -} from './utils' +} from '/app/transformations/analysis' interface LiquidsLabwareDetailsModalProps { liquidId?: string diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/SetupLiquidsList.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLiquids/SetupLiquidsList.tsx index 82bddc9685f..bfb36d59a11 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/SetupLiquidsList.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLiquids/SetupLiquidsList.tsx @@ -33,10 +33,13 @@ import { ANALYTICS_OPEN_LIQUID_LABWARE_DETAIL_MODAL, } from '/app/redux/analytics' import { useIsFlex } from '/app/redux-resources/robots' -import { useMostRecentCompletedAnalysis } from '../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' -import { getLocationInfoNames } from '../utils/getLocationInfoNames' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' +import { getLocationInfoNames } from '/app/transformations/commands' import { LiquidsLabwareDetailsModal } from './LiquidsLabwareDetailsModal' -import { getTotalVolumePerLiquidId, getVolumePerWell } from './utils' +import { + getTotalVolumePerLiquidId, + getVolumePerWell, +} from '/app/transformations/analysis' import type { LabwareByLiquidId } from '@opentrons/shared-data' diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/SetupLiquidsMap.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLiquids/SetupLiquidsMap.tsx index fa964eb8535..b0a0df55c06 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/SetupLiquidsMap.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLiquids/SetupLiquidsMap.tsx @@ -22,10 +22,12 @@ import { import { LabwareInfoOverlay } from '../LabwareInfoOverlay' import { LiquidsLabwareDetailsModal } from './LiquidsLabwareDetailsModal' -import { getWellFillFromLabwareId } from './utils' -import { getLabwareRenderInfo } from '../utils/getLabwareRenderInfo' -import { getStandardDeckViewLayerBlockList } from '../utils/getStandardDeckViewLayerBlockList' -import { getProtocolModulesInfo } from '../utils/getProtocolModulesInfo' +import { getStandardDeckViewLayerBlockList } from '/app/local-resources/deck_configuration' +import { + getProtocolModulesInfo, + getLabwareRenderInfo, + getWellFillFromLabwareId, +} from '/app/transformations/analysis' import type { CompletedProtocolAnalysis, diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/__tests__/LiquidsLabwareDetailsModal.test.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLiquids/__tests__/LiquidsLabwareDetailsModal.test.tsx index 6ff268720a4..92cde6246c9 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/__tests__/LiquidsLabwareDetailsModal.test.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLiquids/__tests__/LiquidsLabwareDetailsModal.test.tsx @@ -8,14 +8,14 @@ import { parseLiquidsInLoadOrder } from '@opentrons/shared-data' import { nestedTextMatcher, renderWithProviders } from '/app/__testing-utils__' import { i18n } from '/app/i18n' import { getIsOnDevice } from '/app/redux/config' -import { useMostRecentCompletedAnalysis } from '../../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' import { mockDefinition } from '/app/redux/custom-labware/__fixtures__' -import { getLocationInfoNames } from '../../utils/getLocationInfoNames' +import { getLocationInfoNames } from '/app/transformations/commands' import { getSlotLabwareDefinition } from '../../utils/getSlotLabwareDefinition' import { getLiquidsByIdForLabware, getDisabledWellFillFromLabwareId, -} from '../utils' +} from '/app/transformations/analysis' import { LiquidsLabwareDetailsModal } from '../LiquidsLabwareDetailsModal' import { LiquidDetailCard } from '../LiquidDetailCard' @@ -37,11 +37,11 @@ vi.mock('@opentrons/shared-data', async importOriginal => { } }) vi.mock('/app/redux/config') -vi.mock('../../../../LabwarePositionCheck/useMostRecentCompletedAnalysis') +vi.mock('/app/resources/runs') vi.mock('../../../../Devices/hooks') -vi.mock('../../utils/getLocationInfoNames') +vi.mock('/app/transformations/commands') vi.mock('../../utils/getSlotLabwareDefinition') -vi.mock('../utils') +vi.mock('/app/transformations/analysis') vi.mock('../LiquidDetailCard') const render = ( diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/__tests__/SetupLiquidsList.test.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLiquids/__tests__/SetupLiquidsList.test.tsx index 80a3384dd24..55000f936e8 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/__tests__/SetupLiquidsList.test.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLiquids/__tests__/SetupLiquidsList.test.tsx @@ -16,9 +16,12 @@ import { ANALYTICS_OPEN_LIQUID_LABWARE_DETAIL_MODAL, } from '/app/redux/analytics' import { useIsFlex } from '/app/redux-resources/robots' -import { getLocationInfoNames } from '../../utils/getLocationInfoNames' +import { getLocationInfoNames } from '/app/transformations/commands' import { SetupLiquidsList } from '../SetupLiquidsList' -import { getTotalVolumePerLiquidId, getVolumePerWell } from '../utils' +import { + getTotalVolumePerLiquidId, + getVolumePerWell, +} from '/app/transformations/analysis' import { LiquidsLabwareDetailsModal } from '../LiquidsLabwareDetailsModal' import { useNotifyRunQuery } from '/app/resources/runs' @@ -52,8 +55,8 @@ const MOCK_LABWARE_INFO_BY_LIQUID_ID = { ], } -vi.mock('../utils') -vi.mock('../../utils/getLocationInfoNames') +vi.mock('/app/transformations/analysis') +vi.mock('/app/transformations/commands') vi.mock('/app/redux-resources/robots') vi.mock('../LiquidsLabwareDetailsModal') vi.mock('@opentrons/shared-data', async importOriginal => { diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/__tests__/SetupLiquidsMap.test.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLiquids/__tests__/SetupLiquidsMap.test.tsx index 4276aa5dd6f..f384bf40dd4 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/__tests__/SetupLiquidsMap.test.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLiquids/__tests__/SetupLiquidsMap.test.tsx @@ -21,13 +21,15 @@ import { import { renderWithProviders } from '/app/__testing-utils__' import { i18n } from '/app/i18n' -import { useAttachedModules } from '../../../hooks' +import { useAttachedModules } from '/app/resources/modules' import { LabwareInfoOverlay } from '../../LabwareInfoOverlay' -import { getLabwareRenderInfo } from '../../utils/getLabwareRenderInfo' -import { getStandardDeckViewLayerBlockList } from '../../utils/getStandardDeckViewLayerBlockList' -import { getAttachedProtocolModuleMatches } from '../../../../ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/utils' -import { getProtocolModulesInfo } from '../../utils/getProtocolModulesInfo' -import { mockProtocolModuleInfo } from '../../../../ODD/ProtocolSetup/ProtocolSetupLabware/__fixtures__' +import { getStandardDeckViewLayerBlockList } from '/app/local-resources/deck_configuration' +import { getAttachedProtocolModuleMatches } from '/app/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/utils' +import { + getProtocolModulesInfo, + getLabwareRenderInfo, +} from '/app/transformations/analysis' +import { mockProtocolModuleInfo } from '/app/organisms/ODD/ProtocolSetup/ProtocolSetupLabware/__fixtures__' import { mockFetchModulesSuccessActionPayloadModules } from '/app/redux/modules/__fixtures__' import { SetupLiquidsMap } from '../SetupLiquidsMap' @@ -49,11 +51,9 @@ vi.mock('@opentrons/components', async importOriginal => { vi.mock('@opentrons/components/src/hardware-sim/BaseDeck') vi.mock('../../LabwareInfoOverlay') -vi.mock('../../../hooks') -vi.mock('../utils') -vi.mock('../../utils/getLabwareRenderInfo') +vi.mock('/app/resources/modules') vi.mock('../../../../ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/utils') -vi.mock('../../utils/getProtocolModulesInfo') +vi.mock('/app/transformations/analysis') vi.mock('/app/resources/deck_configuration/utils') vi.mock('@opentrons/shared-data', async importOriginal => { const actual = await importOriginal() diff --git a/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/SetupModulesList.tsx b/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/SetupModulesList.tsx index 058c000f953..d6a8e8c29b6 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/SetupModulesList.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/SetupModulesList.tsx @@ -37,15 +37,17 @@ import { import { useRobot, useIsFlex } from '/app/redux-resources/robots' import { TertiaryButton } from '/app/atoms/buttons' import { StatusLabel } from '/app/atoms/StatusLabel' -import { useChainLiveCommands } from '/app/resources/runs' +import { + useChainLiveCommands, + useRunCalibrationStatus, +} from '/app/resources/runs' import { ModuleSetupModal } from '../../../ModuleCard/ModuleSetupModal' import { ModuleWizardFlows } from '../../../ModuleWizardFlows' -import { getModulePrepCommands } from '../../getModulePrepCommands' -import { getModuleTooHot } from '../../getModuleTooHot' +import { getModulePrepCommands } from '/app/local-resources/modules' +import { getModuleTooHot } from '/app/transformations/modules' import { useModuleRenderInfoForProtocolById, useUnmatchedModulesForProtocol, - useRunCalibrationStatus, } from '../../hooks' import { LocationConflictModal } from './LocationConflictModal' import { OT2MultipleModulesHelp } from './OT2MultipleModulesHelp' @@ -58,10 +60,8 @@ import type { ModuleModel, } from '@opentrons/shared-data' import type { AttachedModule } from '/app/redux/modules/types' -import type { - ModuleRenderInfoForProtocol, - ProtocolCalibrationStatus, -} from '../../hooks' +import type { ModuleRenderInfoForProtocol } from '../../hooks' +import type { ProtocolCalibrationStatus } from '/app/resources/runs' interface SetupModulesListProps { robotName: string diff --git a/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/SetupModulesMap.tsx b/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/SetupModulesMap.tsx index cbf220b8d8a..bd105dca131 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/SetupModulesMap.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/SetupModulesMap.tsx @@ -13,12 +13,12 @@ import { getSimplestDeckConfigForProtocol, } from '@opentrons/shared-data' -import { useMostRecentCompletedAnalysis } from '../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' -import { getAttachedProtocolModuleMatches } from '../../../ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/utils' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' +import { getAttachedProtocolModuleMatches } from '/app/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/utils' import { ModuleInfo } from '../../ModuleInfo' -import { useAttachedModules } from '../../hooks' -import { getProtocolModulesInfo } from '../utils/getProtocolModulesInfo' -import { getStandardDeckViewLayerBlockList } from '../utils/getStandardDeckViewLayerBlockList' +import { useAttachedModules } from '/app/resources/modules' +import { getProtocolModulesInfo } from '/app/transformations/analysis' +import { getStandardDeckViewLayerBlockList } from '/app/local-resources/deck_configuration' import { useNotifyDeckConfigurationQuery } from '/app/resources/deck_configuration' import { useStoredProtocolAnalysis } from '/app/resources/analysis' diff --git a/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/__tests__/SetupModulesList.test.tsx b/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/__tests__/SetupModulesList.test.tsx index 0be86e2df3b..a280d200e8b 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/__tests__/SetupModulesList.test.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/__tests__/SetupModulesList.test.tsx @@ -14,13 +14,15 @@ import { mockThermocycler, } from '/app/redux/modules/__fixtures__' import { useRobot, useIsFlex } from '/app/redux-resources/robots' -import { useChainLiveCommands } from '/app/resources/runs' +import { + useChainLiveCommands, + useRunCalibrationStatus, +} from '/app/resources/runs' import { ModuleSetupModal } from '../../../../ModuleCard/ModuleSetupModal' import { ModuleWizardFlows } from '../../../../ModuleWizardFlows' import { useModuleRenderInfoForProtocolById, useUnmatchedModulesForProtocol, - useRunCalibrationStatus, } from '../../../hooks' import { OT2MultipleModulesHelp } from '../OT2MultipleModulesHelp' import { UnMatchedModuleWarning } from '../UnMatchedModuleWarning' diff --git a/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/__tests__/SetupModulesMap.test.tsx b/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/__tests__/SetupModulesMap.test.tsx index 8fac42d8ed1..7772e724546 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/__tests__/SetupModulesMap.test.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/__tests__/SetupModulesMap.test.tsx @@ -14,7 +14,7 @@ import { mockThermocycler as mockThermocyclerFixture, mockMagneticModule as mockMagneticModuleFixture, } from '/app/redux/modules/__fixtures__/index' -import { useMostRecentCompletedAnalysis } from '../../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' import { getAttachedProtocolModuleMatches } from '../../../../ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/utils' import { ModuleInfo } from '../../../ModuleInfo' import { SetupModulesMap } from '../SetupModulesMap' @@ -43,10 +43,10 @@ vi.mock('@opentrons/shared-data', async importOriginal => { inferModuleOrientationFromXCoordinate: vi.fn(), } }) -vi.mock('../../../../LabwarePositionCheck/useMostRecentCompletedAnalysis') +vi.mock('/app/resources/runs/useMostRecentCompletedAnalysis') vi.mock('../../../../ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/utils') vi.mock('../../../ModuleInfo') -vi.mock('../../../hooks') +vi.mock('/app/resources/modules') const render = (props: React.ComponentProps) => { return renderWithProviders( diff --git a/app/src/organisms/Devices/ProtocolRun/SetupPipetteCalibrationItem.tsx b/app/src/organisms/Devices/ProtocolRun/SetupPipetteCalibrationItem.tsx index 653942b9c00..a53bbfcaed3 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupPipetteCalibrationItem.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupPipetteCalibrationItem.tsx @@ -24,8 +24,7 @@ import * as PipetteConstants from '/app/redux/pipettes/constants' import { useDeckCalibrationData } from '../hooks' import { SetupCalibrationItem } from './SetupCalibrationItem' -import type { Mount } from '/app/redux/pipettes/types' -import type { PipetteInfo } from '../hooks' +import type { Mount, PipetteInfo } from '/app/redux/pipettes' const inexactPipetteSupportArticle = 'https://support.opentrons.com/s/article/GEN2-pipette-compatibility' diff --git a/app/src/organisms/Devices/ProtocolRun/SetupTipLengthCalibration.tsx b/app/src/organisms/Devices/ProtocolRun/SetupTipLengthCalibration.tsx index c8d45d15ad3..c79e2d82dab 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupTipLengthCalibration.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupTipLengthCalibration.tsx @@ -11,7 +11,7 @@ import { } from '@opentrons/components' import * as PipetteConstants from '/app/redux/pipettes/constants' -import { useRunPipetteInfoByMount } from '../hooks' +import { useRunPipetteInfoByMount } from '/app/resources/runs' import { SetupCalibrationItem } from './SetupCalibrationItem' import { SetupTipLengthCalibrationButton } from './SetupTipLengthCalibrationButton' interface SetupTipLengthCalibrationProps { diff --git a/app/src/organisms/Devices/ProtocolRun/SetupTipLengthCalibrationButton.tsx b/app/src/organisms/Devices/ProtocolRun/SetupTipLengthCalibrationButton.tsx index 2060c0eca87..498c11fe3f8 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupTipLengthCalibrationButton.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupTipLengthCalibrationButton.tsx @@ -21,11 +21,8 @@ import { import { getLabwareDefURI } from '@opentrons/shared-data' import { TertiaryButton } from '/app/atoms/buttons' -import { - useAttachedPipettes, - useDeckCalibrationData, - useRunHasStarted, -} from '../hooks' +import { useAttachedPipettes } from '/app/resources/instruments' +import { useDeckCalibrationData, useRunHasStarted } from '../hooks' import { useDashboardCalibrateTipLength } from '/app/pages/Desktop/Devices/CalibrationDashboard/hooks/useDashboardCalibrateTipLength' import type { Mount } from '@opentrons/components' diff --git a/app/src/organisms/Devices/ProtocolRun/__tests__/LabwareInfoOverlay.test.tsx b/app/src/organisms/Devices/ProtocolRun/__tests__/LabwareInfoOverlay.test.tsx index 629c60e9209..8e81a9f6cff 100644 --- a/app/src/organisms/Devices/ProtocolRun/__tests__/LabwareInfoOverlay.test.tsx +++ b/app/src/organisms/Devices/ProtocolRun/__tests__/LabwareInfoOverlay.test.tsx @@ -9,9 +9,9 @@ import { import { nestedTextMatcher, renderWithProviders } from '/app/__testing-utils__' import { i18n } from '/app/i18n' import { useCurrentRun } from '/app/resources/runs' -import { getLabwareLocation } from '../utils/getLabwareLocation' +import { getLabwareLocation } from '/app/transformations/commands' import { LabwareInfoOverlay } from '../LabwareInfoOverlay' -import { getLabwareDefinitionUri } from '../utils/getLabwareDefinitionUri' +import { getLabwareDefinitionUri } from '/app/transformations/protocols' import { useLabwareOffsetForLabware } from '../useLabwareOffsetForLabware' import type { LabwareDefinition2, @@ -20,9 +20,9 @@ import type { } from '@opentrons/shared-data' vi.mock('/app/resources/runs') -vi.mock('../utils/getLabwareLocation') +vi.mock('/app/transformations/commands') vi.mock('../../hooks') -vi.mock('../utils/getLabwareDefinitionUri') +vi.mock('/app/transformations/protocols') vi.mock('../useLabwareOffsetForLabware') vi.mock('@opentrons/shared-data', async importOriginal => { diff --git a/app/src/organisms/Devices/ProtocolRun/__tests__/ProtocolRunRuntimeParameters.test.tsx b/app/src/organisms/Devices/ProtocolRun/__tests__/ProtocolRunRuntimeParameters.test.tsx index 5e295c6b7a6..1c919131412 100644 --- a/app/src/organisms/Devices/ProtocolRun/__tests__/ProtocolRunRuntimeParameters.test.tsx +++ b/app/src/organisms/Devices/ProtocolRun/__tests__/ProtocolRunRuntimeParameters.test.tsx @@ -5,8 +5,11 @@ import { when } from 'vitest-when' import { InfoScreen } from '@opentrons/components' import { renderWithProviders } from '/app/__testing-utils__' import { i18n } from '/app/i18n' -import { useMostRecentCompletedAnalysis } from '../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' -import { useNotifyRunQuery, useRunStatus } from '/app/resources/runs' +import { + useMostRecentCompletedAnalysis, + useNotifyRunQuery, + useRunStatus, +} from '/app/resources/runs' import { mockSucceededRun, mockIdleUnstartedRun, @@ -27,7 +30,6 @@ vi.mock('@opentrons/components', async importOriginal => { InfoScreen: vi.fn(), } }) -vi.mock('../../../LabwarePositionCheck/useMostRecentCompletedAnalysis') vi.mock('/app/resources/runs') vi.mock('/app/redux/config') diff --git a/app/src/organisms/Devices/ProtocolRun/__tests__/ProtocolRunSetup.test.tsx b/app/src/organisms/Devices/ProtocolRun/__tests__/ProtocolRunSetup.test.tsx index 9dfd04b716f..3e2b623482e 100644 --- a/app/src/organisms/Devices/ProtocolRun/__tests__/ProtocolRunSetup.test.tsx +++ b/app/src/organisms/Devices/ProtocolRun/__tests__/ProtocolRunSetup.test.tsx @@ -19,16 +19,19 @@ import { getIsFixtureMismatch, getRequiredDeckConfig, } from '/app/resources/deck_configuration/utils' -import { useMostRecentCompletedAnalysis } from '../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { + useMostRecentCompletedAnalysis, + useRunCalibrationStatus, + useRunPipetteInfoByMount, + useNotifyRunQuery, +} from '/app/resources/runs' import { useDeckConfigurationCompatibility } from '/app/resources/deck_configuration/hooks' import { useRobot, useIsFlex } from '/app/redux-resources/robots' import { useStoredProtocolAnalysis } from '/app/resources/analysis' import { useModuleCalibrationStatus, useProtocolAnalysisErrors, - useRunCalibrationStatus, useRunHasStarted, - useRunPipetteInfoByMount, useUnmatchedModulesForProtocol, } from '../../hooks' @@ -39,7 +42,6 @@ import { SetupModuleAndDeck } from '../SetupModuleAndDeck' import { EmptySetupStep } from '../EmptySetupStep' import { ProtocolRunSetup } from '../ProtocolRunSetup' import type { MissingSteps } from '../ProtocolRunSetup' -import { useNotifyRunQuery } from '/app/resources/runs' import type * as SharedData from '@opentrons/shared-data' @@ -49,11 +51,13 @@ vi.mock('../SetupRobotCalibration') vi.mock('../SetupModuleAndDeck') vi.mock('../SetupLiquids') vi.mock('../EmptySetupStep') -vi.mock('../../../LabwarePositionCheck/useMostRecentCompletedAnalysis') +vi.mock('/app/resources/runs/useNotifyRunQuery') +vi.mock('/app/resources/runs/useMostRecentCompletedAnalysis') +vi.mock('/app/resources/runs/useRunCalibrationStatus') +vi.mock('/app/resources/runs/useRunPipetteInfoByMount') vi.mock('/app/redux/config') vi.mock('/app/resources/deck_configuration/utils') vi.mock('/app/resources/deck_configuration/hooks') -vi.mock('/app/resources/runs/useNotifyRunQuery') vi.mock('/app/redux-resources/robots') vi.mock('/app/resources/analysis') vi.mock('@opentrons/shared-data', async importOriginal => { diff --git a/app/src/organisms/Devices/ProtocolRun/__tests__/SetupFlexPipetteCalibrationItem.test.tsx b/app/src/organisms/Devices/ProtocolRun/__tests__/SetupFlexPipetteCalibrationItem.test.tsx index c957030ad73..5013abc419c 100644 --- a/app/src/organisms/Devices/ProtocolRun/__tests__/SetupFlexPipetteCalibrationItem.test.tsx +++ b/app/src/organisms/Devices/ProtocolRun/__tests__/SetupFlexPipetteCalibrationItem.test.tsx @@ -7,16 +7,15 @@ import { useInstrumentsQuery } from '@opentrons/react-api-client' import { renderWithProviders } from '/app/__testing-utils__' import { i18n } from '/app/i18n' -import { useMostRecentCompletedAnalysis } from '../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' import { PipetteWizardFlows } from '../../../PipetteWizardFlows' import { SetupFlexPipetteCalibrationItem } from '../SetupFlexPipetteCalibrationItem' -import _uncastedModifiedSimpleV6Protocol from '../../hooks/__fixtures__/modifiedSimpleV6.json' +import { modifiedSimpleV6Protocol as _uncastedModifiedSimpleV6Protocol } from '/app/resources/runs/__fixtures__' import type { CompletedProtocolAnalysis } from '@opentrons/shared-data' vi.mock('@opentrons/react-api-client') vi.mock('../../../PipetteWizardFlows') -vi.mock('../../../LabwarePositionCheck/useMostRecentCompletedAnalysis') -vi.mock('../../hooks') +vi.mock('/app/resources/runs') vi.mock('/app/resources/analysis') const RUN_ID = '1' diff --git a/app/src/organisms/Devices/ProtocolRun/__tests__/SetupPipetteCalibration.test.tsx b/app/src/organisms/Devices/ProtocolRun/__tests__/SetupPipetteCalibration.test.tsx index 2848c2b578f..9dd85d2e69b 100644 --- a/app/src/organisms/Devices/ProtocolRun/__tests__/SetupPipetteCalibration.test.tsx +++ b/app/src/organisms/Devices/ProtocolRun/__tests__/SetupPipetteCalibration.test.tsx @@ -6,14 +6,15 @@ import { screen } from '@testing-library/react' import { renderWithProviders } from '/app/__testing-utils__' import { i18n } from '/app/i18n' import { mockTipRackDefinition } from '/app/redux/custom-labware/__fixtures__' -import { useRunPipetteInfoByMount } from '../../hooks' import { SetupPipetteCalibrationItem } from '../SetupPipetteCalibrationItem' import { SetupInstrumentCalibration } from '../SetupInstrumentCalibration' -import { useNotifyRunQuery } from '/app/resources/runs' +import { + useNotifyRunQuery, + useRunPipetteInfoByMount, +} from '/app/resources/runs' -import type { PipetteInfo } from '../../hooks' +import type { PipetteInfo } from '/app/redux/pipettes' -vi.mock('../../hooks') vi.mock('../SetupPipetteCalibrationItem') vi.mock('/app/redux-resources/robots') vi.mock('/app/resources/runs') diff --git a/app/src/organisms/Devices/ProtocolRun/__tests__/SetupTipLengthCalibration.test.tsx b/app/src/organisms/Devices/ProtocolRun/__tests__/SetupTipLengthCalibration.test.tsx index daaf804c60a..5f78c69802e 100644 --- a/app/src/organisms/Devices/ProtocolRun/__tests__/SetupTipLengthCalibration.test.tsx +++ b/app/src/organisms/Devices/ProtocolRun/__tests__/SetupTipLengthCalibration.test.tsx @@ -6,14 +6,14 @@ import { screen } from '@testing-library/react' import { renderWithProviders } from '/app/__testing-utils__' import { i18n } from '/app/i18n' import { mockTipRackDefinition } from '/app/redux/custom-labware/__fixtures__' -import { useRunPipetteInfoByMount } from '../../hooks' +import { useRunPipetteInfoByMount } from '/app/resources/runs' import { SetupTipLengthCalibrationButton } from '../SetupTipLengthCalibrationButton' import { SetupTipLengthCalibration } from '../SetupTipLengthCalibration' -import type { PipetteInfo } from '../../hooks' +import type { PipetteInfo } from '/app/redux/pipettes' vi.mock('/app/redux/config') -vi.mock('../../hooks') +vi.mock('/app/resources/runs') vi.mock('../SetupTipLengthCalibrationButton') const ROBOT_NAME = 'otie' diff --git a/app/src/organisms/Devices/ProtocolRun/useLabwareOffsetForLabware.ts b/app/src/organisms/Devices/ProtocolRun/useLabwareOffsetForLabware.ts index 826dc739421..5a88d626080 100644 --- a/app/src/organisms/Devices/ProtocolRun/useLabwareOffsetForLabware.ts +++ b/app/src/organisms/Devices/ProtocolRun/useLabwareOffsetForLabware.ts @@ -1,12 +1,14 @@ import { getLoadedLabwareDefinitionsByUri } from '@opentrons/shared-data' import { getCurrentOffsetForLabwareInLocation } from './utils/getCurrentOffsetForLabwareInLocation' -import { getLabwareDefinitionUri } from './utils/getLabwareDefinitionUri' -import { getLabwareOffsetLocation } from './utils/getLabwareOffsetLocation' -import { useNotifyRunQuery } from '/app/resources/runs' +import { getLabwareDefinitionUri } from '/app/transformations/protocols' +import { getLabwareOffsetLocation } from '/app/transformations/analysis' +import { + useNotifyRunQuery, + useMostRecentCompletedAnalysis, +} from '/app/resources/runs' import type { LabwareOffset } from '@opentrons/api-client' -import { useMostRecentCompletedAnalysis } from '../../LabwarePositionCheck/useMostRecentCompletedAnalysis' export function useLabwareOffsetForLabware( runId: string, diff --git a/app/src/organisms/Devices/__tests__/InstrumentsAndModules.test.tsx b/app/src/organisms/Devices/__tests__/InstrumentsAndModules.test.tsx index 813fab1ecd6..297f8826f6b 100644 --- a/app/src/organisms/Devices/__tests__/InstrumentsAndModules.test.tsx +++ b/app/src/organisms/Devices/__tests__/InstrumentsAndModules.test.tsx @@ -20,7 +20,7 @@ import { GripperCard } from '../../GripperCard' import { PipetteCard } from '../PipetteCard' import { FlexPipetteCard } from '../PipetteCard/FlexPipetteCard' import { PipetteRecalibrationWarning } from '../PipetteCard/PipetteRecalibrationWarning' -import { getShowPipetteCalibrationWarning } from '../utils' +import { getShowPipetteCalibrationWarning } from '/app/transformations/instruments' import { useIsEstopNotDisengaged } from '/app/resources/devices/hooks/useIsEstopNotDisengaged' import { useCurrentRunId } from '/app/resources/runs' import type * as Components from '@opentrons/components' @@ -41,7 +41,7 @@ vi.mock('../PipetteCard/FlexPipetteCard') vi.mock('../PipetteCard/PipetteRecalibrationWarning') vi.mock('/app/resources/runs') vi.mock('/app/redux-resources/robots') -vi.mock('../utils') +vi.mock('/app/transformations/instruments') vi.mock('/app/resources/devices/hooks/useIsEstopNotDisengaged') const ROBOT_NAME = 'otie' diff --git a/app/src/organisms/Devices/__tests__/RobotCard.test.tsx b/app/src/organisms/Devices/__tests__/RobotCard.test.tsx index e5c09e3ebb8..4f8cd715ac2 100644 --- a/app/src/organisms/Devices/__tests__/RobotCard.test.tsx +++ b/app/src/organisms/Devices/__tests__/RobotCard.test.tsx @@ -21,12 +21,13 @@ import { import { mockConnectableRobot } from '/app/redux/discovery/__fixtures__' import { getRobotUpdateDisplayInfo } from '/app/redux/robot-update' import { getRobotModelByName } from '/app/redux/discovery' +import { useAttachedModules } from '/app/resources/modules' import { HEALTH_STATUS_OK, ROBOT_MODEL_OT2, ROBOT_MODEL_OT3, } from '/app/redux/discovery/constants' -import { useAttachedModules, useAttachedPipettes } from '../hooks' +import { useAttachedPipettes } from '/app/resources/instruments' import { UpdateRobotBanner } from '../../UpdateRobotBanner' import { RobotOverflowMenu } from '../RobotOverflowMenu' import { RobotStatusHeader } from '../RobotStatusHeader' @@ -40,7 +41,8 @@ import type { State } from '/app/redux/types' vi.mock('/app/redux/robot-update/selectors') vi.mock('/app/redux/discovery/selectors') -vi.mock('../hooks') +vi.mock('/app/resources/instruments') +vi.mock('/app/resources/modules') vi.mock('/app/redux-resources/robots') vi.mock('../../UpdateRobotBanner') vi.mock('/app/redux/config') diff --git a/app/src/organisms/Devices/hooks/__tests__/useCalibrationTaskList.test.tsx b/app/src/organisms/Devices/hooks/__tests__/useCalibrationTaskList.test.tsx index 127011ec054..b34ba724274 100644 --- a/app/src/organisms/Devices/hooks/__tests__/useCalibrationTaskList.test.tsx +++ b/app/src/organisms/Devices/hooks/__tests__/useCalibrationTaskList.test.tsx @@ -12,7 +12,7 @@ import { useCalibrationStatusQuery, } from '@opentrons/react-api-client' import { useCalibrationTaskList } from '../useCalibrationTaskList' -import { useAttachedPipettes } from '..' +import { useAttachedPipettes } from '/app/resources/instruments' import { TASK_COUNT, mockAttachedPipettesResponse, @@ -33,7 +33,7 @@ import { i18n } from '/app/i18n' import type { Store } from 'redux' import type { State } from '/app/redux/types' -vi.mock('../') +vi.mock('/app/resources/instruments') vi.mock('@opentrons/react-api-client') const mockPipOffsetCalLauncher = vi.fn() diff --git a/app/src/organisms/Devices/hooks/__tests__/useLPCDisabledReason.test.tsx b/app/src/organisms/Devices/hooks/__tests__/useLPCDisabledReason.test.tsx index a22c66b7dd0..c1d31a78638 100644 --- a/app/src/organisms/Devices/hooks/__tests__/useLPCDisabledReason.test.tsx +++ b/app/src/organisms/Devices/hooks/__tests__/useLPCDisabledReason.test.tsx @@ -13,19 +13,18 @@ import { RUN_ID_1 } from '/app/resources/runs/__fixtures__' import { useStoredProtocolAnalysis } from '/app/resources/analysis' import { useLPCDisabledReason } from '../useLPCDisabledReason' +import { useRunHasStarted, useUnmatchedModulesForProtocol } from '..' import { useRunCalibrationStatus, - useRunHasStarted, - useUnmatchedModulesForProtocol, -} from '..' -import { useMostRecentCompletedAnalysis } from '../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' + useMostRecentCompletedAnalysis, +} from '/app/resources/runs' import type { Store } from 'redux' import type * as SharedData from '@opentrons/shared-data' import type { State } from '/app/redux/types' vi.mock('..') vi.mock('/app/resources/analysis') -vi.mock('../../../LabwarePositionCheck/useMostRecentCompletedAnalysis') +vi.mock('/app/resources/runs') vi.mock('@opentrons/shared-data', async importOriginal => { const actualSharedData = await importOriginal() return { diff --git a/app/src/organisms/Devices/hooks/__tests__/useModuleRenderInfoForProtocolById.test.tsx b/app/src/organisms/Devices/hooks/__tests__/useModuleRenderInfoForProtocolById.test.tsx index a3bf76d7b2b..6958dc43000 100644 --- a/app/src/organisms/Devices/hooks/__tests__/useModuleRenderInfoForProtocolById.test.tsx +++ b/app/src/organisms/Devices/hooks/__tests__/useModuleRenderInfoForProtocolById.test.tsx @@ -8,18 +8,16 @@ import { TEMPERATURE_MODULE_V2_FIXTURE, heater_shaker_commands_with_results_key, } from '@opentrons/shared-data' -import { useMostRecentCompletedAnalysis } from '../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' - -import { getProtocolModulesInfo } from '../../ProtocolRun/utils/getProtocolModulesInfo' - +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' +import { getProtocolModulesInfo } from '/app/transformations/analysis' +import { useStoredProtocolAnalysis } from '/app/resources/analysis' +import { useAttachedModules } from '/app/resources/modules' +import { useModuleRenderInfoForProtocolById } from '..' +import { useNotifyDeckConfigurationQuery } from '/app/resources/deck_configuration' import { mockTemperatureModuleGen2, mockThermocycler, } from '/app/redux/modules/__fixtures__' -import { useStoredProtocolAnalysis } from '/app/resources/analysis' -import { useAttachedModules, useModuleRenderInfoForProtocolById } from '..' -import { useNotifyDeckConfigurationQuery } from '/app/resources/deck_configuration' - import type { CutoutConfig, DeckConfiguration, @@ -30,10 +28,10 @@ import type { import type { UseQueryResult } from 'react-query' import type { AttachedModule } from '/app/redux/modules/types' -vi.mock('../../ProtocolRun/utils/getProtocolModulesInfo') -vi.mock('../useAttachedModules') +vi.mock('/app/transformations/analysis') +vi.mock('/app/resources/modules') vi.mock('/app/resources/analysis') -vi.mock('../../../LabwarePositionCheck/useMostRecentCompletedAnalysis') +vi.mock('/app/resources/runs') vi.mock('/app/resources/deck_configuration') const heaterShakerCommandsWithResultsKey = (heater_shaker_commands_with_results_key as unknown) as ProtocolAnalysisOutput diff --git a/app/src/organisms/Devices/hooks/__tests__/useUnmatchedModulesForProtocol.test.tsx b/app/src/organisms/Devices/hooks/__tests__/useUnmatchedModulesForProtocol.test.tsx index 000b34926d2..a40a8c62420 100644 --- a/app/src/organisms/Devices/hooks/__tests__/useUnmatchedModulesForProtocol.test.tsx +++ b/app/src/organisms/Devices/hooks/__tests__/useUnmatchedModulesForProtocol.test.tsx @@ -5,15 +5,15 @@ import { renderHook } from '@testing-library/react' import { mockConnectedRobot } from '/app/redux/discovery/__fixtures__' import { mockTemperatureModule } from '/app/redux/modules/__fixtures__' import { useRobot } from '/app/redux-resources/robots' +import { useAttachedModules } from '/app/resources/modules' import { - useAttachedModules, useModuleRenderInfoForProtocolById, useUnmatchedModulesForProtocol, } from '..' import type { ModuleDefinition } from '@opentrons/shared-data' -vi.mock('../useAttachedModules') +vi.mock('/app/resources/modules') vi.mock('../useModuleRenderInfoForProtocolById') vi.mock('/app/redux-resources/robots') diff --git a/app/src/organisms/Devices/hooks/index.ts b/app/src/organisms/Devices/hooks/index.ts index f60c5a29c27..ad7c71011c0 100644 --- a/app/src/organisms/Devices/hooks/index.ts +++ b/app/src/organisms/Devices/hooks/index.ts @@ -1,8 +1,4 @@ -export * from './useAttachedModules' -export * from './useAttachedPipetteCalibrations' -export * from './useAttachedPipettes' export * from './useDeckCalibrationData' -export * from './useDeckCalibrationStatus' export * from './useDownloadRunLog' export * from './useCalibrationTaskList' export * from './useIsRobotBusy' @@ -15,10 +11,8 @@ export * from './useModuleRenderInfoForProtocolById' export * from './useModuleCalibrationStatus' export * from './usePipetteOffsetCalibrations' export * from './usePipetteOffsetCalibration' -export * from './useRunCalibrationStatus' export * from './useRunCreatedAtTimestamp' export * from './useRunHasStarted' -export * from './useRunPipetteInfoByMount' export * from './useTipLengthCalibrations' export * from './useUnmatchedModulesForProtocol' export * from './useProtocolAnalysisErrors' diff --git a/app/src/organisms/Devices/hooks/useAttachedPipettesFromInstrumentsQuery.ts b/app/src/organisms/Devices/hooks/useAttachedPipettesFromInstrumentsQuery.ts index 7b73e060e70..84d318ab110 100644 --- a/app/src/organisms/Devices/hooks/useAttachedPipettesFromInstrumentsQuery.ts +++ b/app/src/organisms/Devices/hooks/useAttachedPipettesFromInstrumentsQuery.ts @@ -1,14 +1,12 @@ import { useInstrumentsQuery } from '@opentrons/react-api-client' import { LEFT, RIGHT } from '@opentrons/shared-data' -import { usePipetteModelSpecs } from '/app/resources/instruments/hooks' +import { usePipetteModelSpecs } from '/app/local-resources/instruments' import type { PipetteData } from '@opentrons/api-client' import type { Mount } from '@opentrons/components' import type { PipetteModel } from '@opentrons/shared-data' +import type { PipetteInformation } from '/app/redux/pipettes' -export interface PipetteInformation extends PipetteData { - displayName: string -} export type AttachedPipettesFromInstrumentsQuery = { [mount in Mount]: null | PipetteInformation } diff --git a/app/src/organisms/Devices/hooks/useCalibrationTaskList.ts b/app/src/organisms/Devices/hooks/useCalibrationTaskList.ts index 9d0c8627eec..1f349187186 100644 --- a/app/src/organisms/Devices/hooks/useCalibrationTaskList.ts +++ b/app/src/organisms/Devices/hooks/useCalibrationTaskList.ts @@ -7,7 +7,7 @@ import { } from '@opentrons/react-api-client' import { getLabwareDefURI } from '@opentrons/shared-data' -import { useAttachedPipettes } from '.' +import { useAttachedPipettes } from '/app/resources/instruments' import { getDefaultTiprackDefForPipetteName } from '../constants' import { DECK_CAL_STATUS_OK } from '/app/redux/calibration/constants' import { formatTimestamp } from '../utils' diff --git a/app/src/organisms/Devices/hooks/useLPCDisabledReason.tsx b/app/src/organisms/Devices/hooks/useLPCDisabledReason.tsx index 02da1596d00..ece1f539495 100644 --- a/app/src/organisms/Devices/hooks/useLPCDisabledReason.tsx +++ b/app/src/organisms/Devices/hooks/useLPCDisabledReason.tsx @@ -3,12 +3,11 @@ import some from 'lodash/some' import { useTranslation } from 'react-i18next' import { getLoadedLabwareDefinitionsByUri } from '@opentrons/shared-data' import { useStoredProtocolAnalysis } from '/app/resources/analysis' -import { useMostRecentCompletedAnalysis } from '../../LabwarePositionCheck/useMostRecentCompletedAnalysis' import { + useMostRecentCompletedAnalysis, useRunCalibrationStatus, - useRunHasStarted, - useUnmatchedModulesForProtocol, -} from '.' +} from '/app/resources/runs' +import { useRunHasStarted, useUnmatchedModulesForProtocol } from '.' interface LPCDisabledReasonProps { runId: string diff --git a/app/src/organisms/Devices/hooks/useModuleCalibrationStatus.ts b/app/src/organisms/Devices/hooks/useModuleCalibrationStatus.ts index a963524f148..d7dbb098e70 100644 --- a/app/src/organisms/Devices/hooks/useModuleCalibrationStatus.ts +++ b/app/src/organisms/Devices/hooks/useModuleCalibrationStatus.ts @@ -5,7 +5,7 @@ import { } from '@opentrons/shared-data' import { useIsFlex } from '/app/redux-resources/robots' import { useModuleRenderInfoForProtocolById } from './useModuleRenderInfoForProtocolById' -import type { ProtocolCalibrationStatus } from './useRunCalibrationStatus' +import type { ProtocolCalibrationStatus } from '/app/resources/runs' export function useModuleCalibrationStatus( robotName: string, diff --git a/app/src/organisms/Devices/hooks/useModuleRenderInfoForProtocolById.ts b/app/src/organisms/Devices/hooks/useModuleRenderInfoForProtocolById.ts index beeacfa16ba..7c10e838522 100644 --- a/app/src/organisms/Devices/hooks/useModuleRenderInfoForProtocolById.ts +++ b/app/src/organisms/Devices/hooks/useModuleRenderInfoForProtocolById.ts @@ -7,15 +7,15 @@ import { OT2_ROBOT_TYPE, } from '@opentrons/shared-data' -import { getProtocolModulesInfo } from '../ProtocolRun/utils/getProtocolModulesInfo' -import { useMostRecentCompletedAnalysis } from '../../LabwarePositionCheck/useMostRecentCompletedAnalysis' -import { useAttachedModules } from './useAttachedModules' +import { getProtocolModulesInfo } from '/app/transformations/analysis' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' +import { useAttachedModules } from '/app/resources/modules' import { useStoredProtocolAnalysis } from '/app/resources/analysis' import { useNotifyDeckConfigurationQuery } from '/app/resources/deck_configuration' import type { CutoutConfig } from '@opentrons/shared-data' import type { AttachedModule } from '/app/redux/modules/types' -import type { ProtocolModuleInfo } from '../ProtocolRun/utils/getProtocolModulesInfo' +import type { ProtocolModuleInfo } from '/app/transformations/analysis' export interface ModuleRenderInfoForProtocol extends ProtocolModuleInfo { attachedModuleMatch: AttachedModule | null diff --git a/app/src/organisms/Devices/hooks/useUnmatchedModulesForProtocol.ts b/app/src/organisms/Devices/hooks/useUnmatchedModulesForProtocol.ts index d73e179e9fd..81b2f492749 100644 --- a/app/src/organisms/Devices/hooks/useUnmatchedModulesForProtocol.ts +++ b/app/src/organisms/Devices/hooks/useUnmatchedModulesForProtocol.ts @@ -3,7 +3,8 @@ import reduce from 'lodash/reduce' import type { AttachedModule } from '/app/redux/modules/types' import { useRobot } from '/app/redux-resources/robots' -import { useAttachedModules, useModuleRenderInfoForProtocolById } from '.' +import { useAttachedModules } from '/app/resources/modules' +import { useModuleRenderInfoForProtocolById } from '.' import { NON_CONNECTING_MODULE_TYPES, getModuleType, diff --git a/app/src/organisms/Devices/utils.ts b/app/src/organisms/Devices/utils.ts index da0b0666280..5fb7ccba217 100644 --- a/app/src/organisms/Devices/utils.ts +++ b/app/src/organisms/Devices/utils.ts @@ -1,15 +1,11 @@ import { format, parseISO } from 'date-fns' -import { INCONSISTENT_PIPETTE_OFFSET } from '@opentrons/api-client' + import type { FetchPipettesResponseBody, FetchPipettesResponsePipette, Mount, } from '/app/redux/pipettes/types' -import type { - Instruments, - PipetteData, - PipetteOffsetCalibration, -} from '@opentrons/api-client' +import type { PipetteOffsetCalibration } from '@opentrons/api-client' /** * formats a string if it is in ISO 8601 date format @@ -74,19 +70,3 @@ export function getOffsetCalibrationForMount( ) } } - -export function getShowPipetteCalibrationWarning( - attachedInstruments?: Instruments -): boolean { - return ( - attachedInstruments?.data.some((i): i is PipetteData => { - const failuresList = - i.ok && i.data.calibratedOffset?.reasonability_check_failures != null - ? i.data.calibratedOffset?.reasonability_check_failures - : [] - if (failuresList.length > 0) { - return failuresList[0]?.kind === INCONSISTENT_PIPETTE_OFFSET - } else return false - }) ?? false - ) -} diff --git a/app/src/organisms/FirmwareUpdateModal/UpdateResultsModal.tsx b/app/src/organisms/FirmwareUpdateModal/UpdateResultsModal.tsx index 19c540e82f0..439521b3710 100644 --- a/app/src/organisms/FirmwareUpdateModal/UpdateResultsModal.tsx +++ b/app/src/organisms/FirmwareUpdateModal/UpdateResultsModal.tsx @@ -13,7 +13,7 @@ import { } from '@opentrons/components' import { SmallButton } from '/app/atoms/buttons' import { OddModal } from '/app/molecules/OddModal' -import { usePipetteModelSpecs } from '/app/resources/instruments/hooks' +import { usePipetteModelSpecs } from '/app/local-resources/instruments' import type { InstrumentData, PipetteData } from '@opentrons/api-client' import type { OddModalHeaderBaseProps } from '/app/molecules/OddModal/types' diff --git a/app/src/organisms/InstrumentMountItem/AttachedInstrumentMountItem.tsx b/app/src/organisms/InstrumentMountItem/AttachedInstrumentMountItem.tsx index d83e3d4e8fd..7d54755f86e 100644 --- a/app/src/organisms/InstrumentMountItem/AttachedInstrumentMountItem.tsx +++ b/app/src/organisms/InstrumentMountItem/AttachedInstrumentMountItem.tsx @@ -6,7 +6,7 @@ import { SINGLE_MOUNT_PIPETTES } from '@opentrons/shared-data' import { useGripperDisplayName, usePipetteModelSpecs, -} from '/app/resources/instruments/hooks' +} from '/app/local-resources/instruments' import { ChoosePipette } from '../PipetteWizardFlows/ChoosePipette' import { FLOWS } from '../PipetteWizardFlows/constants' import { GRIPPER_FLOW_TYPES } from '../GripperWizardFlows/constants' diff --git a/app/src/organisms/InstrumentMountItem/ProtocolInstrumentMountItem.tsx b/app/src/organisms/InstrumentMountItem/ProtocolInstrumentMountItem.tsx index 459b584f882..3ae2b2e85d2 100644 --- a/app/src/organisms/InstrumentMountItem/ProtocolInstrumentMountItem.tsx +++ b/app/src/organisms/InstrumentMountItem/ProtocolInstrumentMountItem.tsx @@ -22,7 +22,7 @@ import { SmallButton } from '/app/atoms/buttons' import { useGripperDisplayName, usePipetteNameSpecs, -} from '/app/resources/instruments/hooks' +} from '/app/local-resources/instruments' import { FLOWS } from '../PipetteWizardFlows/constants' import { PipetteWizardFlows } from '../PipetteWizardFlows' import { GripperWizardFlows } from '../GripperWizardFlows' diff --git a/app/src/organisms/LabwarePositionCheck/IntroScreen/index.tsx b/app/src/organisms/LabwarePositionCheck/IntroScreen/index.tsx index 75fc6b8a62e..aa7dd002c2a 100644 --- a/app/src/organisms/LabwarePositionCheck/IntroScreen/index.tsx +++ b/app/src/organisms/LabwarePositionCheck/IntroScreen/index.tsx @@ -21,7 +21,7 @@ import { import { RobotMotionLoader } from '../RobotMotionLoader' import { getPrepCommands } from './getPrepCommands' import { WizardRequiredEquipmentList } from '/app/molecules/WizardRequiredEquipmentList' -import { getLatestCurrentOffsets } from '../../Devices/ProtocolRun/SetupLabwarePositionCheck/utils' +import { getLatestCurrentOffsets } from '/app/transformations/runs' import { getIsOnDevice } from '/app/redux/config' import { NeedHelpLink } from '../../CalibrationPanels' import { useSelector } from 'react-redux' diff --git a/app/src/organisms/LabwarePositionCheck/__tests__/useLaunchLPC.test.tsx b/app/src/organisms/LabwarePositionCheck/__tests__/useLaunchLPC.test.tsx index 4c007581c81..b10580ab3d3 100644 --- a/app/src/organisms/LabwarePositionCheck/__tests__/useLaunchLPC.test.tsx +++ b/app/src/organisms/LabwarePositionCheck/__tests__/useLaunchLPC.test.tsx @@ -22,8 +22,8 @@ import { renderWithProviders } from '/app/__testing-utils__' import { useCreateTargetedMaintenanceRunMutation, useNotifyRunQuery, + useMostRecentCompletedAnalysis, } from '/app/resources/runs' -import { useMostRecentCompletedAnalysis } from '../useMostRecentCompletedAnalysis' import { useLaunchLPC } from '../useLaunchLPC' import { LabwarePositionCheck } from '..' @@ -33,7 +33,6 @@ import type { LabwareDefinition2 } from '@opentrons/shared-data' vi.mock('../') vi.mock('@opentrons/react-api-client') -vi.mock('../useMostRecentCompletedAnalysis') vi.mock('/app/resources/runs') const MOCK_RUN_ID = 'mockRunId' diff --git a/app/src/organisms/LabwarePositionCheck/useLaunchLPC.tsx b/app/src/organisms/LabwarePositionCheck/useLaunchLPC.tsx index 23569a776fd..ae90b665c96 100644 --- a/app/src/organisms/LabwarePositionCheck/useLaunchLPC.tsx +++ b/app/src/organisms/LabwarePositionCheck/useLaunchLPC.tsx @@ -8,9 +8,9 @@ import { import { useCreateTargetedMaintenanceRunMutation, useNotifyRunQuery, + useMostRecentCompletedAnalysis, } from '/app/resources/runs' import { LabwarePositionCheck } from '.' -import { useMostRecentCompletedAnalysis } from './useMostRecentCompletedAnalysis' import { getLabwareDefinitionsFromCommands } from '/app/molecules/Command/utils/getLabwareDefinitionsFromCommands' import type { RobotType } from '@opentrons/shared-data' diff --git a/app/src/organisms/LabwarePositionCheck/utils/labware.ts b/app/src/organisms/LabwarePositionCheck/utils/labware.ts index efa4336bc78..2fd03ccc0c0 100644 --- a/app/src/organisms/LabwarePositionCheck/utils/labware.ts +++ b/app/src/organisms/LabwarePositionCheck/utils/labware.ts @@ -4,7 +4,7 @@ import { getTiprackVolume, getLabwareDefURI, } from '@opentrons/shared-data' -import { getModuleInitialLoadInfo } from '../../Devices/ProtocolRun/utils/getModuleInitialLoadInfo' +import { getModuleInitialLoadInfo } from '/app/transformations/commands' import { getLabwareDefinitionsFromCommands } from '/app/molecules/Command/utils/getLabwareDefinitionsFromCommands' import type { CompletedProtocolAnalysis, diff --git a/app/src/organisms/ModuleCard/__tests__/hooks.test.tsx b/app/src/organisms/ModuleCard/__tests__/hooks.test.tsx index 0a92dd08099..844a4f350c8 100644 --- a/app/src/organisms/ModuleCard/__tests__/hooks.test.tsx +++ b/app/src/organisms/ModuleCard/__tests__/hooks.test.tsx @@ -18,8 +18,11 @@ import { mockThermocyclerGen2, } from '/app/redux/modules/__fixtures__' import { useIsRobotBusy, useRunStatuses } from '../../Devices/hooks' -import { useMostRecentCompletedAnalysis } from '../../LabwarePositionCheck/useMostRecentCompletedAnalysis' -import { useCurrentRunId } from '/app/resources/runs' + +import { + useCurrentRunId, + useMostRecentCompletedAnalysis, +} from '/app/resources/runs' import { useLatchControls, useModuleOverflowMenu, @@ -30,7 +33,6 @@ import type { Store } from 'redux' import type { State } from '/app/redux/types' vi.mock('@opentrons/react-api-client') -vi.mock('../../LabwarePositionCheck/useMostRecentCompletedAnalysis') vi.mock('/app/resources/runs') vi.mock('../../Devices/hooks') diff --git a/app/src/organisms/ModuleCard/hooks.tsx b/app/src/organisms/ModuleCard/hooks.tsx index 0507fb80d88..f0b8d5e1d37 100644 --- a/app/src/organisms/ModuleCard/hooks.tsx +++ b/app/src/organisms/ModuleCard/hooks.tsx @@ -13,8 +13,11 @@ import { TEMPERATURE_MODULE_TYPE, THERMOCYCLER_MODULE_TYPE, } from '@opentrons/shared-data' -import { useMostRecentCompletedAnalysis } from '../LabwarePositionCheck/useMostRecentCompletedAnalysis' -import { useCurrentRunId } from '/app/resources/runs' + +import { + useCurrentRunId, + useMostRecentCompletedAnalysis, +} from '/app/resources/runs' import type { HeaterShakerCloseLatchCreateCommand, diff --git a/app/src/organisms/ModuleCard/index.tsx b/app/src/organisms/ModuleCard/index.tsx index e0f246d0ea1..3f8affd0b6f 100644 --- a/app/src/organisms/ModuleCard/index.tsx +++ b/app/src/organisms/ModuleCard/index.tsx @@ -46,7 +46,7 @@ import { UpdateBanner } from '/app/molecules/UpdateBanner' import { useChainLiveCommands } from '/app/resources/runs' import { useCurrentRunStatus } from '/app/organisms/RunTimeControl/hooks' import { useIsFlex } from '/app/redux-resources/robots' -import { getModuleTooHot } from '/app/organisms/Devices/getModuleTooHot' +import { getModuleTooHot } from '/app/transformations/modules' import { useToaster } from '/app/organisms/ToasterOven' import { MagneticModuleData } from './MagneticModuleData' import { TemperatureModuleData } from './TemperatureModuleData' @@ -60,7 +60,7 @@ import { HeaterShakerModuleData } from './HeaterShakerModuleData' import { HeaterShakerSlideout } from './HeaterShakerSlideout' import { TestShakeSlideout } from './TestShakeSlideout' import { ModuleWizardFlows } from '../ModuleWizardFlows' -import { getModulePrepCommands } from '/app/organisms/Devices/getModulePrepCommands' +import { getModulePrepCommands } from '/app/local-resources/modules' import { getModuleCardImage } from './utils' import { FirmwareUpdateFailedModal } from './FirmwareUpdateFailedModal' import { ErrorInfo } from './ErrorInfo' diff --git a/app/src/organisms/ModuleWizardFlows/types.ts b/app/src/organisms/ModuleWizardFlows/types.ts index 39fc6e6920e..64127dd125b 100644 --- a/app/src/organisms/ModuleWizardFlows/types.ts +++ b/app/src/organisms/ModuleWizardFlows/types.ts @@ -1,7 +1,7 @@ import type { AttachedModule } from '@opentrons/api-client' import type { FLOWS, SECTIONS } from './constants' import type { CreateCommand } from '@opentrons/shared-data' -import type { PipetteInformation } from '../Devices/hooks' +import type { PipetteInformation } from '/app/redux/pipettes' export type ModuleCalibrationWizardStep = | BeforeBeginningStep diff --git a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupDeckConfiguration/__tests__/ProtocolSetupDeckConfiguration.test.tsx b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupDeckConfiguration/__tests__/ProtocolSetupDeckConfiguration.test.tsx index f56c6db8c72..11fdc6b417b 100644 --- a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupDeckConfiguration/__tests__/ProtocolSetupDeckConfiguration.test.tsx +++ b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupDeckConfiguration/__tests__/ProtocolSetupDeckConfiguration.test.tsx @@ -11,9 +11,9 @@ import { import { renderWithProviders } from '/app/__testing-utils__' import { i18n } from '/app/i18n' -import { useMostRecentCompletedAnalysis } from '../../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' -import { ProtocolSetupDeckConfiguration } from '..' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' import { useNotifyDeckConfigurationQuery } from '/app/resources/deck_configuration' +import { ProtocolSetupDeckConfiguration } from '..' import type { UseQueryResult } from 'react-query' import type { @@ -24,7 +24,7 @@ import type { Modules } from '@opentrons/api-client' vi.mock('@opentrons/components/src/hardware-sim/BaseDeck/index') vi.mock('@opentrons/react-api-client') -vi.mock('../../../../LabwarePositionCheck/useMostRecentCompletedAnalysis') +vi.mock('/app/resources/runs') vi.mock('/app/resources/deck_configuration') const mockSetSetupScreen = vi.fn() diff --git a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupDeckConfiguration/index.tsx b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupDeckConfiguration/index.tsx index cc3c181bd2c..f52d620e03a 100644 --- a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupDeckConfiguration/index.tsx +++ b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupDeckConfiguration/index.tsx @@ -22,7 +22,7 @@ import { import { ChildNavigation } from '../../../ChildNavigation' import { AddFixtureModal } from '../../../DeviceDetailsDeckConfiguration/AddFixtureModal' import { DeckConfigurationDiscardChangesModal } from '../../../DeviceDetailsDeckConfiguration/DeckConfigurationDiscardChangesModal' -import { useMostRecentCompletedAnalysis } from '../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' import { getTopPortalEl } from '../../../../App/portal' import { useNotifyDeckConfigurationQuery } from '/app/resources/deck_configuration' diff --git a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupInstruments/ProtocolSetupInstruments.tsx b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupInstruments/ProtocolSetupInstruments.tsx index 6c757f16dce..4075b7ac006 100644 --- a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupInstruments/ProtocolSetupInstruments.tsx +++ b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupInstruments/ProtocolSetupInstruments.tsx @@ -13,8 +13,8 @@ import { import { useInstrumentsQuery } from '@opentrons/react-api-client' import { ODDBackButton } from '/app/molecules/ODDBackButton' import { PipetteRecalibrationODDWarning } from '/app/pages/ODD/InstrumentsDashboard/PipetteRecalibrationODDWarning' -import { getShowPipetteCalibrationWarning } from '../../../Devices/utils' -import { useMostRecentCompletedAnalysis } from '../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { getShowPipetteCalibrationWarning } from '/app/transformations/instruments' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' import { ProtocolInstrumentMountItem } from '../../../InstrumentMountItem' import type { GripperData, PipetteData } from '@opentrons/api-client' diff --git a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupInstruments/__tests__/ProtocolSetupInstruments.test.tsx b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupInstruments/__tests__/ProtocolSetupInstruments.test.tsx index 3d82d3e544d..fe4205e792d 100644 --- a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupInstruments/__tests__/ProtocolSetupInstruments.test.tsx +++ b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupInstruments/__tests__/ProtocolSetupInstruments.test.tsx @@ -11,13 +11,13 @@ import { import { renderWithProviders } from '/app/__testing-utils__' import { i18n } from '/app/i18n' -import { useMostRecentCompletedAnalysis } from '/app/organisms/LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' import { useIsOEMMode } from '/app/resources/robot-settings/hooks' import { mockRecentAnalysis } from '../__fixtures__' import { ProtocolSetupInstruments } from '..' vi.mock('@opentrons/react-api-client') -vi.mock('/app/organisms/LabwarePositionCheck/useMostRecentCompletedAnalysis') +vi.mock('/app/resources/runs') vi.mock('/app/resources/robot-settings/hooks') const mockGripperData = { diff --git a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLabware/LabwareMapView.tsx b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLabware/LabwareMapView.tsx index d7003d8a4fa..31fc0431335 100644 --- a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLabware/LabwareMapView.tsx +++ b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLabware/LabwareMapView.tsx @@ -7,8 +7,8 @@ import { THERMOCYCLER_MODULE_V1, } from '@opentrons/shared-data' -import { getStandardDeckViewLayerBlockList } from '../../../Devices/ProtocolRun/utils/getStandardDeckViewLayerBlockList' -import { getLabwareRenderInfo } from '../../../Devices/ProtocolRun/utils/getLabwareRenderInfo' +import { getStandardDeckViewLayerBlockList } from '/app/local-resources/deck_configuration' +import { getLabwareRenderInfo } from '/app/transformations/analysis' import type { CompletedProtocolAnalysis, diff --git a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLabware/__tests__/LabwareMapView.test.tsx b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLabware/__tests__/LabwareMapView.test.tsx index 541c719def6..d08914472e1 100644 --- a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLabware/__tests__/LabwareMapView.test.tsx +++ b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLabware/__tests__/LabwareMapView.test.tsx @@ -12,8 +12,8 @@ import { import { renderWithProviders } from '/app/__testing-utils__' import { i18n } from '/app/i18n' -import { getLabwareRenderInfo } from '../../../../Devices/ProtocolRun/utils/getLabwareRenderInfo' -import { getStandardDeckViewLayerBlockList } from '../../../../Devices/ProtocolRun/utils/getStandardDeckViewLayerBlockList' +import { getLabwareRenderInfo } from '/app/transformations/analysis' +import { getStandardDeckViewLayerBlockList } from '/app/local-resources/deck_configuration' import { mockProtocolModuleInfo } from '../__fixtures__' import { LabwareMapView } from '../LabwareMapView' @@ -25,7 +25,7 @@ import type { ModuleModel, } from '@opentrons/shared-data' -vi.mock('../../../../Devices/ProtocolRun/utils/getLabwareRenderInfo') +vi.mock('/app/transformations/analysis') vi.mock('@opentrons/components/src/hardware-sim/Labware/LabwareRender') vi.mock('@opentrons/components/src/hardware-sim/BaseDeck') vi.mock('@opentrons/shared-data/js/helpers/getSimplestFlexDeckConfig') diff --git a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLabware/__tests__/ProtocolSetupLabware.test.tsx b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLabware/__tests__/ProtocolSetupLabware.test.tsx index fe975d4ad0e..a682401649e 100644 --- a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLabware/__tests__/ProtocolSetupLabware.test.tsx +++ b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLabware/__tests__/ProtocolSetupLabware.test.tsx @@ -15,8 +15,8 @@ import { import { renderWithProviders } from '/app/__testing-utils__' import { i18n } from '/app/i18n' -import { useMostRecentCompletedAnalysis } from '/app/organisms/LabwarePositionCheck/useMostRecentCompletedAnalysis' -import { getProtocolModulesInfo } from '../../../../Devices/ProtocolRun/utils/getProtocolModulesInfo' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' +import { getProtocolModulesInfo } from '/app/transformations/analysis' import { ProtocolSetupLabware } from '..' import { mockProtocolModuleInfo, @@ -40,8 +40,8 @@ vi.mock('@opentrons/react-api-client', async importOriginal => { } }) -vi.mock('/app/organisms/LabwarePositionCheck/useMostRecentCompletedAnalysis') -vi.mock('../../../../Devices/ProtocolRun/utils/getProtocolModulesInfo') +vi.mock('/app/resources/runs') +vi.mock('/app/transformations/analysis') vi.mock('/app/resources/deck_configuration') const RUN_ID = "otie's run" diff --git a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLabware/index.tsx b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLabware/index.tsx index 8a08f5fa672..2142d28aadc 100644 --- a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLabware/index.tsx +++ b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLabware/index.tsx @@ -37,12 +37,14 @@ import { import { FloatingActionButton, SmallButton } from '/app/atoms/buttons' import { ODDBackButton } from '/app/molecules/ODDBackButton' -import { getLabwareSetupItemGroups } from '/app/transformations/commands' +import { + getLabwareSetupItemGroups, + getNestedLabwareInfo, +} from '/app/transformations/commands' +import { getProtocolModulesInfo } from '/app/transformations/analysis' import { useNotifyDeckConfigurationQuery } from '/app/resources/deck_configuration' -import { getProtocolModulesInfo } from '../../../Devices/ProtocolRun/utils/getProtocolModulesInfo' -import { getNestedLabwareInfo } from '../../../Devices/ProtocolRun/SetupLabware/getNestedLabwareInfo' import { LabwareStackModal } from '../../../Devices/ProtocolRun/SetupLabware/LabwareStackModal' -import { useMostRecentCompletedAnalysis } from '../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' import { getAttachedProtocolModuleMatches } from '../ProtocolSetupModulesAndDeck/utils' import { LabwareMapView } from './LabwareMapView' import { SingleLabwareModal } from './SingleLabwareModal' @@ -57,9 +59,11 @@ import type { RunTimeCommand, } from '@opentrons/shared-data' import type { HeaterShakerModule, Modules } from '@opentrons/api-client' -import type { LabwareSetupItem } from '/app/transformations/commands' +import type { + LabwareSetupItem, + NestedLabwareInfo, +} from '/app/transformations/commands' import type { SetupScreens } from '../types' -import type { NestedLabwareInfo } from '../../../Devices/ProtocolRun/SetupLabware/getNestedLabwareInfo' import type { AttachedProtocolModuleMatch } from '../ProtocolSetupModulesAndDeck/utils' const MODULE_REFETCH_INTERVAL_MS = 5000 diff --git a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLiquids/LiquidDetails.tsx b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLiquids/LiquidDetails.tsx index 0b1651ad0ae..70714d8ca9e 100644 --- a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLiquids/LiquidDetails.tsx +++ b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLiquids/LiquidDetails.tsx @@ -15,8 +15,8 @@ import { } from '@opentrons/components' import { MICRO_LITERS } from '@opentrons/shared-data' import { LiquidsLabwareDetailsModal } from '../../../Devices/ProtocolRun/SetupLiquids/LiquidsLabwareDetailsModal' -import { getLocationInfoNames } from '../../../Devices/ProtocolRun/utils/getLocationInfoNames' -import { getVolumePerWell } from '../../../Devices/ProtocolRun/SetupLiquids/utils' +import { getLocationInfoNames } from '/app/transformations/commands' +import { getVolumePerWell } from '/app/transformations/analysis' import type { LabwareByLiquidId, diff --git a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLiquids/__tests__/LiquidDetails.test.tsx b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLiquids/__tests__/LiquidDetails.test.tsx index 0100a7a27da..5f64c95b6eb 100644 --- a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLiquids/__tests__/LiquidDetails.test.tsx +++ b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLiquids/__tests__/LiquidDetails.test.tsx @@ -5,8 +5,8 @@ import { describe, it, beforeEach, vi } from 'vitest' import { renderWithProviders } from '/app/__testing-utils__' import { i18n } from '/app/i18n' import { RUN_ID_1 } from '/app/resources/runs/__fixtures__' -import { getLocationInfoNames } from '../../../../Devices/ProtocolRun/utils/getLocationInfoNames' -import { getVolumePerWell } from '../../../../Devices/ProtocolRun/SetupLiquids/utils' +import { getLocationInfoNames } from '/app/transformations/commands' +import { getVolumePerWell } from '/app/transformations/analysis' import { LiquidDetails } from '../LiquidDetails' import { LiquidsLabwareDetailsModal } from '../../../../Devices/ProtocolRun/SetupLiquids/LiquidsLabwareDetailsModal' import { @@ -15,8 +15,8 @@ import { } from '../fixtures' import type { CompletedProtocolAnalysis } from '@opentrons/shared-data' -vi.mock('../../../../Devices/ProtocolRun/SetupLiquids/utils') -vi.mock('../../../../Devices/ProtocolRun/utils/getLocationInfoNames') +vi.mock('/app/transformations/analysis') +vi.mock('/app/transformations/commands') vi.mock( '../../../../Devices/ProtocolRun/SetupLiquids/LiquidsLabwareDetailsModal' ) diff --git a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLiquids/__tests__/ProtocolSetupLiquids.test.tsx b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLiquids/__tests__/ProtocolSetupLiquids.test.tsx index 15a705119f5..0dbf83a7c8d 100644 --- a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLiquids/__tests__/ProtocolSetupLiquids.test.tsx +++ b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLiquids/__tests__/ProtocolSetupLiquids.test.tsx @@ -10,8 +10,8 @@ import { import { renderWithProviders } from '/app/__testing-utils__' import { i18n } from '/app/i18n' import { RUN_ID_1 } from '/app/resources/runs/__fixtures__' -import { getTotalVolumePerLiquidId } from '../../../../Devices/ProtocolRun/SetupLiquids/utils' -import { useMostRecentCompletedAnalysis } from '../../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { getTotalVolumePerLiquidId } from '/app/transformations/analysis' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' import { LiquidDetails } from '../LiquidDetails' import { MOCK_LABWARE_INFO_BY_LIQUID_ID, @@ -22,10 +22,10 @@ import { ProtocolSetupLiquids } from '..' import type * as SharedData from '@opentrons/shared-data' -vi.mock('../../../../Devices/ProtocolRun/SetupLiquids/utils') +vi.mock('/app/transformations/analysis') vi.mock('/app/atoms/buttons') vi.mock('../LiquidDetails') -vi.mock('../../../../LabwarePositionCheck/useMostRecentCompletedAnalysis') +vi.mock('/app/resources/runs') vi.mock('@opentrons/shared-data', async importOriginal => { const actualSharedData = await importOriginal() return { diff --git a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLiquids/index.tsx b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLiquids/index.tsx index f271d312716..551b7e716cd 100644 --- a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLiquids/index.tsx +++ b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupLiquids/index.tsx @@ -22,8 +22,8 @@ import { import { ODDBackButton } from '/app/molecules/ODDBackButton' import { SmallButton } from '/app/atoms/buttons' -import { useMostRecentCompletedAnalysis } from '../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' -import { getTotalVolumePerLiquidId } from '../../../Devices/ProtocolRun/SetupLiquids/utils' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' +import { getTotalVolumePerLiquidId } from '/app/transformations/analysis' import { LiquidDetails } from './LiquidDetails' import type { ParsedLiquid, RunTimeCommand } from '@opentrons/shared-data' import type { SetupScreens } from '../types' diff --git a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/ModuleTable.tsx b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/ModuleTable.tsx index 0e3e442a7dd..e145d5538c2 100644 --- a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/ModuleTable.tsx +++ b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/ModuleTable.tsx @@ -26,20 +26,22 @@ import { } from '@opentrons/shared-data' import { SmallButton } from '/app/atoms/buttons' -import { getModulePrepCommands } from '../../../Devices/getModulePrepCommands' -import { getModuleTooHot } from '../../../Devices/getModuleTooHot' -import { useRunCalibrationStatus } from '../../../Devices/hooks' +import { getModulePrepCommands } from '/app/local-resources/modules' +import { getModuleTooHot } from '/app/transformations/modules' import { LocationConflictModal } from '../../../Devices/ProtocolRun/SetupModuleAndDeck/LocationConflictModal' import { ModuleWizardFlows } from '../../../ModuleWizardFlows' import { useToaster } from '../../../ToasterOven' import { getLocalRobot } from '/app/redux/discovery' -import { useChainLiveCommands } from '/app/resources/runs' +import { + useChainLiveCommands, + useRunCalibrationStatus, +} from '/app/resources/runs' import { useNotifyDeckConfigurationQuery } from '/app/resources/deck_configuration' import type { CommandData } from '@opentrons/api-client' import type { CutoutConfig, DeckDefinition } from '@opentrons/shared-data' -import type { ModulePrepCommandsType } from '../../../Devices/getModulePrepCommands' -import type { ProtocolCalibrationStatus } from '../../../Devices/hooks' +import type { ModulePrepCommandsType } from '/app/local-resources/modules' +import type { ProtocolCalibrationStatus } from '/app/resources/runs' import type { AttachedProtocolModuleMatch } from './utils' const DECK_CONFIG_REFETCH_INTERVAL = 5000 diff --git a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/ModulesAndDeckMapView.tsx b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/ModulesAndDeckMapView.tsx index 355da533ba1..193005f0921 100644 --- a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/ModulesAndDeckMapView.tsx +++ b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/ModulesAndDeckMapView.tsx @@ -7,7 +7,7 @@ import { } from '@opentrons/shared-data' import { ModuleInfo } from '../../../Devices/ModuleInfo' -import { getStandardDeckViewLayerBlockList } from '../../../Devices/ProtocolRun/utils/getStandardDeckViewLayerBlockList' +import { getStandardDeckViewLayerBlockList } from '/app/local-resources/deck_configuration' import type { CompletedProtocolAnalysis } from '@opentrons/shared-data' import type { AttachedProtocolModuleMatch } from './utils' diff --git a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/ProtocolSetupModulesAndDeck.tsx b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/ProtocolSetupModulesAndDeck.tsx index 0b30a532c30..a3efba55995 100644 --- a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/ProtocolSetupModulesAndDeck.tsx +++ b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/ProtocolSetupModulesAndDeck.tsx @@ -20,10 +20,12 @@ import { getTopPortalEl } from '../../../../App/portal' import { FloatingActionButton } from '/app/atoms/buttons' import { InlineNotification } from '/app/atoms/InlineNotification' import { ChildNavigation } from '/app/organisms/ChildNavigation' -import { useAttachedModules } from '/app/organisms/Devices/hooks' -import { getProtocolModulesInfo } from '/app/organisms/Devices/ProtocolRun/utils/getProtocolModulesInfo' -import { useMostRecentCompletedAnalysis } from '/app/organisms/LabwarePositionCheck/useMostRecentCompletedAnalysis' -import { useRunStatus } from '/app/resources/runs' +import { useAttachedModules } from '/app/resources/modules' +import { getProtocolModulesInfo } from '/app/transformations/analysis' +import { + useRunStatus, + useMostRecentCompletedAnalysis, +} from '/app/resources/runs' import { getAttachedProtocolModuleMatches, getUnmatchedModulesForProtocol, diff --git a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/__tests__/ModulesAndDeckMapView.test.tsx b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/__tests__/ModulesAndDeckMapView.test.tsx index 0fb9b90fd97..66bb4ae8329 100644 --- a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/__tests__/ModulesAndDeckMapView.test.tsx +++ b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/__tests__/ModulesAndDeckMapView.test.tsx @@ -16,10 +16,9 @@ vi.mock('@opentrons/components/src/hardware-sim/BaseDeck') vi.mock('@opentrons/api-client') vi.mock('@opentrons/shared-data/js/helpers/getSimplestFlexDeckConfig') vi.mock('/app/redux/config') -vi.mock('../../../../Devices/hooks') vi.mock('/app/resources/deck_configuration/utils') vi.mock('../../../../Devices/ModuleInfo') -vi.mock('../../../../Devices/ProtocolRun/utils/getLabwareRenderInfo') +vi.mock('/app/transformations/analysis') const mockRunId = 'mockRunId' const PROTOCOL_ANALYSIS = { diff --git a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/__tests__/ProtocolSetupModulesAndDeck.test.tsx b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/__tests__/ProtocolSetupModulesAndDeck.test.tsx index f59e0df775b..9184271f13d 100644 --- a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/__tests__/ProtocolSetupModulesAndDeck.test.tsx +++ b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/__tests__/ProtocolSetupModulesAndDeck.test.tsx @@ -13,14 +13,15 @@ import { import { renderWithProviders } from '/app/__testing-utils__' import { i18n } from '/app/i18n' -import { useChainLiveCommands, useRunStatus } from '/app/resources/runs' -import { mockRobotSideAnalysis } from '/app/molecules/Command/__fixtures__' import { - useAttachedModules, + useChainLiveCommands, + useRunStatus, + useMostRecentCompletedAnalysis, useRunCalibrationStatus, -} from '../../../../Devices/hooks' -import { useMostRecentCompletedAnalysis } from '../../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' -import { getProtocolModulesInfo } from '../../../../Devices/ProtocolRun/utils/getProtocolModulesInfo' +} from '/app/resources/runs' +import { mockRobotSideAnalysis } from '/app/molecules/Command/__fixtures__' +import { useAttachedModules } from '/app/resources/modules' +import { getProtocolModulesInfo } from '/app/transformations/analysis' import { mockApiHeaterShaker } from '/app/redux/modules/__fixtures__' import { mockProtocolModuleInfo } from '../../ProtocolSetupInstruments/__fixtures__' import { getLocalRobot } from '/app/redux/discovery' @@ -41,11 +42,10 @@ import type { CutoutConfig, DeckConfiguration } from '@opentrons/shared-data' import type { UseQueryResult } from 'react-query' vi.mock('/app/resources/runs') +vi.mock('/app/resources/modules') vi.mock('/app/redux/discovery') -vi.mock('/app/organisms/Devices/hooks') vi.mock('/app/resources/deck_configuration') -vi.mock('/app/organisms/LabwarePositionCheck/useMostRecentCompletedAnalysis') -vi.mock('/app/organisms/Devices/ProtocolRun/utils/getProtocolModulesInfo') +vi.mock('/app/transformations/analysis') vi.mock('../utils') vi.mock('../SetupInstructionsModal') vi.mock('../../../../ModuleWizardFlows') diff --git a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/utils.ts b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/utils.ts index 6d98c8edd11..e272aa5994d 100644 --- a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/utils.ts +++ b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/utils.ts @@ -10,7 +10,7 @@ import { } from '@opentrons/shared-data' import type { DeckConfiguration, RobotType } from '@opentrons/shared-data' -import type { ProtocolModuleInfo } from '../../../Devices/ProtocolRun/utils/getProtocolModulesInfo' +import type { ProtocolModuleInfo } from '/app/transformations/analysis' import type { AttachedModule } from '/app/redux/modules/types' export type AttachedProtocolModuleMatch = ProtocolModuleInfo & { diff --git a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupOffsets/index.tsx b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupOffsets/index.tsx index a66e6dd8a93..43f8291b728 100644 --- a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupOffsets/index.tsx +++ b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupOffsets/index.tsx @@ -16,11 +16,13 @@ import { useToaster } from '/app/organisms/ToasterOven' import { ODDBackButton } from '/app/molecules/ODDBackButton' import { FloatingActionButton, SmallButton } from '/app/atoms/buttons' import type { SetupScreens } from '../types' -import { useMostRecentCompletedAnalysis } from '../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' import { TerseOffsetTable } from '/app/organisms/LabwarePositionCheck/ResultsSummary' import { getLabwareDefinitionsFromCommands } from '/app/molecules/Command/utils/getLabwareDefinitionsFromCommands' -import { useNotifyRunQuery } from '/app/resources/runs' -import { getLatestCurrentOffsets } from '/app/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/utils' +import { + useNotifyRunQuery, + useMostRecentCompletedAnalysis, +} from '/app/resources/runs' +import { getLatestCurrentOffsets } from '/app/transformations/runs' export interface ProtocolSetupOffsetsProps { runId: string diff --git a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupParameters/ViewOnlyParameters.tsx b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupParameters/ViewOnlyParameters.tsx index c8c892902a4..d3ee60eb0a6 100644 --- a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupParameters/ViewOnlyParameters.tsx +++ b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupParameters/ViewOnlyParameters.tsx @@ -18,7 +18,7 @@ import { LegacyStyledText, TYPOGRAPHY, } from '@opentrons/components' -import { useMostRecentCompletedAnalysis } from '/app/organisms/LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' import { ChildNavigation } from '/app/organisms/ChildNavigation' import { useToaster } from '/app/organisms/ToasterOven' diff --git a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupParameters/__tests__/ProtocolSetupParameters.test.tsx b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupParameters/__tests__/ProtocolSetupParameters.test.tsx index 0906ae6ae72..8561c694041 100644 --- a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupParameters/__tests__/ProtocolSetupParameters.test.tsx +++ b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupParameters/__tests__/ProtocolSetupParameters.test.tsx @@ -31,7 +31,7 @@ vi.mock('../ChooseCsvFile') vi.mock('/app/redux/config') vi.mock('/app/organisms/ToasterOven') vi.mock('@opentrons/react-api-client') -vi.mock('/app/organisms/LabwarePositionCheck/useMostRecentCompletedAnalysis') +vi.mock('/app/resources/runs') vi.mock('react-router-dom', async importOriginal => { const reactRouterDom = await importOriginal() return { diff --git a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupParameters/__tests__/ViewOnlyParameters.test.tsx b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupParameters/__tests__/ViewOnlyParameters.test.tsx index b360ed71251..73eaa7bf1e3 100644 --- a/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupParameters/__tests__/ViewOnlyParameters.test.tsx +++ b/app/src/organisms/ODD/ProtocolSetup/ProtocolSetupParameters/__tests__/ViewOnlyParameters.test.tsx @@ -4,12 +4,12 @@ import { it, describe, beforeEach, vi, expect } from 'vitest' import { fireEvent, screen } from '@testing-library/react' import { i18n } from '/app/i18n' import { renderWithProviders } from '/app/__testing-utils__' -import { useMostRecentCompletedAnalysis } from '/app/organisms/LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' import { useToaster } from '/app/organisms/ToasterOven' import { mockRunTimeParameterData } from '../../__fixtures__' import { ViewOnlyParameters } from '../ViewOnlyParameters' -vi.mock('/app/organisms/LabwarePositionCheck/useMostRecentCompletedAnalysis') +vi.mock('/app/resources/runs') vi.mock('/app/organisms/ToasterOven') const RUN_ID = 'mockId' const render = (props: React.ComponentProps) => { diff --git a/app/src/organisms/PipetteWizardFlows/BeforeBeginning.tsx b/app/src/organisms/PipetteWizardFlows/BeforeBeginning.tsx index a0147b440c7..99df19fbecf 100644 --- a/app/src/organisms/PipetteWizardFlows/BeforeBeginning.tsx +++ b/app/src/organisms/PipetteWizardFlows/BeforeBeginning.tsx @@ -21,7 +21,7 @@ import { } from '/app/molecules/SimpleWizardBody' import { GenericWizardTile } from '/app/molecules/GenericWizardTile' import { WizardRequiredEquipmentList } from '/app/molecules/WizardRequiredEquipmentList' -import { usePipetteNameSpecs } from '/app/resources/instruments/hooks' +import { usePipetteNameSpecs } from '/app/local-resources/instruments' import { CALIBRATION_PROBE, FLOWS, diff --git a/app/src/organisms/PipetteWizardFlows/Results.tsx b/app/src/organisms/PipetteWizardFlows/Results.tsx index 3be1f3a92b3..96ed9098ac9 100644 --- a/app/src/organisms/PipetteWizardFlows/Results.tsx +++ b/app/src/organisms/PipetteWizardFlows/Results.tsx @@ -18,7 +18,7 @@ import { SimpleWizardBody, SimpleWizardInProgressBody, } from '/app/molecules/SimpleWizardBody' -import { usePipetteNameSpecs } from '/app/resources/instruments/hooks' +import { usePipetteNameSpecs } from '/app/local-resources/instruments' import { CheckPipetteButton } from './CheckPipetteButton' import { FLOWS } from './constants' diff --git a/app/src/organisms/QuickTransferFlow/SelectPipette.tsx b/app/src/organisms/QuickTransferFlow/SelectPipette.tsx index 18831b06dd3..9e5d0511b0f 100644 --- a/app/src/organisms/QuickTransferFlow/SelectPipette.tsx +++ b/app/src/organisms/QuickTransferFlow/SelectPipette.tsx @@ -10,7 +10,7 @@ import { } from '@opentrons/components' import { useInstrumentsQuery } from '@opentrons/react-api-client' import { RIGHT, LEFT } from '@opentrons/shared-data' -import { usePipetteSpecsV2 } from '/app/resources/instruments/hooks' +import { usePipetteSpecsV2 } from '/app/local-resources/instruments' import { ChildNavigation } from '../ChildNavigation' import type { PipetteData, Mount } from '@opentrons/api-client' diff --git a/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/ModuleCalibrationOverflowMenu.tsx b/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/ModuleCalibrationOverflowMenu.tsx index 79aa70395ef..03cb53b650a 100644 --- a/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/ModuleCalibrationOverflowMenu.tsx +++ b/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/ModuleCalibrationOverflowMenu.tsx @@ -19,9 +19,9 @@ import { import { useChainLiveCommands } from '/app/resources/runs' import { useRunStatuses } from '/app/organisms/Devices/hooks' -import { getModulePrepCommands } from '/app/organisms/Devices/getModulePrepCommands' +import { getModulePrepCommands } from '/app/local-resources/modules' import { ModuleWizardFlows } from '/app/organisms/ModuleWizardFlows' -import { getModuleTooHot } from '/app/organisms/Devices/getModuleTooHot' +import { getModuleTooHot } from '/app/transformations/modules' import { useIsEstopNotDisengaged } from '/app/resources/devices/hooks/useIsEstopNotDisengaged' import type { AttachedModule } from '/app/redux/modules/types' diff --git a/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/PipetteOffsetCalibrationItems.tsx b/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/PipetteOffsetCalibrationItems.tsx index f6bba1f6921..09d59325975 100644 --- a/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/PipetteOffsetCalibrationItems.tsx +++ b/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/PipetteOffsetCalibrationItems.tsx @@ -17,10 +17,8 @@ import { OverflowMenu } from './OverflowMenu' import { formatLastCalibrated, getDisplayNameForTipRack } from './utils' import { getCustomLabwareDefinitions } from '/app/redux/custom-labware' import { LEFT } from '/app/redux/pipettes' -import { - useAttachedPipettes, - useAttachedPipettesFromInstrumentsQuery, -} from '/app/organisms/Devices/hooks' +import { useAttachedPipettesFromInstrumentsQuery } from '/app/organisms/Devices/hooks' +import { useAttachedPipettes } from '/app/resources/instruments' import { useIsFlex } from '/app/redux-resources/robots' import type { State } from '/app/redux/types' diff --git a/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/TipLengthCalibrationItems.tsx b/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/TipLengthCalibrationItems.tsx index 5734e7180c3..88b0e874003 100644 --- a/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/TipLengthCalibrationItems.tsx +++ b/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/TipLengthCalibrationItems.tsx @@ -11,7 +11,7 @@ import { TYPOGRAPHY, } from '@opentrons/components' -import { useAttachedPipettes } from '/app/organisms/Devices/hooks' +import { useAttachedPipettes } from '/app/resources/instruments' import { getCustomLabwareDefinitions } from '/app/redux/custom-labware' import { OverflowMenu } from './OverflowMenu' import { formatLastCalibrated, getDisplayNameForTipRack } from './utils' diff --git a/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/__tests__/PipetteOffsetCalibrationItems.test.tsx b/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/__tests__/PipetteOffsetCalibrationItems.test.tsx index 57e528d1554..09fe5652db1 100644 --- a/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/__tests__/PipetteOffsetCalibrationItems.test.tsx +++ b/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/__tests__/PipetteOffsetCalibrationItems.test.tsx @@ -9,10 +9,8 @@ import { mockAttachedPipette, mockAttachedPipetteInformation, } from '/app/redux/pipettes/__fixtures__' -import { - useAttachedPipettes, - useAttachedPipettesFromInstrumentsQuery, -} from '/app/organisms/Devices/hooks' +import { useAttachedPipettesFromInstrumentsQuery } from '/app/organisms/Devices/hooks' +import { useAttachedPipettes } from '/app/resources/instruments' import { useIsFlex } from '/app/redux-resources/robots' import { renderWithProviders } from '/app/__testing-utils__' import { PipetteOffsetCalibrationItems } from '../PipetteOffsetCalibrationItems' @@ -64,6 +62,7 @@ vi.mock('/app/redux/discovery') vi.mock('/app/assets/labware/findLabware') vi.mock('/app/organisms/Devices/hooks') vi.mock('/app/redux-resources/robots') +vi.mock('/app/resources/instruments') vi.mock('../OverflowMenu') const mockAttachedPipettes: AttachedPipettesByMount = { diff --git a/app/src/organisms/RobotSettingsCalibration/CalibrationHealthCheck.tsx b/app/src/organisms/RobotSettingsCalibration/CalibrationHealthCheck.tsx index 15592842d02..275fe64ecfe 100644 --- a/app/src/organisms/RobotSettingsCalibration/CalibrationHealthCheck.tsx +++ b/app/src/organisms/RobotSettingsCalibration/CalibrationHealthCheck.tsx @@ -27,12 +27,12 @@ import * as Calibration from '/app/redux/calibration' import * as Config from '/app/redux/config' import * as Pipettes from '/app/redux/pipettes' import * as Sessions from '/app/redux/sessions' +import { useRunStatuses } from '/app/organisms/Devices/hooks' import { - useDeckCalibrationStatus, useAttachedPipettes, useAttachedPipetteCalibrations, - useRunStatuses, -} from '/app/organisms/Devices/hooks' +} from '/app/resources/instruments' +import { useDeckCalibrationStatus } from '/app/resources/calibration' import type { AttachedPipettesByMount, diff --git a/app/src/organisms/RobotSettingsCalibration/RobotSettingsPipetteOffsetCalibration.tsx b/app/src/organisms/RobotSettingsCalibration/RobotSettingsPipetteOffsetCalibration.tsx index 78a9ee9db51..8fb8da477ff 100644 --- a/app/src/organisms/RobotSettingsCalibration/RobotSettingsPipetteOffsetCalibration.tsx +++ b/app/src/organisms/RobotSettingsCalibration/RobotSettingsPipetteOffsetCalibration.tsx @@ -15,7 +15,7 @@ import { usePipetteOffsetCalibrations, } from '../Devices/hooks' import { useIsFlex } from '/app/redux-resources/robots' -import { getShowPipetteCalibrationWarning } from '../Devices/utils' +import { getShowPipetteCalibrationWarning } from '/app/transformations/instruments' import { PipetteRecalibrationWarning } from '../Devices/PipetteCard/PipetteRecalibrationWarning' import { PipetteOffsetCalibrationItems } from './CalibrationDetails/PipetteOffsetCalibrationItems' diff --git a/app/src/organisms/RobotSettingsCalibration/RobotSettingsTipLengthCalibration.tsx b/app/src/organisms/RobotSettingsCalibration/RobotSettingsTipLengthCalibration.tsx index 362bd05ed28..effb3d6290d 100644 --- a/app/src/organisms/RobotSettingsCalibration/RobotSettingsTipLengthCalibration.tsx +++ b/app/src/organisms/RobotSettingsCalibration/RobotSettingsTipLengthCalibration.tsx @@ -11,7 +11,7 @@ import { } from '@opentrons/components' import { useAllTipLengthCalibrationsQuery } from '@opentrons/react-api-client' -import { useAttachedPipettes } from '/app/organisms/Devices/hooks' +import { useAttachedPipettes } from '/app/resources/instruments' import { getDefaultTiprackDefForPipetteName } from '../Devices/constants' import { TipLengthCalibrationItems } from './CalibrationDetails/TipLengthCalibrationItems' diff --git a/app/src/organisms/RobotSettingsCalibration/__tests__/CalibrationHealthCheck.test.tsx b/app/src/organisms/RobotSettingsCalibration/__tests__/CalibrationHealthCheck.test.tsx index 2fafaf3acce..f00ea136283 100644 --- a/app/src/organisms/RobotSettingsCalibration/__tests__/CalibrationHealthCheck.test.tsx +++ b/app/src/organisms/RobotSettingsCalibration/__tests__/CalibrationHealthCheck.test.tsx @@ -19,11 +19,12 @@ import { mockTipLengthCalibration2, } from '/app/redux/calibration/tip-length/__fixtures__' import { mockAttachedPipette } from '/app/redux/pipettes/__fixtures__' +import { useRunStatuses } from '/app/organisms/Devices/hooks' + import { useAttachedPipettes, useAttachedPipetteCalibrations, - useRunStatuses, -} from '/app/organisms/Devices/hooks' +} from '/app/resources/instruments' import { CalibrationHealthCheck } from '../CalibrationHealthCheck' @@ -36,6 +37,8 @@ vi.mock('/app/redux/analytics') vi.mock('/app/redux/config') vi.mock('/app/redux/pipettes') vi.mock('/app/organisms/Devices/hooks') +vi.mock('/app/resources/instruments') +vi.mock('/app/redux-resources/robots') const mockAttachedPipettes: AttachedPipettesByMount = { left: mockAttachedPipette, diff --git a/app/src/organisms/RobotSettingsCalibration/__tests__/RobotSettingsCalibration.test.tsx b/app/src/organisms/RobotSettingsCalibration/__tests__/RobotSettingsCalibration.test.tsx index 03ca54a3d48..fa37b4d78b7 100644 --- a/app/src/organisms/RobotSettingsCalibration/__tests__/RobotSettingsCalibration.test.tsx +++ b/app/src/organisms/RobotSettingsCalibration/__tests__/RobotSettingsCalibration.test.tsx @@ -21,10 +21,10 @@ import { } from '/app/redux/pipettes/__fixtures__' import { usePipetteOffsetCalibrations, - useAttachedPipettes, useRunStatuses, useAttachedPipettesFromInstrumentsQuery, } from '/app/organisms/Devices/hooks' +import { useAttachedPipettes } from '/app/resources/instruments' import { useRobot, useIsFlex } from '/app/redux-resources/robots' import { CalibrationDataDownload } from '../CalibrationDataDownload' @@ -50,6 +50,7 @@ vi.mock('/app/redux/config') vi.mock('/app/redux/sessions/selectors') vi.mock('/app/redux/robot-api/selectors') vi.mock('/app/redux-resources/robots') +vi.mock('/app/resources/instruments') vi.mock('/app/organisms/Devices/hooks') vi.mock('../CalibrationDataDownload') vi.mock('../CalibrationHealthCheck') diff --git a/app/src/organisms/RobotSettingsCalibration/__tests__/RobotSettingsDeckCalibration.test.tsx b/app/src/organisms/RobotSettingsCalibration/__tests__/RobotSettingsDeckCalibration.test.tsx index 7f0c90b02a0..a51101bd50e 100644 --- a/app/src/organisms/RobotSettingsCalibration/__tests__/RobotSettingsDeckCalibration.test.tsx +++ b/app/src/organisms/RobotSettingsCalibration/__tests__/RobotSettingsDeckCalibration.test.tsx @@ -10,10 +10,8 @@ import { } from '/app/redux/calibration/__fixtures__' import { mockConnectableRobot } from '/app/redux/discovery/__fixtures__' import { mockAttachedPipette } from '/app/redux/pipettes/__fixtures__' -import { - useDeckCalibrationData, - useAttachedPipettes, -} from '/app/organisms/Devices/hooks' +import { useDeckCalibrationData } from '/app/organisms/Devices/hooks' +import { useAttachedPipettes } from '/app/resources/instruments' import { useRobot } from '/app/redux-resources/robots' import { renderWithProviders } from '/app/__testing-utils__' @@ -25,6 +23,7 @@ vi.mock('/app/organisms/CalibrationStatusCard') vi.mock('/app/redux/robot-api/selectors') vi.mock('/app/redux-resources/robots') vi.mock('/app/organisms/Devices/hooks') +vi.mock('/app/resources/instruments') const mockAttachedPipettes: AttachedPipettesByMount = { left: mockAttachedPipette, diff --git a/app/src/organisms/RobotSettingsCalibration/__tests__/RobotSettingsTipLengthCalibration.test.tsx b/app/src/organisms/RobotSettingsCalibration/__tests__/RobotSettingsTipLengthCalibration.test.tsx index 0549050d7e1..0808a7f2262 100644 --- a/app/src/organisms/RobotSettingsCalibration/__tests__/RobotSettingsTipLengthCalibration.test.tsx +++ b/app/src/organisms/RobotSettingsCalibration/__tests__/RobotSettingsTipLengthCalibration.test.tsx @@ -10,10 +10,8 @@ import { mockTipLengthCalibration3, } from '/app/redux/calibration/tip-length/__fixtures__' import { mockAttachedPipette } from '/app/redux/pipettes/__fixtures__' -import { - useAttachedPipettes, - useTipLengthCalibrations, -} from '/app/organisms/Devices/hooks' +import { useTipLengthCalibrations } from '/app/organisms/Devices/hooks' +import { useAttachedPipettes } from '/app/resources/instruments' import { RobotSettingsTipLengthCalibration } from '../RobotSettingsTipLengthCalibration' import { TipLengthCalibrationItems } from '../CalibrationDetails/TipLengthCalibrationItems' @@ -24,6 +22,7 @@ import type { AttachedPipettesByMount } from '/app/redux/pipettes/types' vi.mock('/app/redux/config') vi.mock('/app/organisms/Devices/hooks') vi.mock('../CalibrationDetails/TipLengthCalibrationItems') +vi.mock('/app/resources/instruments') const mockFormattedPipetteOffsetCalibrations: FormattedPipetteOffsetCalibration[] = [] diff --git a/app/src/organisms/RunPreview/index.tsx b/app/src/organisms/RunPreview/index.tsx index 6cb9b50e052..5e379111bd5 100644 --- a/app/src/organisms/RunPreview/index.tsx +++ b/app/src/organisms/RunPreview/index.tsx @@ -21,11 +21,11 @@ import { TYPOGRAPHY, } from '@opentrons/components' -import { useMostRecentCompletedAnalysis } from '../LabwarePositionCheck/useMostRecentCompletedAnalysis' import { useNotifyAllCommandsAsPreSerializedList, useNotifyRunQuery, useRunStatus, + useMostRecentCompletedAnalysis, } from '/app/resources/runs' import { CommandText, CommandIcon } from '/app/molecules/Command' import { Divider } from '/app/atoms/structure' diff --git a/app/src/organisms/RunProgressMeter/__tests__/RunProgressMeter.test.tsx b/app/src/organisms/RunProgressMeter/__tests__/RunProgressMeter.test.tsx index 143a1f3afb4..173b4968714 100644 --- a/app/src/organisms/RunProgressMeter/__tests__/RunProgressMeter.test.tsx +++ b/app/src/organisms/RunProgressMeter/__tests__/RunProgressMeter.test.tsx @@ -19,11 +19,11 @@ import { } from '../../InterventionModal' import { ProgressBar } from '/app/atoms/ProgressBar' import { useRunControls } from '../../RunTimeControl/hooks' -import { useMostRecentCompletedAnalysis } from '../../LabwarePositionCheck/useMostRecentCompletedAnalysis' import { useNotifyRunQuery, useNotifyAllCommandsQuery, useRunStatus, + useMostRecentCompletedAnalysis, } from '/app/resources/runs' import { useDownloadRunLog } from '../../Devices/hooks' import { @@ -48,7 +48,6 @@ vi.mock('@opentrons/react-api-client', async importOriginal => { } }) vi.mock('../../RunTimeControl/hooks') -vi.mock('../../LabwarePositionCheck/useMostRecentCompletedAnalysis') vi.mock('/app/resources/runs') vi.mock('../../Devices/hooks') vi.mock('/app/atoms/ProgressBar') diff --git a/app/src/organisms/RunProgressMeter/index.tsx b/app/src/organisms/RunProgressMeter/index.tsx index cd5ca1c3b24..de94bded5de 100644 --- a/app/src/organisms/RunProgressMeter/index.tsx +++ b/app/src/organisms/RunProgressMeter/index.tsx @@ -29,7 +29,6 @@ import { RUN_STATUS_RUNNING, } from '@opentrons/api-client' -import { useMostRecentCompletedAnalysis } from '../LabwarePositionCheck/useMostRecentCompletedAnalysis' import { getModalPortalEl } from '../../App/portal' import { useRunControls } from '../RunTimeControl/hooks' import { InterventionModal, useInterventionModal } from '../InterventionModal' @@ -40,6 +39,7 @@ import { useNotifyRunQuery, useNotifyAllCommandsQuery, useRunStatus, + useMostRecentCompletedAnalysis, } from '/app/resources/runs' import { useRobotType } from '/app/redux-resources/robots' import { useRunningStepCounts } from '/app/resources/protocols/hooks' diff --git a/app/src/organisms/RunTimeControl/hooks.ts b/app/src/organisms/RunTimeControl/hooks.ts index 5e519baa2b0..d2ddfaf4744 100644 --- a/app/src/organisms/RunTimeControl/hooks.ts +++ b/app/src/organisms/RunTimeControl/hooks.ts @@ -6,8 +6,8 @@ import { useRunStatus, useCloneRun, DEFAULT_RUN_QUERY_REFETCH_INTERVAL, + useMostRecentCompletedAnalysis, } from '/app/resources/runs' -import { useMostRecentCompletedAnalysis } from '../LabwarePositionCheck/useMostRecentCompletedAnalysis' import type { UseQueryOptions } from 'react-query' import type { RunStatus, Run, RunData } from '@opentrons/api-client' diff --git a/app/src/pages/Desktop/Devices/CalibrationDashboard/__tests__/CalibrationDashboard.test.tsx b/app/src/pages/Desktop/Devices/CalibrationDashboard/__tests__/CalibrationDashboard.test.tsx index c8e4935bf21..d2212bad45c 100644 --- a/app/src/pages/Desktop/Devices/CalibrationDashboard/__tests__/CalibrationDashboard.test.tsx +++ b/app/src/pages/Desktop/Devices/CalibrationDashboard/__tests__/CalibrationDashboard.test.tsx @@ -7,16 +7,14 @@ import { renderWithProviders } from '/app/__testing-utils__' import { i18n } from '/app/i18n' import { CalibrationDashboard } from '..' -import { - useCalibrationTaskList, - useAttachedPipettes, -} from '/app/organisms/Devices/hooks' +import { useCalibrationTaskList } from '/app/organisms/Devices/hooks' import { useDashboardCalibratePipOffset } from '../hooks/useDashboardCalibratePipOffset' import { useDashboardCalibrateTipLength } from '../hooks/useDashboardCalibrateTipLength' import { useDashboardCalibrateDeck } from '../hooks/useDashboardCalibrateDeck' import { expectedTaskList } from '/app/organisms/Devices/hooks/__fixtures__/taskListFixtures' import { mockLeftProtoPipette } from '/app/redux/pipettes/__fixtures__' import { useNotifyAllRunsQuery } from '/app/resources/runs' +import { useAttachedPipettes } from '/app/resources/instruments' vi.mock('/app/redux-resources/robots') vi.mock('/app/organisms/Devices/hooks') @@ -24,6 +22,7 @@ vi.mock('../hooks/useDashboardCalibratePipOffset') vi.mock('../hooks/useDashboardCalibrateTipLength') vi.mock('../hooks/useDashboardCalibrateDeck') vi.mock('/app/resources/runs') +vi.mock('/app/resources/instruments') const render = (path = '/') => { return renderWithProviders( diff --git a/app/src/pages/Desktop/Devices/ProtocolRunDetails/__tests__/ProtocolRunDetails.test.tsx b/app/src/pages/Desktop/Devices/ProtocolRunDetails/__tests__/ProtocolRunDetails.test.tsx index 8c6e304cf42..adf00782cf3 100644 --- a/app/src/pages/Desktop/Devices/ProtocolRunDetails/__tests__/ProtocolRunDetails.test.tsx +++ b/app/src/pages/Desktop/Devices/ProtocolRunDetails/__tests__/ProtocolRunDetails.test.tsx @@ -13,20 +13,21 @@ import { useSyncRobotClock, useRunHasStarted, } from '/app/organisms/Devices/hooks' -import { useMostRecentCompletedAnalysis } from '/app/organisms/LabwarePositionCheck/useMostRecentCompletedAnalysis' import { ProtocolRunHeader } from '/app/organisms/Devices/ProtocolRun/ProtocolRunHeader' import { ProtocolRunModuleControls } from '/app/organisms/Devices/ProtocolRun/ProtocolRunModuleControls' import { ProtocolRunSetup } from '/app/organisms/Devices/ProtocolRun/ProtocolRunSetup' import { RunPreviewComponent } from '/app/organisms/RunPreview' import { ProtocolRunRuntimeParameters } from '/app/organisms/Devices/ProtocolRun/ProtocolRunRunTimeParameters' -import { useCurrentRunId } from '/app/resources/runs' +import { + useCurrentRunId, + useMostRecentCompletedAnalysis, +} from '/app/resources/runs' import { mockRobotSideAnalysis } from '/app/molecules/Command/__fixtures__' import { useRobot } from '/app/redux-resources/robots' import { ProtocolRunDetails } from '..' import type { ModuleModel, ModuleType } from '@opentrons/shared-data' -vi.mock('/app/organisms/LabwarePositionCheck/useMostRecentCompletedAnalysis') vi.mock('/app/organisms/Devices/hooks') vi.mock('/app/organisms/Devices/ProtocolRun/ProtocolRunHeader') vi.mock('/app/organisms/Devices/ProtocolRun/ProtocolRunSetup') diff --git a/app/src/pages/Desktop/Devices/ProtocolRunDetails/index.tsx b/app/src/pages/Desktop/Devices/ProtocolRunDetails/index.tsx index ee7d82553d4..c7aa1b219e6 100644 --- a/app/src/pages/Desktop/Devices/ProtocolRunDetails/index.tsx +++ b/app/src/pages/Desktop/Devices/ProtocolRunDetails/index.tsx @@ -37,11 +37,13 @@ import { import { BackToTopButton } from '/app/organisms/Devices/ProtocolRun/BackToTopButton' import { ProtocolRunModuleControls } from '/app/organisms/Devices/ProtocolRun/ProtocolRunModuleControls' import { ProtocolRunRuntimeParameters } from '/app/organisms/Devices/ProtocolRun/ProtocolRunRunTimeParameters' -import { useCurrentRunId } from '/app/resources/runs' +import { + useCurrentRunId, + useMostRecentCompletedAnalysis, +} from '/app/resources/runs' import { OPENTRONS_USB } from '/app/redux/discovery' import { fetchProtocols } from '/app/redux/protocol-storage' import { appShellRequestor } from '/app/redux/shell/remote' -import { useMostRecentCompletedAnalysis } from '/app/organisms/LabwarePositionCheck/useMostRecentCompletedAnalysis' import { useRobot, useRobotType } from '/app/redux-resources/robots' import type { ViewportListRef } from 'react-viewport-list' diff --git a/app/src/pages/ODD/InstrumentDetail/__tests__/InstrumentDetail.test.tsx b/app/src/pages/ODD/InstrumentDetail/__tests__/InstrumentDetail.test.tsx index 1bfc5e53c00..c2c1215a8f6 100644 --- a/app/src/pages/ODD/InstrumentDetail/__tests__/InstrumentDetail.test.tsx +++ b/app/src/pages/ODD/InstrumentDetail/__tests__/InstrumentDetail.test.tsx @@ -11,7 +11,7 @@ import { InstrumentDetail } from '..' import { useGripperDisplayName, usePipetteModelSpecs, -} from '/app/resources/instruments/hooks' +} from '/app/local-resources/instruments' import { useIsOEMMode } from '/app/resources/robot-settings/hooks' import type { Instruments } from '@opentrons/api-client' @@ -21,7 +21,7 @@ vi.mock('react-router-dom', () => ({ useParams: vi.fn(), useNavigate: vi.fn(), })) -vi.mock('/app/resources/instruments/hooks') +vi.mock('/app/local-resources/instruments') vi.mock('/app/resources/robot-settings/hooks') const render = () => { diff --git a/app/src/pages/ODD/InstrumentDetail/index.tsx b/app/src/pages/ODD/InstrumentDetail/index.tsx index 4aaea61128b..7fe2423a981 100644 --- a/app/src/pages/ODD/InstrumentDetail/index.tsx +++ b/app/src/pages/ODD/InstrumentDetail/index.tsx @@ -22,7 +22,7 @@ import { handleInstrumentDetailOverflowMenu } from './InstrumentDetailOverflowMe import { useGripperDisplayName, usePipetteModelSpecs, -} from '/app/resources/instruments/hooks' +} from '/app/local-resources/instruments' import type { GripperData, PipetteData } from '@opentrons/api-client' import type { GripperModel, PipetteModel } from '@opentrons/shared-data' diff --git a/app/src/pages/ODD/InstrumentsDashboard/index.tsx b/app/src/pages/ODD/InstrumentsDashboard/index.tsx index ea50825d359..63d12a78303 100644 --- a/app/src/pages/ODD/InstrumentsDashboard/index.tsx +++ b/app/src/pages/ODD/InstrumentsDashboard/index.tsx @@ -5,7 +5,7 @@ import { PipetteWizardFlows } from '/app/organisms/PipetteWizardFlows' import { Navigation } from '/app/organisms/Navigation' import { AttachedInstrumentMountItem } from '/app/organisms/InstrumentMountItem' import { GripperWizardFlows } from '/app/organisms/GripperWizardFlows' -import { getShowPipetteCalibrationWarning } from '/app/organisms/Devices/utils' +import { getShowPipetteCalibrationWarning } from '/app/transformations/instruments' import { PipetteRecalibrationODDWarning } from './PipetteRecalibrationODDWarning' import type { GripperData, PipetteData } from '@opentrons/api-client' diff --git a/app/src/pages/ODD/ProtocolDetails/Hardware.tsx b/app/src/pages/ODD/ProtocolDetails/Hardware.tsx index 16d11b7601a..e25c0222225 100644 --- a/app/src/pages/ODD/ProtocolDetails/Hardware.tsx +++ b/app/src/pages/ODD/ProtocolDetails/Hardware.tsx @@ -28,7 +28,7 @@ import { import { useGripperDisplayName, usePipetteNameSpecs, -} from '/app/resources/instruments/hooks' +} from '/app/local-resources/instruments' import { useRequiredProtocolHardware } from '/app/pages/Desktop/Protocols/hooks' import { EmptySection } from './EmptySection' diff --git a/app/src/pages/ODD/ProtocolSetup/__tests__/ProtocolSetup.test.tsx b/app/src/pages/ODD/ProtocolSetup/__tests__/ProtocolSetup.test.tsx index 4e0dd816006..57f6064c113 100644 --- a/app/src/pages/ODD/ProtocolSetup/__tests__/ProtocolSetup.test.tsx +++ b/app/src/pages/ODD/ProtocolSetup/__tests__/ProtocolSetup.test.tsx @@ -26,17 +26,17 @@ import { i18n } from '/app/i18n' import { useToaster } from '/app/organisms/ToasterOven' import { mockRobotSideAnalysis } from '/app/molecules/Command/__fixtures__' import { - useAttachedModules, useLPCDisabledReason, useModuleCalibrationStatus, useProtocolAnalysisErrors, useRunCreatedAtTimestamp, } from '/app/organisms/Devices/hooks' +import { useAttachedModules } from '/app/resources/modules' import { useRobotType } from '/app/redux-resources/robots' import { useTrackProtocolRunEvent } from '/app/redux-resources/analytics' import { getLocalRobot } from '/app/redux/discovery' import { ANALYTICS_PROTOCOL_RUN_ACTION } from '/app/redux/analytics' -import { getProtocolModulesInfo } from '/app/organisms/Devices/ProtocolRun/utils/getProtocolModulesInfo' +import { getProtocolModulesInfo } from '/app/transformations/analysis' import { ProtocolSetupLabware, ProtocolSetupLiquids, @@ -111,8 +111,8 @@ vi.mock('/app/organisms/ODD/ProtocolSetup', async importOriginal => { ) ) }) -vi.mock('/app/organisms/LabwarePositionCheck/useMostRecentCompletedAnalysis') -vi.mock('/app/organisms/Devices/ProtocolRun/utils/getProtocolModulesInfo') + +vi.mock('/app/transformations/analysis') vi.mock('/app/organisms/ODD/RunningProtocol') vi.mock('/app/organisms/RunTimeControl/hooks') vi.mock('/app/organisms/ModuleCard/hooks') @@ -125,6 +125,7 @@ vi.mock('/app/resources/deck_configuration/useNotifyDeckConfigurationQuery') vi.mock('../ConfirmSetupStepsCompleteModal') vi.mock('/app/redux-resources/analytics') vi.mock('/app/redux-resources/robots') +vi.mock('/app/resources/modules') const render = (path = '/') => { return renderWithProviders( diff --git a/app/src/pages/ODD/ProtocolSetup/index.tsx b/app/src/pages/ODD/ProtocolSetup/index.tsx index a5b6b088c29..8a82c6cedb1 100644 --- a/app/src/pages/ODD/ProtocolSetup/index.tsx +++ b/app/src/pages/ODD/ProtocolSetup/index.tsx @@ -34,7 +34,6 @@ import { } from '@opentrons/shared-data' import { - useAttachedModules, useLPCDisabledReason, useModuleCalibrationStatus, useProtocolAnalysisErrors, @@ -44,8 +43,9 @@ import { useRobotAnalyticsData, useTrackProtocolRunEvent, } from '/app/redux-resources/analytics' +import { useAttachedModules } from '/app/resources/modules' -import { getProtocolModulesInfo } from '/app/organisms/Devices/ProtocolRun/utils/getProtocolModulesInfo' +import { getProtocolModulesInfo } from '/app/transformations/analysis' import { AnalysisFailedModal, ProtocolSetupDeckConfiguration, @@ -75,7 +75,7 @@ import { import { getIsHeaterShakerAttached } from '/app/redux/config' import { ConfirmAttachedModal } from './ConfirmAttachedModal' import { ConfirmSetupStepsCompleteModal } from './ConfirmSetupStepsCompleteModal' -import { getLatestCurrentOffsets } from '/app/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/utils' +import { getLatestCurrentOffsets } from '/app/transformations/runs' import { CloseButton, PlayButton } from './Buttons' import { useDeckConfigurationCompatibility } from '/app/resources/deck_configuration/hooks' import { getRequiredDeckConfig } from '/app/resources/deck_configuration/utils' @@ -84,7 +84,7 @@ import { useNotifyRunQuery, useRunStatus } from '/app/resources/runs' import type { Run } from '@opentrons/api-client' import type { CutoutFixtureId, CutoutId } from '@opentrons/shared-data' import type { OnDeviceRouteParams } from '../../../App/types' -import type { ProtocolModuleInfo } from '/app/organisms/Devices/ProtocolRun/utils/getProtocolModulesInfo' +import type { ProtocolModuleInfo } from '/app/transformations/analysis' import type { SetupScreens } from '/app/organisms/ODD/ProtocolSetup' import type { ProtocolHardware, diff --git a/app/src/pages/ODD/QuickTransferDetails/Hardware.tsx b/app/src/pages/ODD/QuickTransferDetails/Hardware.tsx index 6c217c0cc5c..b147bbc7b66 100644 --- a/app/src/pages/ODD/QuickTransferDetails/Hardware.tsx +++ b/app/src/pages/ODD/QuickTransferDetails/Hardware.tsx @@ -26,7 +26,7 @@ import { import { useGripperDisplayName, usePipetteNameSpecs, -} from '/app/resources/instruments/hooks' +} from '/app/local-resources/instruments' import { useRequiredProtocolHardware } from '/app/pages/Desktop/Protocols/hooks' import type { diff --git a/app/src/pages/ODD/RunningProtocol/__tests__/RunningProtocol.test.tsx b/app/src/pages/ODD/RunningProtocol/__tests__/RunningProtocol.test.tsx index 509c2610ef8..99e14068932 100644 --- a/app/src/pages/ODD/RunningProtocol/__tests__/RunningProtocol.test.tsx +++ b/app/src/pages/ODD/RunningProtocol/__tests__/RunningProtocol.test.tsx @@ -27,7 +27,6 @@ import { mockUseAllCommandsResponseNonDeterministic } from '/app/organisms/RunPr import { getLocalRobot } from '/app/redux/discovery' import { CancelingRunModal } from '/app/organisms/ODD/RunningProtocol/CancelingRunModal' import { useTrackProtocolRunEvent } from '/app/redux-resources/analytics' -import { useMostRecentCompletedAnalysis } from '/app/organisms/LabwarePositionCheck/useMostRecentCompletedAnalysis' import { OpenDoorAlertModal } from '/app/organisms/OpenDoorAlertModal' import { RunningProtocol } from '..' import { @@ -35,6 +34,7 @@ import { useRunTimestamps, useNotifyRunQuery, useNotifyAllCommandsQuery, + useMostRecentCompletedAnalysis, } from '/app/resources/runs' import { useFeatureFlag } from '/app/redux/config' import { @@ -54,7 +54,6 @@ vi.mock('@opentrons/react-api-client') vi.mock('/app/redux-resources/analytics') vi.mock('/app/redux-resources/robots') vi.mock('/app/organisms/Devices/hooks/useLastRunCommandKey') -vi.mock('/app/organisms/LabwarePositionCheck/useMostRecentCompletedAnalysis') vi.mock('/app/organisms/RunTimeControl/hooks') vi.mock('/app/organisms/ODD/RunningProtocol') vi.mock('/app/redux/discovery') diff --git a/app/src/pages/ODD/RunningProtocol/index.tsx b/app/src/pages/ODD/RunningProtocol/index.tsx index 8c22d077427..dcadbcb448c 100644 --- a/app/src/pages/ODD/RunningProtocol/index.tsx +++ b/app/src/pages/ODD/RunningProtocol/index.tsx @@ -27,11 +27,12 @@ import { } from '@opentrons/api-client' import { StepMeter } from '/app/atoms/StepMeter' -import { useMostRecentCompletedAnalysis } from '/app/organisms/LabwarePositionCheck/useMostRecentCompletedAnalysis' + import { useRunStatus, useRunTimestamps, useNotifyRunQuery, + useMostRecentCompletedAnalysis, } from '/app/resources/runs' import { InterventionModal, diff --git a/app/src/redux/pipettes/__fixtures__/index.ts b/app/src/redux/pipettes/__fixtures__/index.ts index 8194b278b17..8018bdcc5de 100644 --- a/app/src/redux/pipettes/__fixtures__/index.ts +++ b/app/src/redux/pipettes/__fixtures__/index.ts @@ -2,18 +2,16 @@ import { fixtureP10Single } from '@opentrons/shared-data/pipette/fixtures/name' import type { AttachedPipette, + PipetteInfo, PipetteSettings, PipetteSettingsFieldsMap, + PipetteInformation, } from '../types' import type { RobotApiResponse, RobotApiResponseMeta, } from '../../robot-api/types' import { mockTipRackDefinition } from '../../custom-labware/__fixtures__' -import type { - PipetteInfo, - PipetteInformation, -} from '/app/organisms/Devices/hooks' import type { PipetteData } from '@opentrons/api-client' export const mockRobot = { name: 'robot', ip: '127.0.0.1', port: 31950 } diff --git a/app/src/redux/pipettes/index.ts b/app/src/redux/pipettes/index.ts index 54c9f03686d..efdff69cf28 100644 --- a/app/src/redux/pipettes/index.ts +++ b/app/src/redux/pipettes/index.ts @@ -7,3 +7,4 @@ export * from './actions' export * from './constants' export * from './selectors' +export type * from './types' diff --git a/app/src/redux/pipettes/types.ts b/app/src/redux/pipettes/types.ts index a46267e1c07..16ce563f60c 100644 --- a/app/src/redux/pipettes/types.ts +++ b/app/src/redux/pipettes/types.ts @@ -3,12 +3,15 @@ import type { PipetteChannels, PipetteModel, PipetteModelSpecs, + PipetteNameSpecs, } from '@opentrons/shared-data' +import type { PipetteData } from '@opentrons/api-client' import type { RobotApiRequestMeta } from '../robot-api/types' import type { PipetteOffsetCalibration, TipLengthCalibration, } from '../calibration/types' +import type { MATCH, INEXACT_MATCH, INCOMPATIBLE } from './constants' // common types @@ -262,3 +265,17 @@ export interface ProtocolPipetteTipRackCalData { export type ProtocolPipetteTipRackCalDataByMount = { [mount in Mount]: ProtocolPipetteTipRackCalData | null } + +export interface PipetteInfo { + pipetteSpecs: PipetteNameSpecs + tipRacksForPipette: TipRackCalibrationData[] + requestedPipetteMatch: + | typeof MATCH + | typeof INEXACT_MATCH + | typeof INCOMPATIBLE + pipetteCalDate: string | null +} + +export interface PipetteInformation extends PipetteData { + displayName: string +} diff --git a/app/src/organisms/Devices/hooks/__tests__/useDeckCalibrationStatus.test.tsx b/app/src/resources/calibration/__tests__/useDeckCalibrationStatus.test.tsx similarity index 100% rename from app/src/organisms/Devices/hooks/__tests__/useDeckCalibrationStatus.test.tsx rename to app/src/resources/calibration/__tests__/useDeckCalibrationStatus.test.tsx diff --git a/app/src/resources/calibration/index.ts b/app/src/resources/calibration/index.ts new file mode 100644 index 00000000000..977142e5f34 --- /dev/null +++ b/app/src/resources/calibration/index.ts @@ -0,0 +1 @@ +export * from './useDeckCalibrationStatus' diff --git a/app/src/organisms/Devices/hooks/useDeckCalibrationStatus.ts b/app/src/resources/calibration/useDeckCalibrationStatus.ts similarity index 100% rename from app/src/organisms/Devices/hooks/useDeckCalibrationStatus.ts rename to app/src/resources/calibration/useDeckCalibrationStatus.ts diff --git a/app/src/organisms/Devices/hooks/__tests__/useAttachedPipetteCalibrations.test.tsx b/app/src/resources/instruments/__tests__/useAttachedPipetteCalibrations.test.tsx similarity index 100% rename from app/src/organisms/Devices/hooks/__tests__/useAttachedPipetteCalibrations.test.tsx rename to app/src/resources/instruments/__tests__/useAttachedPipetteCalibrations.test.tsx diff --git a/app/src/organisms/Devices/hooks/__tests__/useAttachedPipettes.test.tsx b/app/src/resources/instruments/__tests__/useAttachedPipettes.test.tsx similarity index 100% rename from app/src/organisms/Devices/hooks/__tests__/useAttachedPipettes.test.tsx rename to app/src/resources/instruments/__tests__/useAttachedPipettes.test.tsx diff --git a/app/src/resources/instruments/index.ts b/app/src/resources/instruments/index.ts new file mode 100644 index 00000000000..6a1b0d08a29 --- /dev/null +++ b/app/src/resources/instruments/index.ts @@ -0,0 +1,2 @@ +export * from './useAttachedPipettes' +export * from './useAttachedPipetteCalibrations' diff --git a/app/src/organisms/Devices/hooks/useAttachedPipetteCalibrations.ts b/app/src/resources/instruments/useAttachedPipetteCalibrations.ts similarity index 100% rename from app/src/organisms/Devices/hooks/useAttachedPipetteCalibrations.ts rename to app/src/resources/instruments/useAttachedPipetteCalibrations.ts diff --git a/app/src/organisms/Devices/hooks/useAttachedPipettes.ts b/app/src/resources/instruments/useAttachedPipettes.ts similarity index 100% rename from app/src/organisms/Devices/hooks/useAttachedPipettes.ts rename to app/src/resources/instruments/useAttachedPipettes.ts diff --git a/app/src/organisms/Devices/hooks/__tests__/useAttachedModules.test.tsx b/app/src/resources/modules/hooks/__tests__/useAttachedModules.test.tsx similarity index 100% rename from app/src/organisms/Devices/hooks/__tests__/useAttachedModules.test.tsx rename to app/src/resources/modules/hooks/__tests__/useAttachedModules.test.tsx diff --git a/app/src/resources/modules/hooks/index.ts b/app/src/resources/modules/hooks/index.ts new file mode 100644 index 00000000000..c38e5f46140 --- /dev/null +++ b/app/src/resources/modules/hooks/index.ts @@ -0,0 +1 @@ +export * from './useAttachedModules' diff --git a/app/src/organisms/Devices/hooks/useAttachedModules.ts b/app/src/resources/modules/hooks/useAttachedModules.ts similarity index 100% rename from app/src/organisms/Devices/hooks/useAttachedModules.ts rename to app/src/resources/modules/hooks/useAttachedModules.ts diff --git a/app/src/resources/modules/index.ts b/app/src/resources/modules/index.ts new file mode 100644 index 00000000000..fc78d35129c --- /dev/null +++ b/app/src/resources/modules/index.ts @@ -0,0 +1 @@ +export * from './hooks' diff --git a/app/src/resources/protocols/hooks/__tests__/useRunningStepCount.test.ts b/app/src/resources/protocols/hooks/__tests__/useRunningStepCount.test.ts index b2b98b7d0d4..29196c7db21 100644 --- a/app/src/resources/protocols/hooks/__tests__/useRunningStepCount.test.ts +++ b/app/src/resources/protocols/hooks/__tests__/useRunningStepCount.test.ts @@ -1,12 +1,12 @@ import { describe, it, expect, vi } from 'vitest' import { renderHook } from '@testing-library/react' -import { useMostRecentCompletedAnalysis } from '/app/organisms/LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' import { useRunningStepCounts } from '../useRunningStepCounts' import { useLastRunProtocolCommand } from '../useLastRunProtocolCommand' vi.mock('../useLastRunProtocolCommand') -vi.mock('/app/organisms/LabwarePositionCheck/useMostRecentCompletedAnalysis') +vi.mock('/app/resources/runs') const mockRunId = 'mock-run-id' const mockCommandsData = { diff --git a/app/src/resources/protocols/hooks/useRunningStepCounts.ts b/app/src/resources/protocols/hooks/useRunningStepCounts.ts index 53a60701d99..915676ba5ec 100644 --- a/app/src/resources/protocols/hooks/useRunningStepCounts.ts +++ b/app/src/resources/protocols/hooks/useRunningStepCounts.ts @@ -1,4 +1,4 @@ -import { useMostRecentCompletedAnalysis } from '/app/organisms/LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { useMostRecentCompletedAnalysis } from '/app/resources/runs' import { useLastRunProtocolCommand } from './useLastRunProtocolCommand' diff --git a/app/src/resources/runs/__fixtures__/index.ts b/app/src/resources/runs/__fixtures__/index.ts index 49dadfe85ea..056f2859641 100644 --- a/app/src/resources/runs/__fixtures__/index.ts +++ b/app/src/resources/runs/__fixtures__/index.ts @@ -1,282 +1,4 @@ -import { - RUN_ACTION_TYPE_PLAY, - RUN_ACTION_TYPE_PAUSE, - RUN_ACTION_TYPE_STOP, - RUN_STATUS_IDLE, - RUN_STATUS_PAUSED, - RUN_STATUS_RUNNING, - RUN_STATUS_SUCCEEDED, - RUN_STATUS_FAILED, - RUN_STATUS_STOP_REQUESTED, - RUN_STATUS_STOPPED, -} from '@opentrons/api-client' +import modifiedSimpleV6Protocol from './modifiedSimpleV6.json' +export * from './mockRuns' -import type { RunData, CommandDetail } from '@opentrons/api-client' - -export const PROTOCOL_ID = '1' -export const RUN_ID_1 = '1' -export const RUN_ID_2 = '2' -export const COMMAND_ID = '4' - -export const mockPausedRun: RunData = { - id: RUN_ID_1, - createdAt: '2021-10-07T18:44:49.366581+00:00', - current: true, - status: RUN_STATUS_PAUSED, - protocolId: PROTOCOL_ID, - actions: [ - { - id: '1', - createdAt: '2021-10-25T12:54:53.366581+00:00', - actionType: RUN_ACTION_TYPE_PLAY, - }, - { - id: '2', - createdAt: '2021-10-25T13:23:31.366581+00:00', - actionType: RUN_ACTION_TYPE_PAUSE, - }, - ], - errors: [], - hasEverEnteredErrorRecovery: false, - pipettes: [], - labware: [], - modules: [], - liquids: [], - runTimeParameters: [], -} - -export const mockRunningRun: RunData = { - id: RUN_ID_2, - createdAt: '2021-10-07T18:44:49.366581+00:00', - current: true, - status: RUN_STATUS_RUNNING, - protocolId: PROTOCOL_ID, - actions: [ - { - id: '1', - createdAt: '2021-10-25T12:54:53.366581+00:00', - actionType: RUN_ACTION_TYPE_PLAY, - }, - { - id: '2', - createdAt: '2021-10-25T13:23:31.366581+00:00', - actionType: RUN_ACTION_TYPE_PAUSE, - }, - { - id: '3', - createdAt: '2021-10-25T13:26:42.366581+00:00', - actionType: RUN_ACTION_TYPE_PLAY, - }, - ], - errors: [], - hasEverEnteredErrorRecovery: false, - pipettes: [], - labware: [], - modules: [], - liquids: [], - runTimeParameters: [], -} - -export const mockFailedRun: RunData = { - id: RUN_ID_2, - createdAt: '2021-10-07T18:44:49.366581+00:00', - current: true, - status: RUN_STATUS_FAILED, - protocolId: PROTOCOL_ID, - actions: [ - { - id: '1', - createdAt: '2021-10-25T12:54:53.366581+00:00', - actionType: RUN_ACTION_TYPE_PLAY, - }, - { - id: '2', - createdAt: '2021-10-25T13:23:31.366581+00:00', - actionType: RUN_ACTION_TYPE_PAUSE, - }, - { - id: '3', - createdAt: '2021-10-25T13:26:42.366581+00:00', - actionType: RUN_ACTION_TYPE_PLAY, - }, - ], - errors: [ - { - id: '5', - errorType: 'RuntimeError', - isDefined: false, - createdAt: 'noon forty-five', - detail: 'this run failed', - errorInfo: {}, - wrappedErrors: [], - errorCode: '4000', - }, - ], - hasEverEnteredErrorRecovery: false, - pipettes: [], - labware: [], - modules: [], - liquids: [], - runTimeParameters: [], -} - -export const mockStopRequestedRun: RunData = { - id: RUN_ID_2, - createdAt: '2021-10-07T18:44:49.366581+00:00', - current: true, - status: RUN_STATUS_STOP_REQUESTED, - protocolId: PROTOCOL_ID, - actions: [ - { - id: '1', - createdAt: '2021-10-25T12:54:53.366581+00:00', - actionType: RUN_ACTION_TYPE_PLAY, - }, - { - id: '2', - createdAt: '2021-10-25T13:23:31.366581+00:00', - actionType: RUN_ACTION_TYPE_PAUSE, - }, - { - id: '3', - createdAt: '2021-10-25T13:26:42.366581+00:00', - actionType: RUN_ACTION_TYPE_PLAY, - }, - { - id: '4', - createdAt: '2021-10-25T13:58:22.366581+00:00', - actionType: RUN_ACTION_TYPE_STOP, - }, - ], - errors: [], - hasEverEnteredErrorRecovery: false, - pipettes: [], - labware: [], - modules: [], - liquids: [], - runTimeParameters: [], -} - -export const mockStoppedRun: RunData = { - id: RUN_ID_2, - createdAt: '2021-10-07T18:44:49.366581+00:00', - current: true, - status: RUN_STATUS_STOPPED, - protocolId: PROTOCOL_ID, - actions: [ - { - id: '1', - createdAt: '2021-10-25T12:54:53.366581+00:00', - actionType: RUN_ACTION_TYPE_PLAY, - }, - { - id: '2', - createdAt: '2021-10-25T13:23:31.366581+00:00', - actionType: RUN_ACTION_TYPE_PAUSE, - }, - { - id: '3', - createdAt: '2021-10-25T13:26:42.366581+00:00', - actionType: RUN_ACTION_TYPE_PLAY, - }, - { - id: '4', - createdAt: '2021-10-25T13:58:22.366581+00:00', - actionType: RUN_ACTION_TYPE_STOP, - }, - ], - errors: [], - hasEverEnteredErrorRecovery: false, - pipettes: [], - labware: [], - modules: [], - liquids: [], - runTimeParameters: [], -} - -export const mockSucceededRun: RunData = { - id: RUN_ID_2, - createdAt: '2021-10-07T18:44:49.366581+00:00', - current: true, - status: RUN_STATUS_SUCCEEDED, - protocolId: PROTOCOL_ID, - actions: [ - { - id: '1', - createdAt: '2021-10-25T12:54:53.366581+00:00', - actionType: RUN_ACTION_TYPE_PLAY, - }, - { - id: '2', - createdAt: '2021-10-25T13:23:31.366581+00:00', - actionType: RUN_ACTION_TYPE_PAUSE, - }, - { - id: '3', - createdAt: '2021-10-25T13:26:42.366581+00:00', - actionType: RUN_ACTION_TYPE_PLAY, - }, - ], - errors: [], - hasEverEnteredErrorRecovery: false, - pipettes: [], - labware: [], - modules: [], - liquids: [], - runTimeParameters: [], -} - -export const mockIdleUnstartedRun: RunData = { - id: RUN_ID_2, - createdAt: '2021-10-07T18:44:49.366581+00:00', - current: true, - status: RUN_STATUS_IDLE, - protocolId: PROTOCOL_ID, - actions: [], - errors: [], - hasEverEnteredErrorRecovery: false, - pipettes: [], - labware: [], - modules: [], - liquids: [], - runTimeParameters: [], -} - -export const mockIdleStartedRun: RunData = { - id: RUN_ID_2, - createdAt: '2021-10-07T18:44:49.366581+00:00', - current: true, - status: RUN_STATUS_IDLE, - protocolId: PROTOCOL_ID, - actions: [ - { - id: '1', - createdAt: '2021-10-25T12:54:53.366581+00:00', - actionType: RUN_ACTION_TYPE_PLAY, - }, - { - id: '2', - createdAt: '2021-10-25T13:23:31.366581+00:00', - actionType: RUN_ACTION_TYPE_PAUSE, - }, - { - id: '3', - createdAt: '2021-10-25T13:26:42.366581+00:00', - actionType: RUN_ACTION_TYPE_PLAY, - }, - ], - errors: [], - hasEverEnteredErrorRecovery: false, - pipettes: [], - labware: [], - modules: [], - liquids: [], - runTimeParameters: [], -} - -export const mockCommand = { - data: { - id: COMMAND_ID, - completedAt: 'noon thirty', - }, -} as CommandDetail +export { modifiedSimpleV6Protocol } diff --git a/app/src/resources/runs/__fixtures__/mockRuns.ts b/app/src/resources/runs/__fixtures__/mockRuns.ts new file mode 100644 index 00000000000..49dadfe85ea --- /dev/null +++ b/app/src/resources/runs/__fixtures__/mockRuns.ts @@ -0,0 +1,282 @@ +import { + RUN_ACTION_TYPE_PLAY, + RUN_ACTION_TYPE_PAUSE, + RUN_ACTION_TYPE_STOP, + RUN_STATUS_IDLE, + RUN_STATUS_PAUSED, + RUN_STATUS_RUNNING, + RUN_STATUS_SUCCEEDED, + RUN_STATUS_FAILED, + RUN_STATUS_STOP_REQUESTED, + RUN_STATUS_STOPPED, +} from '@opentrons/api-client' + +import type { RunData, CommandDetail } from '@opentrons/api-client' + +export const PROTOCOL_ID = '1' +export const RUN_ID_1 = '1' +export const RUN_ID_2 = '2' +export const COMMAND_ID = '4' + +export const mockPausedRun: RunData = { + id: RUN_ID_1, + createdAt: '2021-10-07T18:44:49.366581+00:00', + current: true, + status: RUN_STATUS_PAUSED, + protocolId: PROTOCOL_ID, + actions: [ + { + id: '1', + createdAt: '2021-10-25T12:54:53.366581+00:00', + actionType: RUN_ACTION_TYPE_PLAY, + }, + { + id: '2', + createdAt: '2021-10-25T13:23:31.366581+00:00', + actionType: RUN_ACTION_TYPE_PAUSE, + }, + ], + errors: [], + hasEverEnteredErrorRecovery: false, + pipettes: [], + labware: [], + modules: [], + liquids: [], + runTimeParameters: [], +} + +export const mockRunningRun: RunData = { + id: RUN_ID_2, + createdAt: '2021-10-07T18:44:49.366581+00:00', + current: true, + status: RUN_STATUS_RUNNING, + protocolId: PROTOCOL_ID, + actions: [ + { + id: '1', + createdAt: '2021-10-25T12:54:53.366581+00:00', + actionType: RUN_ACTION_TYPE_PLAY, + }, + { + id: '2', + createdAt: '2021-10-25T13:23:31.366581+00:00', + actionType: RUN_ACTION_TYPE_PAUSE, + }, + { + id: '3', + createdAt: '2021-10-25T13:26:42.366581+00:00', + actionType: RUN_ACTION_TYPE_PLAY, + }, + ], + errors: [], + hasEverEnteredErrorRecovery: false, + pipettes: [], + labware: [], + modules: [], + liquids: [], + runTimeParameters: [], +} + +export const mockFailedRun: RunData = { + id: RUN_ID_2, + createdAt: '2021-10-07T18:44:49.366581+00:00', + current: true, + status: RUN_STATUS_FAILED, + protocolId: PROTOCOL_ID, + actions: [ + { + id: '1', + createdAt: '2021-10-25T12:54:53.366581+00:00', + actionType: RUN_ACTION_TYPE_PLAY, + }, + { + id: '2', + createdAt: '2021-10-25T13:23:31.366581+00:00', + actionType: RUN_ACTION_TYPE_PAUSE, + }, + { + id: '3', + createdAt: '2021-10-25T13:26:42.366581+00:00', + actionType: RUN_ACTION_TYPE_PLAY, + }, + ], + errors: [ + { + id: '5', + errorType: 'RuntimeError', + isDefined: false, + createdAt: 'noon forty-five', + detail: 'this run failed', + errorInfo: {}, + wrappedErrors: [], + errorCode: '4000', + }, + ], + hasEverEnteredErrorRecovery: false, + pipettes: [], + labware: [], + modules: [], + liquids: [], + runTimeParameters: [], +} + +export const mockStopRequestedRun: RunData = { + id: RUN_ID_2, + createdAt: '2021-10-07T18:44:49.366581+00:00', + current: true, + status: RUN_STATUS_STOP_REQUESTED, + protocolId: PROTOCOL_ID, + actions: [ + { + id: '1', + createdAt: '2021-10-25T12:54:53.366581+00:00', + actionType: RUN_ACTION_TYPE_PLAY, + }, + { + id: '2', + createdAt: '2021-10-25T13:23:31.366581+00:00', + actionType: RUN_ACTION_TYPE_PAUSE, + }, + { + id: '3', + createdAt: '2021-10-25T13:26:42.366581+00:00', + actionType: RUN_ACTION_TYPE_PLAY, + }, + { + id: '4', + createdAt: '2021-10-25T13:58:22.366581+00:00', + actionType: RUN_ACTION_TYPE_STOP, + }, + ], + errors: [], + hasEverEnteredErrorRecovery: false, + pipettes: [], + labware: [], + modules: [], + liquids: [], + runTimeParameters: [], +} + +export const mockStoppedRun: RunData = { + id: RUN_ID_2, + createdAt: '2021-10-07T18:44:49.366581+00:00', + current: true, + status: RUN_STATUS_STOPPED, + protocolId: PROTOCOL_ID, + actions: [ + { + id: '1', + createdAt: '2021-10-25T12:54:53.366581+00:00', + actionType: RUN_ACTION_TYPE_PLAY, + }, + { + id: '2', + createdAt: '2021-10-25T13:23:31.366581+00:00', + actionType: RUN_ACTION_TYPE_PAUSE, + }, + { + id: '3', + createdAt: '2021-10-25T13:26:42.366581+00:00', + actionType: RUN_ACTION_TYPE_PLAY, + }, + { + id: '4', + createdAt: '2021-10-25T13:58:22.366581+00:00', + actionType: RUN_ACTION_TYPE_STOP, + }, + ], + errors: [], + hasEverEnteredErrorRecovery: false, + pipettes: [], + labware: [], + modules: [], + liquids: [], + runTimeParameters: [], +} + +export const mockSucceededRun: RunData = { + id: RUN_ID_2, + createdAt: '2021-10-07T18:44:49.366581+00:00', + current: true, + status: RUN_STATUS_SUCCEEDED, + protocolId: PROTOCOL_ID, + actions: [ + { + id: '1', + createdAt: '2021-10-25T12:54:53.366581+00:00', + actionType: RUN_ACTION_TYPE_PLAY, + }, + { + id: '2', + createdAt: '2021-10-25T13:23:31.366581+00:00', + actionType: RUN_ACTION_TYPE_PAUSE, + }, + { + id: '3', + createdAt: '2021-10-25T13:26:42.366581+00:00', + actionType: RUN_ACTION_TYPE_PLAY, + }, + ], + errors: [], + hasEverEnteredErrorRecovery: false, + pipettes: [], + labware: [], + modules: [], + liquids: [], + runTimeParameters: [], +} + +export const mockIdleUnstartedRun: RunData = { + id: RUN_ID_2, + createdAt: '2021-10-07T18:44:49.366581+00:00', + current: true, + status: RUN_STATUS_IDLE, + protocolId: PROTOCOL_ID, + actions: [], + errors: [], + hasEverEnteredErrorRecovery: false, + pipettes: [], + labware: [], + modules: [], + liquids: [], + runTimeParameters: [], +} + +export const mockIdleStartedRun: RunData = { + id: RUN_ID_2, + createdAt: '2021-10-07T18:44:49.366581+00:00', + current: true, + status: RUN_STATUS_IDLE, + protocolId: PROTOCOL_ID, + actions: [ + { + id: '1', + createdAt: '2021-10-25T12:54:53.366581+00:00', + actionType: RUN_ACTION_TYPE_PLAY, + }, + { + id: '2', + createdAt: '2021-10-25T13:23:31.366581+00:00', + actionType: RUN_ACTION_TYPE_PAUSE, + }, + { + id: '3', + createdAt: '2021-10-25T13:26:42.366581+00:00', + actionType: RUN_ACTION_TYPE_PLAY, + }, + ], + errors: [], + hasEverEnteredErrorRecovery: false, + pipettes: [], + labware: [], + modules: [], + liquids: [], + runTimeParameters: [], +} + +export const mockCommand = { + data: { + id: COMMAND_ID, + completedAt: 'noon thirty', + }, +} as CommandDetail diff --git a/app/src/organisms/Devices/hooks/__fixtures__/modifiedSimpleV6.json b/app/src/resources/runs/__fixtures__/modifiedSimpleV6.json similarity index 100% rename from app/src/organisms/Devices/hooks/__fixtures__/modifiedSimpleV6.json rename to app/src/resources/runs/__fixtures__/modifiedSimpleV6.json diff --git a/app/src/organisms/Devices/hooks/__tests__/useRunCalibrationStatus.test.tsx b/app/src/resources/runs/__tests__/useRunCalibrationStatus.test.tsx similarity index 96% rename from app/src/organisms/Devices/hooks/__tests__/useRunCalibrationStatus.test.tsx rename to app/src/resources/runs/__tests__/useRunCalibrationStatus.test.tsx index a8554d8c033..f8df8d8edf0 100644 --- a/app/src/organisms/Devices/hooks/__tests__/useRunCalibrationStatus.test.tsx +++ b/app/src/resources/runs/__tests__/useRunCalibrationStatus.test.tsx @@ -7,19 +7,19 @@ import { mockTipRackDefinition } from '/app/redux/custom-labware/__fixtures__' import { useRunCalibrationStatus, - useDeckCalibrationStatus, useRunPipetteInfoByMount, + useNotifyRunQuery, } from '..' +import { useDeckCalibrationStatus } from '/app/resources/calibration' import { useIsFlex } from '/app/redux-resources/robots' -import { useNotifyRunQuery } from '/app/resources/runs' -import type { PipetteInfo } from '..' +import type { PipetteInfo } from '/app/redux/pipettes' import { Provider } from 'react-redux' import { createStore } from 'redux' -vi.mock('../useDeckCalibrationStatus') vi.mock('../useRunPipetteInfoByMount') -vi.mock('/app/resources/runs') +vi.mock('../useNotifyRunQuery') +vi.mock('/app/resources/calibration') vi.mock('/app/resources/analysis') vi.mock('/app/redux-resources/robots') diff --git a/app/src/organisms/Devices/hooks/__tests__/useRunPipetteInfoByMount.test.tsx b/app/src/resources/runs/__tests__/useRunPipetteInfoByMount.test.tsx similarity index 91% rename from app/src/organisms/Devices/hooks/__tests__/useRunPipetteInfoByMount.test.tsx rename to app/src/resources/runs/__tests__/useRunPipetteInfoByMount.test.tsx index ba38f656fc9..8690913c531 100644 --- a/app/src/organisms/Devices/hooks/__tests__/useRunPipetteInfoByMount.test.tsx +++ b/app/src/resources/runs/__tests__/useRunPipetteInfoByMount.test.tsx @@ -21,17 +21,18 @@ import { mockLeftProtoPipette, mockRightProtoPipette, } from '/app/redux/pipettes/__fixtures__' -import { useMostRecentCompletedAnalysis } from '../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { useMostRecentCompletedAnalysis } from '../useMostRecentCompletedAnalysis' + +import { useRunPipetteInfoByMount } from '../useRunPipetteInfoByMount' import { useAttachedPipetteCalibrations, useAttachedPipettes, - useRunPipetteInfoByMount, -} from '..' +} from '/app/resources/instruments' import { useStoredProtocolAnalysis } from '/app/resources/analysis' -import _uncastedModifiedSimpleV6Protocol from '../__fixtures__/modifiedSimpleV6.json' +import { modifiedSimpleV6Protocol as _uncastedModifiedSimpleV6Protocol } from '../__fixtures__' import type * as SharedData from '@opentrons/shared-data' -import type { PipetteInfo } from '..' +import type { PipetteInfo } from '/app/redux/pipettes' vi.mock('@opentrons/shared-data', async importOriginal => { const actualSharedData = await importOriginal() @@ -42,10 +43,8 @@ vi.mock('@opentrons/shared-data', async importOriginal => { } }) vi.mock('@opentrons/react-api-client') -vi.mock('../../../LabwarePositionCheck/useMostRecentCompletedAnalysis') -vi.mock('../useAttachedPipetteCalibrations') -vi.mock('../useAttachedPipettes') -vi.mock('../useTipLengthCalibrations') +vi.mock('../useMostRecentCompletedAnalysis') +vi.mock('/app/resources/instruments') vi.mock('/app/resources/analysis') const PIPETTE_CALIBRATIONS = { diff --git a/app/src/resources/runs/hooks.ts b/app/src/resources/runs/hooks.ts index 49ddb0b0d87..fd099985b28 100644 --- a/app/src/resources/runs/hooks.ts +++ b/app/src/resources/runs/hooks.ts @@ -17,7 +17,6 @@ import { useMaintenanceRunTakeover } from '/app/organisms/TakeoverModal' import type { CreateCommand } from '@opentrons/shared-data' import type { HostConfig } from '@opentrons/api-client' -import type { ModulePrepCommandsType } from '/app/organisms/Devices/getModulePrepCommands' import type { CreateMaintenanceRunType, UseCreateMaintenanceRunMutationOptions, @@ -95,7 +94,7 @@ export function useChainRunCommands( export function useChainLiveCommands(): { chainLiveCommands: ( - commands: ModulePrepCommandsType[], + commands: CreateCommand[], continuePastCommandFailure: boolean ) => ReturnType isCommandMutationLoading: boolean @@ -104,7 +103,7 @@ export function useChainLiveCommands(): { const { createLiveCommand } = useCreateLiveCommandMutation() return { chainLiveCommands: ( - commands: ModulePrepCommandsType[], + commands: CreateCommand[], continuePastCommandFailure: boolean ) => chainLiveCommandsRecursive( diff --git a/app/src/resources/runs/index.ts b/app/src/resources/runs/index.ts index 31d4f09acde..abe60e26f5d 100644 --- a/app/src/resources/runs/index.ts +++ b/app/src/resources/runs/index.ts @@ -17,3 +17,6 @@ export * from './useCurrentRunCommands' export * from './useMostRecentRunId' export * from './useRestartRun' export * from './constants' +export * from './useMostRecentCompletedAnalysis' +export * from './useRunPipetteInfoByMount' +export * from './useRunCalibrationStatus' diff --git a/app/src/organisms/LabwarePositionCheck/useMostRecentCompletedAnalysis.ts b/app/src/resources/runs/useMostRecentCompletedAnalysis.ts similarity index 100% rename from app/src/organisms/LabwarePositionCheck/useMostRecentCompletedAnalysis.ts rename to app/src/resources/runs/useMostRecentCompletedAnalysis.ts diff --git a/app/src/organisms/Devices/hooks/useRunCalibrationStatus.ts b/app/src/resources/runs/useRunCalibrationStatus.ts similarity index 96% rename from app/src/organisms/Devices/hooks/useRunCalibrationStatus.ts rename to app/src/resources/runs/useRunCalibrationStatus.ts index 8f006ec50c5..fe1dc7a1f5e 100644 --- a/app/src/organisms/Devices/hooks/useRunCalibrationStatus.ts +++ b/app/src/resources/runs/useRunCalibrationStatus.ts @@ -1,7 +1,7 @@ import { MATCH, INEXACT_MATCH } from '/app/redux/pipettes' -import { useDeckCalibrationStatus, useRunPipetteInfoByMount } from '.' +import { useRunPipetteInfoByMount, useMostRecentCompletedAnalysis } from '.' +import { useDeckCalibrationStatus } from '/app/resources/calibration' import { useStoredProtocolAnalysis } from '/app/resources/analysis' -import { useMostRecentCompletedAnalysis } from '../../LabwarePositionCheck/useMostRecentCompletedAnalysis' import { isGripperInCommands } from '/app/resources/protocols/utils' import { useIsFlex } from '/app/redux-resources/robots' import { useInstrumentsQuery } from '@opentrons/react-api-client' diff --git a/app/src/organisms/Devices/hooks/useRunPipetteInfoByMount.ts b/app/src/resources/runs/useRunPipetteInfoByMount.ts similarity index 90% rename from app/src/organisms/Devices/hooks/useRunPipetteInfoByMount.ts rename to app/src/resources/runs/useRunPipetteInfoByMount.ts index d8cef97edc1..272cbec58f3 100644 --- a/app/src/organisms/Devices/hooks/useRunPipetteInfoByMount.ts +++ b/app/src/resources/runs/useRunPipetteInfoByMount.ts @@ -7,33 +7,25 @@ import { import { useAllTipLengthCalibrationsQuery } from '@opentrons/react-api-client' import { MATCH, INEXACT_MATCH, INCOMPATIBLE } from '/app/redux/pipettes' import { useStoredProtocolAnalysis } from '/app/resources/analysis' -import { useAttachedPipetteCalibrations, useAttachedPipettes } from '.' +import { + useAttachedPipetteCalibrations, + useAttachedPipettes, +} from '/app/resources/instruments' -import { useMostRecentCompletedAnalysis } from '../../LabwarePositionCheck/useMostRecentCompletedAnalysis' +import { useMostRecentCompletedAnalysis } from './useMostRecentCompletedAnalysis' import type { PickUpTipRunTimeCommand, LoadPipetteRunTimeCommand, LabwareDefinition2, - PipetteNameSpecs, } from '@opentrons/shared-data' import type { Mount, AttachedPipette, - TipRackCalibrationData, + PipetteInfo, } from '/app/redux/pipettes/types' const EMPTY_MOUNTS = { left: null, right: null } -export interface PipetteInfo { - pipetteSpecs: PipetteNameSpecs - tipRacksForPipette: TipRackCalibrationData[] - requestedPipetteMatch: - | typeof MATCH - | typeof INEXACT_MATCH - | typeof INCOMPATIBLE - pipetteCalDate: string | null -} - export function useRunPipetteInfoByMount( runId: string ): { diff --git a/app/src/resources/runs/utils.ts b/app/src/resources/runs/utils.ts index 60b5cf855b6..d9b6781f4b2 100644 --- a/app/src/resources/runs/utils.ts +++ b/app/src/resources/runs/utils.ts @@ -5,7 +5,6 @@ import type { UseMutateAsyncFunction } from 'react-query' import type { CommandData } from '@opentrons/api-client' import type { CreateCommand } from '@opentrons/shared-data' import type { CreateLiveCommandMutateParams } from '@opentrons/react-api-client/src/runs/useCreateLiveCommandMutation' -import type { ModulePrepCommandsType } from '/app/organisms/Devices/getModulePrepCommands' import type { CreateMaintenanceCommand, CreateRunCommand } from './hooks' export const chainRunCommandsRecursive = ( @@ -51,7 +50,7 @@ export const chainRunCommandsRecursive = ( } export const chainLiveCommandsRecursive = ( - commands: ModulePrepCommandsType[], + commands: CreateCommand[], createLiveCommand: UseMutateAsyncFunction< CommandData, unknown, diff --git a/app/src/organisms/Devices/ProtocolRun/utils/__tests__/getLabwareOffsetLocation.test.tsx b/app/src/transformations/analysis/__tests__/getLabwareOffsetLocation.test.tsx similarity index 95% rename from app/src/organisms/Devices/ProtocolRun/utils/__tests__/getLabwareOffsetLocation.test.tsx rename to app/src/transformations/analysis/__tests__/getLabwareOffsetLocation.test.tsx index 4b81bacb8cf..5b2990049b5 100644 --- a/app/src/organisms/Devices/ProtocolRun/utils/__tests__/getLabwareOffsetLocation.test.tsx +++ b/app/src/transformations/analysis/__tests__/getLabwareOffsetLocation.test.tsx @@ -7,8 +7,10 @@ import { opentrons96PcrAdapterV1, } from '@opentrons/shared-data' import { getLabwareOffsetLocation } from '../getLabwareOffsetLocation' -import { getLabwareLocation } from '../getLabwareLocation' -import { getModuleInitialLoadInfo } from '../getModuleInitialLoadInfo' +import { + getModuleInitialLoadInfo, + getLabwareLocation, +} from '/app/transformations/commands' import type { LoadedLabware, LoadedModule, @@ -16,8 +18,7 @@ import type { CompletedProtocolAnalysis, } from '@opentrons/shared-data' -vi.mock('../getLabwareLocation') -vi.mock('../getModuleInitialLoadInfo') +vi.mock('/app/transformations/commands') const protocolWithTC = (multiple_tipacks_with_tc as unknown) as CompletedProtocolAnalysis const mockAdapterDef = opentrons96PcrAdapterV1 as LabwareDefinition2 diff --git a/app/src/organisms/Devices/ProtocolRun/utils/__tests__/getLabwareRenderInfo.test.ts b/app/src/transformations/analysis/__tests__/getLabwareRenderInfo.test.ts similarity index 100% rename from app/src/organisms/Devices/ProtocolRun/utils/__tests__/getLabwareRenderInfo.test.ts rename to app/src/transformations/analysis/__tests__/getLabwareRenderInfo.test.ts diff --git a/app/src/organisms/Devices/ProtocolRun/utils/__tests__/getProtocolModulesInfo.test.ts b/app/src/transformations/analysis/__tests__/getProtocolModulesInfo.test.ts similarity index 100% rename from app/src/organisms/Devices/ProtocolRun/utils/__tests__/getProtocolModulesInfo.test.ts rename to app/src/transformations/analysis/__tests__/getProtocolModulesInfo.test.ts diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/__tests__/utils.test.ts b/app/src/transformations/analysis/__tests__/liquids.test.ts similarity index 99% rename from app/src/organisms/Devices/ProtocolRun/SetupLiquids/__tests__/utils.test.ts rename to app/src/transformations/analysis/__tests__/liquids.test.ts index 81a32b8d23d..89db790e4f2 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/__tests__/utils.test.ts +++ b/app/src/transformations/analysis/__tests__/liquids.test.ts @@ -8,7 +8,7 @@ import { getWellGroupForLiquidId, getWellRangeForLiquidLabwarePair, getDisabledWellGroupForLiquidId, -} from '../utils' +} from '../liquids' import type { LabwareByLiquidId, Liquid } from '@opentrons/shared-data' const LABWARE_ID = diff --git a/app/src/organisms/Devices/ProtocolRun/utils/getLabwareOffsetLocation.ts b/app/src/transformations/analysis/getLabwareOffsetLocation.ts similarity index 94% rename from app/src/organisms/Devices/ProtocolRun/utils/getLabwareOffsetLocation.ts rename to app/src/transformations/analysis/getLabwareOffsetLocation.ts index 287c5ef1338..9a7ccd58841 100644 --- a/app/src/organisms/Devices/ProtocolRun/utils/getLabwareOffsetLocation.ts +++ b/app/src/transformations/analysis/getLabwareOffsetLocation.ts @@ -1,5 +1,7 @@ -import { getLabwareLocation } from './getLabwareLocation' -import { getModuleInitialLoadInfo } from './getModuleInitialLoadInfo' +import { + getModuleInitialLoadInfo, + getLabwareLocation, +} from '/app/transformations/commands' import type { LabwareOffsetLocation } from '@opentrons/api-client' import type { LoadedModule, diff --git a/app/src/organisms/Devices/ProtocolRun/utils/getLabwareRenderInfo.ts b/app/src/transformations/analysis/getLabwareRenderInfo.ts similarity index 100% rename from app/src/organisms/Devices/ProtocolRun/utils/getLabwareRenderInfo.ts rename to app/src/transformations/analysis/getLabwareRenderInfo.ts diff --git a/app/src/organisms/Devices/ProtocolRun/utils/getProtocolModulesInfo.ts b/app/src/transformations/analysis/getProtocolModulesInfo.ts similarity index 97% rename from app/src/organisms/Devices/ProtocolRun/utils/getProtocolModulesInfo.ts rename to app/src/transformations/analysis/getProtocolModulesInfo.ts index 37a5ca93a26..8a268c2694b 100644 --- a/app/src/organisms/Devices/ProtocolRun/utils/getProtocolModulesInfo.ts +++ b/app/src/transformations/analysis/getProtocolModulesInfo.ts @@ -4,7 +4,7 @@ import { getLoadedLabwareDefinitionsByUri, getPositionFromSlotId, } from '@opentrons/shared-data' -import { getModuleInitialLoadInfo } from './getModuleInitialLoadInfo' +import { getModuleInitialLoadInfo } from '../commands' import type { CompletedProtocolAnalysis, DeckDefinition, diff --git a/app/src/transformations/analysis/index.ts b/app/src/transformations/analysis/index.ts index 07ba04fd741..6194166db5e 100644 --- a/app/src/transformations/analysis/index.ts +++ b/app/src/transformations/analysis/index.ts @@ -1 +1,5 @@ export * from './parseProtocolAnalysisOutput' +export * from './getProtocolModulesInfo' +export * from './getLabwareOffsetLocation' +export * from './getLabwareRenderInfo' +export * from './liquids' diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/utils.ts b/app/src/transformations/analysis/liquids.ts similarity index 100% rename from app/src/organisms/Devices/ProtocolRun/SetupLiquids/utils.ts rename to app/src/transformations/analysis/liquids.ts diff --git a/app/src/organisms/Devices/ProtocolRun/utils/__tests__/getLocationInfoNames.test.ts b/app/src/transformations/commands/transformations/__tests__/getLocationInfoNames.test.ts similarity index 100% rename from app/src/organisms/Devices/ProtocolRun/utils/__tests__/getLocationInfoNames.test.ts rename to app/src/transformations/commands/transformations/__tests__/getLocationInfoNames.test.ts diff --git a/app/src/organisms/Devices/ProtocolRun/utils/__tests__/getModuleInitialLoadInfo.test.ts b/app/src/transformations/commands/transformations/__tests__/getModuleInitialLoadInfo.test.ts similarity index 100% rename from app/src/organisms/Devices/ProtocolRun/utils/__tests__/getModuleInitialLoadInfo.test.ts rename to app/src/transformations/commands/transformations/__tests__/getModuleInitialLoadInfo.test.ts diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLabware/__tests__/getNestedLabwareInfo.test.tsx b/app/src/transformations/commands/transformations/__tests__/getNestedLabwareInfo.test.tsx similarity index 98% rename from app/src/organisms/Devices/ProtocolRun/SetupLabware/__tests__/getNestedLabwareInfo.test.tsx rename to app/src/transformations/commands/transformations/__tests__/getNestedLabwareInfo.test.tsx index e5c54c51f54..e1233fcb1c8 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLabware/__tests__/getNestedLabwareInfo.test.tsx +++ b/app/src/transformations/commands/transformations/__tests__/getNestedLabwareInfo.test.tsx @@ -1,8 +1,9 @@ import { describe, it, expect } from 'vitest' import { mockDefinition } from '/app/redux/custom-labware/__fixtures__' import { getNestedLabwareInfo } from '../getNestedLabwareInfo' + import type { RunTimeCommand } from '@opentrons/shared-data' -import type { LabwareSetupItem } from '/app/transformations/commands' +import type { LabwareSetupItem } from '../getLabwareSetupItemGroups' const MOCK_LABWARE_ID = 'mockLabwareId' const MOCK_OTHER_LABWARE_ID = 'mockOtherLabwareId' diff --git a/app/src/organisms/Devices/ProtocolRun/utils/getLabwareLocation.ts b/app/src/transformations/commands/transformations/getLabwareLocation.ts similarity index 100% rename from app/src/organisms/Devices/ProtocolRun/utils/getLabwareLocation.ts rename to app/src/transformations/commands/transformations/getLabwareLocation.ts diff --git a/app/src/organisms/Devices/ProtocolRun/utils/getLocationInfoNames.ts b/app/src/transformations/commands/transformations/getLocationInfoNames.ts similarity index 100% rename from app/src/organisms/Devices/ProtocolRun/utils/getLocationInfoNames.ts rename to app/src/transformations/commands/transformations/getLocationInfoNames.ts diff --git a/app/src/organisms/Devices/ProtocolRun/utils/getModuleInitialLoadInfo.ts b/app/src/transformations/commands/transformations/getModuleInitialLoadInfo.ts similarity index 100% rename from app/src/organisms/Devices/ProtocolRun/utils/getModuleInitialLoadInfo.ts rename to app/src/transformations/commands/transformations/getModuleInitialLoadInfo.ts diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLabware/getNestedLabwareInfo.ts b/app/src/transformations/commands/transformations/getNestedLabwareInfo.ts similarity index 96% rename from app/src/organisms/Devices/ProtocolRun/SetupLabware/getNestedLabwareInfo.ts rename to app/src/transformations/commands/transformations/getNestedLabwareInfo.ts index fc403f2d0b2..cafc814f593 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLabware/getNestedLabwareInfo.ts +++ b/app/src/transformations/commands/transformations/getNestedLabwareInfo.ts @@ -4,7 +4,7 @@ import type { LoadModuleRunTimeCommand, RunTimeCommand, } from '@opentrons/shared-data' -import type { LabwareSetupItem } from '/app/transformations/commands' +import type { LabwareSetupItem } from './getLabwareSetupItemGroups' export interface NestedLabwareInfo { nestedLabwareDisplayName: string diff --git a/app/src/transformations/commands/transformations/index.ts b/app/src/transformations/commands/transformations/index.ts index e82277ab337..095fa7c14a7 100644 --- a/app/src/transformations/commands/transformations/index.ts +++ b/app/src/transformations/commands/transformations/index.ts @@ -2,3 +2,7 @@ export * from './getLabwareSetupItemGroups' export * from './getProtocolUsesGripper' export * from './formatDuration' export * from './formatInterval' +export * from './getModuleInitialLoadInfo' +export * from './getNestedLabwareInfo' +export * from './getLabwareLocation' +export * from './getLocationInfoNames' diff --git a/app/src/transformations/instruments/getShowPipetteCalibrationWarning.ts b/app/src/transformations/instruments/getShowPipetteCalibrationWarning.ts new file mode 100644 index 00000000000..b69d2477d17 --- /dev/null +++ b/app/src/transformations/instruments/getShowPipetteCalibrationWarning.ts @@ -0,0 +1,18 @@ +import { INCONSISTENT_PIPETTE_OFFSET } from '@opentrons/api-client' +import type { Instruments, PipetteData } from '@opentrons/api-client' + +export function getShowPipetteCalibrationWarning( + attachedInstruments?: Instruments +): boolean { + return ( + attachedInstruments?.data.some((i): i is PipetteData => { + const failuresList = + i.ok && i.data.calibratedOffset?.reasonability_check_failures != null + ? i.data.calibratedOffset?.reasonability_check_failures + : [] + if (failuresList.length > 0) { + return failuresList[0]?.kind === INCONSISTENT_PIPETTE_OFFSET + } else return false + }) ?? false + ) +} diff --git a/app/src/transformations/instruments/index.ts b/app/src/transformations/instruments/index.ts new file mode 100644 index 00000000000..50adb990a04 --- /dev/null +++ b/app/src/transformations/instruments/index.ts @@ -0,0 +1 @@ +export * from './getShowPipetteCalibrationWarning' diff --git a/app/src/organisms/Devices/getModuleTooHot.ts b/app/src/transformations/modules/getModuleTooHot.ts similarity index 100% rename from app/src/organisms/Devices/getModuleTooHot.ts rename to app/src/transformations/modules/getModuleTooHot.ts diff --git a/app/src/transformations/modules/index.ts b/app/src/transformations/modules/index.ts new file mode 100644 index 00000000000..10e30ad07b5 --- /dev/null +++ b/app/src/transformations/modules/index.ts @@ -0,0 +1 @@ +export * from './getModuleTooHot' diff --git a/app/src/organisms/Devices/ProtocolRun/utils/__tests__/getLabwareDefinitionUri.test.ts b/app/src/transformations/protocols/__tests__/getLabwareDefinitionUri.test.ts similarity index 100% rename from app/src/organisms/Devices/ProtocolRun/utils/__tests__/getLabwareDefinitionUri.test.ts rename to app/src/transformations/protocols/__tests__/getLabwareDefinitionUri.test.ts diff --git a/app/src/organisms/Devices/ProtocolRun/utils/getLabwareDefinitionUri.ts b/app/src/transformations/protocols/getLabwareDefinitionUri.ts similarity index 100% rename from app/src/organisms/Devices/ProtocolRun/utils/getLabwareDefinitionUri.ts rename to app/src/transformations/protocols/getLabwareDefinitionUri.ts diff --git a/app/src/transformations/protocols/index.ts b/app/src/transformations/protocols/index.ts new file mode 100644 index 00000000000..a59205ca683 --- /dev/null +++ b/app/src/transformations/protocols/index.ts @@ -0,0 +1 @@ +export * from './getLabwareDefinitionUri' diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/__tests__/utils.test.ts b/app/src/transformations/runs/__tests__/getLatestCurrentOffsets.test.ts similarity index 99% rename from app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/__tests__/utils.test.ts rename to app/src/transformations/runs/__tests__/getLatestCurrentOffsets.test.ts index c073e2466f6..f0ff2f8dab5 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/__tests__/utils.test.ts +++ b/app/src/transformations/runs/__tests__/getLatestCurrentOffsets.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect } from 'vitest' -import { getLatestCurrentOffsets } from '../utils' +import { getLatestCurrentOffsets } from '../getLatestCurrentOffsets' import type { LabwareOffset } from '@opentrons/api-client' describe('getLatestCurrentOffsets', () => { diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/utils.ts b/app/src/transformations/runs/getLatestCurrentOffsets.ts similarity index 100% rename from app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/utils.ts rename to app/src/transformations/runs/getLatestCurrentOffsets.ts diff --git a/app/src/transformations/runs/index.ts b/app/src/transformations/runs/index.ts index c8f12cd7d79..72f378da267 100644 --- a/app/src/transformations/runs/index.ts +++ b/app/src/transformations/runs/index.ts @@ -1,2 +1,3 @@ export * from './getRunTimeParameterValuesForRun' export * from './getRunTimeParameterFilesForRun' +export * from './getLatestCurrentOffsets'