Skip to content

Commit 3a0a6dc

Browse files
authored
refactor(protocol-designer, components): scrubber is out the door, bye bye bye (#20130)
1 parent eb4479c commit 3a0a6dc

File tree

18 files changed

+32
-1016
lines changed

18 files changed

+32
-1016
lines changed

components/src/organisms/CommandText/__tests__/CommandText.test.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ import {
99

1010
import { i18n } from '../../../i18n'
1111
import { renderWithProviders } from '../../../testing/utils'
12-
import { getCommandTextData } from '../../ProtocolTimelineScrubber/utils'
1312
import { mockRobotSideAnalysis } from '../fixtures'
14-
import { CommandText } from '../index'
13+
import { CommandText, getCommandTextData } from '../index'
1514

1615
import type {
1716
AspirateInPlaceRunTimeCommand,
@@ -33,7 +32,7 @@ import type {
3332
PrepareToAspirateRunTimeCommand,
3433
RunTimeCommand,
3534
} from '@opentrons/shared-data'
36-
import type { CommandTextData } from '../../ProtocolTimelineScrubber'
35+
import type { CommandTextData } from '../index'
3736

3837
const mockCommandTextData: CommandTextData = {
3938
commands: mockRobotSideAnalysis.commands,
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import type {
2+
CompletedProtocolAnalysis,
3+
ProtocolAnalysisOutput,
4+
RunTimeCommand,
5+
} from '@opentrons/shared-data'
6+
import type { CommandTextData } from './useCommandTextString'
7+
8+
export function getCommandTextData(
9+
protocolData: CompletedProtocolAnalysis | ProtocolAnalysisOutput,
10+
protocolCommands?: RunTimeCommand[]
11+
): CommandTextData {
12+
const { pipettes, labware, modules, liquids } = protocolData
13+
const commands =
14+
'commands' in protocolData
15+
? protocolData.commands
16+
: (protocolCommands ?? [])
17+
return { commands, pipettes, labware, modules, liquids }
18+
}

components/src/organisms/CommandText/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ import type {
1414
RunTimeCommand,
1515
} from '@opentrons/shared-data'
1616
import type { StyleProps } from '../../primitives'
17-
import type { CommandTextData } from '../ProtocolTimelineScrubber/types'
1817
import type {
18+
CommandTextData,
1919
GetTCRunExtendedProfileCommandTextResult,
2020
GetTCRunProfileCommandTextResult,
2121
GetTCStartRunExtendedProfileCommandTextResult,
2222
} from './useCommandTextString'
2323

2424
export * from './useCommandTextString'
25+
export * from './getCommandData'
26+
2527
interface LegacySTProps {
2628
as?: ComponentProps<typeof LegacyStyledText>['as']
2729
modernStyledTextDefaults?: false

components/src/organisms/CommandText/useCommandTextString/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import type {
88
RobotType,
99
RunTimeCommand,
1010
} from '@opentrons/shared-data'
11-
import type { CommandTextData } from '../../ProtocolTimelineScrubber/types'
1211
import type {
1312
GetDirectTranslationCommandText,
1413
TCProfileCycleText,
@@ -20,7 +19,7 @@ export * from './utils'
2019
export interface UseCommandTextStringParams {
2120
command: RunTimeCommand | null
2221
allRunDefs: LabwareDefinition[]
23-
commandTextData: CommandTextData | null
22+
commandTextData: utils.CommandTextData | null
2423
robotType: RobotType
2524
}
2625

components/src/organisms/CommandText/useCommandTextString/utils/types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type {
2+
CompletedProtocolAnalysis,
23
LoadedLabware,
34
LoadedModule,
45
LoadedPipette,
@@ -17,3 +18,8 @@ export type LoadedPipettes = LoadedPipette[] | Record<string, LoadedPipette>
1718
export type LoadedLabwares = LoadedLabware[] | Record<string, LoadedLabware>
1819

1920
export type LoadedModules = LoadedModule[] | Record<string, LoadedModule>
21+
22+
export type CommandTextData = Pick<
23+
CompletedProtocolAnalysis,
24+
'pipettes' | 'labware' | 'modules' | 'liquids' | 'commands'
25+
>

components/src/organisms/ProtocolTimelineScrubber/CommandItem.tsx

Lines changed: 0 additions & 115 deletions
This file was deleted.

0 commit comments

Comments
 (0)