From 3090f184c68dd2a5f370ab2892bba1708e0ae74f Mon Sep 17 00:00:00 2001 From: ncdiehl11 Date: Tue, 7 May 2024 15:02:08 -0400 Subject: [PATCH] fix(app): ensure terminal run preview shows detail for load liquid commands After a terminal run, we access the run record's data for commands, labware, pipettes, and modules. We need to extend this to liquids so that the liquid's ID from its load command matches that on the analysis-like object passed to command text. --- api-client/src/runs/types.ts | 2 ++ .../organisms/InterventionModal/__fixtures__/index.ts | 8 ++++++++ app/src/organisms/RunPreview/index.tsx | 1 + app/src/organisms/RunTimeControl/__fixtures__/index.ts | 9 +++++++++ react-api-client/src/runs/__fixtures__/runs.ts | 2 ++ 5 files changed, 22 insertions(+) diff --git a/api-client/src/runs/types.ts b/api-client/src/runs/types.ts index 36c5f9a3a20..761a60a8112 100644 --- a/api-client/src/runs/types.ts +++ b/api-client/src/runs/types.ts @@ -1,4 +1,5 @@ import type { + Liquid, LoadedLabware, LoadedModule, LoadedPipette, @@ -46,6 +47,7 @@ export interface LegacyGoodRunData { pipettes: LoadedPipette[] labware: LoadedLabware[] modules: LoadedModule[] + liquids: Liquid[] protocolId?: string labwareOffsets?: LabwareOffset[] runTimeParameters: RunTimeParameter[] diff --git a/app/src/organisms/InterventionModal/__fixtures__/index.ts b/app/src/organisms/InterventionModal/__fixtures__/index.ts index 2611fe19b03..4d7b7dbc87d 100644 --- a/app/src/organisms/InterventionModal/__fixtures__/index.ts +++ b/app/src/organisms/InterventionModal/__fixtures__/index.ts @@ -8,6 +8,7 @@ import { import type { RunData } from '@opentrons/api-client' import type { LabwareDefinitionsByUri, + Liquid, LoadedLabware, LoadedModule, } from '@opentrons/shared-data' @@ -176,6 +177,12 @@ export const mockThermocyclerModule: LoadedModule = { serialNumber: 'dummySerialTC', } +export const mockLiquid: Liquid = { + id: 'mockLiquid', + displayName: 'mock liquid', + description: 'this is my mock liquid description', +} + export const mockRunData: RunData = { id: 'mockRunData', createdAt: '', @@ -188,6 +195,7 @@ export const mockRunData: RunData = { pipettes: [], labware: [mockLabwareOnModule, mockLabwareOnSlot, mockLabwareOffDeck], modules: [mockModule], + liquids: [mockLiquid], runTimeParameters: [], } diff --git a/app/src/organisms/RunPreview/index.tsx b/app/src/organisms/RunPreview/index.tsx index 9f820e928df..44388d6a339 100644 --- a/app/src/organisms/RunPreview/index.tsx +++ b/app/src/organisms/RunPreview/index.tsx @@ -92,6 +92,7 @@ export const RunPreviewComponent = ( labware: runRecord.data.labware ?? [], modules: runRecord.data.modules ?? [], pipettes: runRecord.data.pipettes ?? [], + liquids: runRecord.data.liquids ?? [], commands: commands, } : robotSideAnalysis diff --git a/app/src/organisms/RunTimeControl/__fixtures__/index.ts b/app/src/organisms/RunTimeControl/__fixtures__/index.ts index 33f2e0c4393..bb4b45a61f3 100644 --- a/app/src/organisms/RunTimeControl/__fixtures__/index.ts +++ b/app/src/organisms/RunTimeControl/__fixtures__/index.ts @@ -41,6 +41,7 @@ export const mockPausedRun: RunData = { pipettes: [], labware: [], modules: [], + liquids: [], runTimeParameters: [], } @@ -66,6 +67,7 @@ export const mockPauseRequestedRun: RunData = { pipettes: [], labware: [], modules: [], + liquids: [], runTimeParameters: [], } @@ -96,6 +98,7 @@ export const mockRunningRun: RunData = { pipettes: [], labware: [], modules: [], + liquids: [], runTimeParameters: [], } @@ -136,6 +139,7 @@ export const mockFailedRun: RunData = { pipettes: [], labware: [], modules: [], + liquids: [], runTimeParameters: [], } @@ -171,6 +175,7 @@ export const mockStopRequestedRun: RunData = { pipettes: [], labware: [], modules: [], + liquids: [], runTimeParameters: [], } @@ -206,6 +211,7 @@ export const mockStoppedRun: RunData = { pipettes: [], labware: [], modules: [], + liquids: [], runTimeParameters: [], } @@ -236,6 +242,7 @@ export const mockSucceededRun: RunData = { pipettes: [], labware: [], modules: [], + liquids: [], runTimeParameters: [], } @@ -250,6 +257,7 @@ export const mockIdleUnstartedRun: RunData = { pipettes: [], labware: [], modules: [], + liquids: [], runTimeParameters: [], } @@ -280,6 +288,7 @@ export const mockIdleStartedRun: RunData = { pipettes: [], labware: [], modules: [], + liquids: [], runTimeParameters: [], } diff --git a/react-api-client/src/runs/__fixtures__/runs.ts b/react-api-client/src/runs/__fixtures__/runs.ts index 9320df9fbea..47a432f5a5f 100644 --- a/react-api-client/src/runs/__fixtures__/runs.ts +++ b/react-api-client/src/runs/__fixtures__/runs.ts @@ -32,6 +32,7 @@ export const mockPausedRun: RunData = { pipettes: [], labware: [], modules: [], + liquids: [], runTimeParameters: [], } @@ -62,6 +63,7 @@ export const mockRunningRun: RunData = { pipettes: [], labware: [], modules: [], + liquids: [], runTimeParameters: [], }