From 0ab7b7f5a93ae8d5d7712df687676d74a049c818 Mon Sep 17 00:00:00 2001 From: Max Marrone Date: Fri, 21 Jun 2024 15:06:17 -0400 Subject: [PATCH] refactor(app,api-client): Delete bindings to nonexistent `pause-requested` run status (#15476) --- api-client/src/runs/types.ts | 2 -- .../assets/localization/en/run_details.json | 1 - .../Devices/ProtocolRun/ProtocolRunHeader.tsx | 4 --- .../__tests__/ProtocolRunHeader.test.tsx | 20 -------------- .../Devices/hooks/useLastRunCommand.ts | 2 -- .../RunTimeControl/__fixtures__/index.ts | 27 ------------------- 6 files changed, 56 deletions(-) diff --git a/api-client/src/runs/types.ts b/api-client/src/runs/types.ts index 472b8ae0395..3a9e1770f49 100644 --- a/api-client/src/runs/types.ts +++ b/api-client/src/runs/types.ts @@ -13,7 +13,6 @@ export * from './commands/types' export const RUN_STATUS_IDLE = 'idle' as const export const RUN_STATUS_RUNNING = 'running' as const -export const RUN_STATUS_PAUSE_REQUESTED = 'pause-requested' as const export const RUN_STATUS_PAUSED = 'paused' export const RUN_STATUS_STOP_REQUESTED = 'stop-requested' as const export const RUN_STATUS_STOPPED = 'stopped' as const @@ -26,7 +25,6 @@ export const RUN_STATUS_AWAITING_RECOVERY = 'awaiting-recovery' as const export type RunStatus = | typeof RUN_STATUS_IDLE | typeof RUN_STATUS_RUNNING - | typeof RUN_STATUS_PAUSE_REQUESTED | typeof RUN_STATUS_PAUSED | typeof RUN_STATUS_STOP_REQUESTED | typeof RUN_STATUS_STOPPED diff --git a/app/src/assets/localization/en/run_details.json b/app/src/assets/localization/en/run_details.json index 862656fed47..18127568031 100644 --- a/app/src/assets/localization/en/run_details.json +++ b/app/src/assets/localization/en/run_details.json @@ -129,7 +129,6 @@ "status_failed": "Failed", "status_finishing": "Finishing", "status_idle": "Not started", - "status_pause-requested": "Pause requested", "status_paused": "Paused", "status_running": "Running", "status_stop-requested": "Stop requested", diff --git a/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader.tsx b/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader.tsx index e1a4326acd4..8b5f585dd05 100644 --- a/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader.tsx +++ b/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader.tsx @@ -6,7 +6,6 @@ import { Link, useHistory } from 'react-router-dom' import { RUN_STATUS_IDLE, RUN_STATUS_RUNNING, - RUN_STATUS_PAUSE_REQUESTED, RUN_STATUS_PAUSED, RUN_STATUS_STOP_REQUESTED, RUN_STATUS_STOPPED, @@ -113,7 +112,6 @@ const EQUIPMENT_POLL_MS = 5000 const CANCELLABLE_STATUSES = [ RUN_STATUS_RUNNING, RUN_STATUS_PAUSED, - RUN_STATUS_PAUSE_REQUESTED, RUN_STATUS_BLOCKED_BY_OPEN_DOOR, RUN_STATUS_IDLE, RUN_STATUS_AWAITING_RECOVERY, @@ -520,7 +518,6 @@ function DisplayRunStatus(props: DisplayRunStatusProps): JSX.Element { const START_RUN_STATUSES: RunStatus[] = [ RUN_STATUS_IDLE, RUN_STATUS_PAUSED, - RUN_STATUS_PAUSE_REQUESTED, RUN_STATUS_BLOCKED_BY_OPEN_DOOR, ] const RUN_AGAIN_STATUSES: RunStatus[] = [ @@ -531,7 +528,6 @@ const RUN_AGAIN_STATUSES: RunStatus[] = [ ] const DISABLED_STATUSES: RunStatus[] = [ RUN_STATUS_FINISHING, - RUN_STATUS_PAUSE_REQUESTED, RUN_STATUS_STOP_REQUESTED, RUN_STATUS_BLOCKED_BY_OPEN_DOOR, ] diff --git a/app/src/organisms/Devices/ProtocolRun/__tests__/ProtocolRunHeader.test.tsx b/app/src/organisms/Devices/ProtocolRun/__tests__/ProtocolRunHeader.test.tsx index f199d5982bd..b0e31ca524a 100644 --- a/app/src/organisms/Devices/ProtocolRun/__tests__/ProtocolRunHeader.test.tsx +++ b/app/src/organisms/Devices/ProtocolRun/__tests__/ProtocolRunHeader.test.tsx @@ -8,7 +8,6 @@ import { RUN_STATUS_IDLE, RUN_STATUS_RUNNING, RUN_STATUS_PAUSED, - RUN_STATUS_PAUSE_REQUESTED, RUN_STATUS_STOP_REQUESTED, RUN_STATUS_STOPPED, RUN_STATUS_FAILED, @@ -49,7 +48,6 @@ import { mockFailedRun, mockIdleUnstartedRun, mockPausedRun, - mockPauseRequestedRun, mockRunningRun, mockStoppedRun, mockStopRequestedRun, @@ -579,24 +577,6 @@ describe('ProtocolRunHeader', () => { }) }) - it('renders a disabled Resume Run button and when pause requested', () => { - when(vi.mocked(useNotifyRunQuery)) - .calledWith(RUN_ID) - .thenReturn({ - data: { data: mockPauseRequestedRun }, - } as UseQueryResult) - when(vi.mocked(useRunStatus)) - .calledWith(RUN_ID) - .thenReturn(RUN_STATUS_PAUSE_REQUESTED) - - render() - - const button = screen.getByRole('button', { name: 'Resume run' }) - expect(button).toBeDisabled() - screen.getByRole('button', { name: 'Cancel run' }) - screen.getByText('Pause requested') - }) - it('renders a disabled Canceling Run button and when stop requested', () => { when(vi.mocked(useNotifyRunQuery)) .calledWith(RUN_ID) diff --git a/app/src/organisms/Devices/hooks/useLastRunCommand.ts b/app/src/organisms/Devices/hooks/useLastRunCommand.ts index b0840b888ae..67bfe62cb28 100644 --- a/app/src/organisms/Devices/hooks/useLastRunCommand.ts +++ b/app/src/organisms/Devices/hooks/useLastRunCommand.ts @@ -4,7 +4,6 @@ import { RUN_STATUS_FINISHING, RUN_STATUS_IDLE, RUN_STATUS_PAUSED, - RUN_STATUS_PAUSE_REQUESTED, RUN_STATUS_RUNNING, RUN_STATUS_STOP_REQUESTED, } from '@opentrons/api-client' @@ -18,7 +17,6 @@ import type { CommandsData, RunCommandSummary } from '@opentrons/api-client' const LIVE_RUN_STATUSES = [ RUN_STATUS_IDLE, RUN_STATUS_PAUSED, - RUN_STATUS_PAUSE_REQUESTED, RUN_STATUS_STOP_REQUESTED, RUN_STATUS_RUNNING, RUN_STATUS_FINISHING, diff --git a/app/src/organisms/RunTimeControl/__fixtures__/index.ts b/app/src/organisms/RunTimeControl/__fixtures__/index.ts index f6beb7f74bc..235c49fbcde 100644 --- a/app/src/organisms/RunTimeControl/__fixtures__/index.ts +++ b/app/src/organisms/RunTimeControl/__fixtures__/index.ts @@ -3,7 +3,6 @@ import { RUN_ACTION_TYPE_PAUSE, RUN_ACTION_TYPE_STOP, RUN_STATUS_IDLE, - RUN_STATUS_PAUSE_REQUESTED, RUN_STATUS_PAUSED, RUN_STATUS_RUNNING, RUN_STATUS_SUCCEEDED, @@ -45,32 +44,6 @@ export const mockPausedRun: RunData = { runTimeParameters: [], } -export const mockPauseRequestedRun: RunData = { - id: RUN_ID_1, - createdAt: '2021-10-07T18:44:49.366581+00:00', - current: true, - status: RUN_STATUS_PAUSE_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, - }, - ], - errors: [], - pipettes: [], - labware: [], - modules: [], - liquids: [], - runTimeParameters: [], -} - export const mockRunningRun: RunData = { id: RUN_ID_2, createdAt: '2021-10-07T18:44:49.366581+00:00',