Skip to content

Commit

Permalink
refactor(app,api-client): Delete bindings to nonexistent `pause-reque…
Browse files Browse the repository at this point in the history
…sted` run status (#15476)
  • Loading branch information
SyntaxColoring authored Jun 21, 2024
1 parent c0b17a1 commit 0ab7b7f
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 56 deletions.
2 changes: 0 additions & 2 deletions api-client/src/runs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion app/src/assets/localization/en/run_details.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 0 additions & 4 deletions app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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[] = [
Expand All @@ -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,
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -49,7 +48,6 @@ import {
mockFailedRun,
mockIdleUnstartedRun,
mockPausedRun,
mockPauseRequestedRun,
mockRunningRun,
mockStoppedRun,
mockStopRequestedRun,
Expand Down Expand Up @@ -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<OpentronsApiClient.Run>)
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)
Expand Down
2 changes: 0 additions & 2 deletions app/src/organisms/Devices/hooks/useLastRunCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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,
Expand Down
27 changes: 0 additions & 27 deletions app/src/organisms/RunTimeControl/__fixtures__/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 0ab7b7f

Please sign in to comment.