From f881997c9c0a33e1264f92805bfbebd360bc3c9d Mon Sep 17 00:00:00 2001 From: Jethary Rader <66035149+jerader@users.noreply.github.com> Date: Tue, 19 Mar 2024 15:11:17 -0400 Subject: [PATCH] feat(app): add value key to RTP type (#14692) closes AUTH-216 --- .../ProtocolRun/ProtocolRunRunTimeParameters.tsx | 11 +++++++++++ .../__tests__/ProtocolRunRuntimeParameters.test.tsx | 4 ++++ .../__tests__/ProtocolParameters.test.tsx | 4 ++++ app/src/organisms/ProtocolSetupParameters/index.tsx | 11 +++++++++++ app/src/pages/ProtocolDetails/fixtures.ts | 9 +++++++++ app/src/pages/Protocols/hooks/index.ts | 11 +++++++++++ shared-data/js/types.ts | 1 + 7 files changed, 51 insertions(+) diff --git a/app/src/organisms/Devices/ProtocolRun/ProtocolRunRunTimeParameters.tsx b/app/src/organisms/Devices/ProtocolRun/ProtocolRunRunTimeParameters.tsx index 965ab0c085e..cb7766e9976 100644 --- a/app/src/organisms/Devices/ProtocolRun/ProtocolRunRunTimeParameters.tsx +++ b/app/src/organisms/Devices/ProtocolRun/ProtocolRunRunTimeParameters.tsx @@ -24,6 +24,7 @@ import type { RunTimeParameter } from '@opentrons/shared-data' const mockData: RunTimeParameter[] = [ { + value: false, displayName: 'Dry Run', variableName: 'DRYRUN', description: 'Is this a dry or wet run? Wet is true, dry is false', @@ -31,6 +32,7 @@ const mockData: RunTimeParameter[] = [ default: false, }, { + value: true, displayName: 'Use Gripper', variableName: 'USE_GRIPPER', description: 'For using the gripper.', @@ -38,6 +40,7 @@ const mockData: RunTimeParameter[] = [ default: true, }, { + value: true, displayName: 'Trash Tips', variableName: 'TIP_TRASH', description: @@ -46,6 +49,7 @@ const mockData: RunTimeParameter[] = [ default: true, }, { + value: true, displayName: 'Deactivate Temperatures', variableName: 'DEACTIVATE_TEMP', description: 'deactivate temperature on the module', @@ -53,6 +57,7 @@ const mockData: RunTimeParameter[] = [ default: true, }, { + value: 4, displayName: 'Columns of Samples', variableName: 'COLUMNS', description: 'How many columns do you want?', @@ -62,6 +67,7 @@ const mockData: RunTimeParameter[] = [ default: 4, }, { + value: 6, displayName: 'PCR Cycles', variableName: 'PCR_CYCLES', description: 'number of PCR cycles on a thermocycler', @@ -71,6 +77,7 @@ const mockData: RunTimeParameter[] = [ default: 6, }, { + value: 6.5, displayName: 'EtoH Volume', variableName: 'ETOH_VOLUME', description: '70% ethanol volume', @@ -81,6 +88,7 @@ const mockData: RunTimeParameter[] = [ default: 6.5, }, { + value: 'none', displayName: 'Default Module Offsets', variableName: 'DEFAULT_OFFSETS', description: 'default module offsets for temp, H-S, and none', @@ -102,6 +110,7 @@ const mockData: RunTimeParameter[] = [ default: 'none', }, { + value: 'left', displayName: 'pipette mount', variableName: 'mont', description: 'pipette mount', @@ -119,6 +128,7 @@ const mockData: RunTimeParameter[] = [ default: 'left', }, { + value: 'flex', displayName: 'short test case', variableName: 'short 2 options', description: 'this play 2 short options', @@ -136,6 +146,7 @@ const mockData: RunTimeParameter[] = [ default: 'flex', }, { + value: 'flex', displayName: 'long test case', variableName: 'long 2 options', description: 'this play 2 long options', diff --git a/app/src/organisms/Devices/ProtocolRun/__tests__/ProtocolRunRuntimeParameters.test.tsx b/app/src/organisms/Devices/ProtocolRun/__tests__/ProtocolRunRuntimeParameters.test.tsx index e322d37b831..368c666d33f 100644 --- a/app/src/organisms/Devices/ProtocolRun/__tests__/ProtocolRunRuntimeParameters.test.tsx +++ b/app/src/organisms/Devices/ProtocolRun/__tests__/ProtocolRunRuntimeParameters.test.tsx @@ -27,6 +27,7 @@ const mockRunTimeParameterData: RunTimeParameter[] = [ description: 'Is this a dry or wet run? Wet is true, dry is false', type: 'boolean', default: false, + value: false, }, { displayName: 'Columns of Samples', @@ -36,6 +37,7 @@ const mockRunTimeParameterData: RunTimeParameter[] = [ min: 1, max: 14, default: 4, + value: 4, }, { displayName: 'EtoH Volume', @@ -46,12 +48,14 @@ const mockRunTimeParameterData: RunTimeParameter[] = [ min: 1.5, max: 10.0, default: 6.5, + value: 6.5, }, { displayName: 'Default Module Offsets', variableName: 'DEFAULT_OFFSETS', description: 'default module offsets for temp, H-S, and none', type: 'str', + value: 'none', choices: [ { displayName: 'No offsets', diff --git a/app/src/organisms/ProtocolDetails/ProtocolParameters/__tests__/ProtocolParameters.test.tsx b/app/src/organisms/ProtocolDetails/ProtocolParameters/__tests__/ProtocolParameters.test.tsx index 8c7724e3add..5e3574200b6 100644 --- a/app/src/organisms/ProtocolDetails/ProtocolParameters/__tests__/ProtocolParameters.test.tsx +++ b/app/src/organisms/ProtocolDetails/ProtocolParameters/__tests__/ProtocolParameters.test.tsx @@ -19,6 +19,7 @@ const mockRunTimeParameter: RunTimeParameter[] = [ 'to throw tip into the trash or to not throw tip into the trash', type: 'boolean', default: true, + value: true, }, { displayName: 'EtoH Volume', @@ -29,12 +30,14 @@ const mockRunTimeParameter: RunTimeParameter[] = [ min: 1.5, max: 10.0, default: 6.5, + value: 6.5, }, { displayName: 'Default Module Offsets', variableName: 'DEFAULT_OFFSETS', description: 'default module offsets for temp, H-S, and none', type: 'str', + value: 'none', choices: [ { displayName: 'No offsets', @@ -56,6 +59,7 @@ const mockRunTimeParameter: RunTimeParameter[] = [ variableName: 'mont', description: 'pipette mount', type: 'str', + value: 'left', choices: [ { displayName: 'Left', diff --git a/app/src/organisms/ProtocolSetupParameters/index.tsx b/app/src/organisms/ProtocolSetupParameters/index.tsx index ac3403dd740..b38b86c6b78 100644 --- a/app/src/organisms/ProtocolSetupParameters/index.tsx +++ b/app/src/organisms/ProtocolSetupParameters/index.tsx @@ -16,6 +16,7 @@ import type { RunTimeParameter } from '@opentrons/shared-data' const mockData: RunTimeParameter[] = [ { + value: false, displayName: 'Dry Run', variableName: 'DRYRUN', description: 'Is this a dry or wet run? Wet is true, dry is false', @@ -23,6 +24,7 @@ const mockData: RunTimeParameter[] = [ default: false, }, { + value: true, displayName: 'Use Gripper', variableName: 'USE_GRIPPER', description: 'For using the gripper.', @@ -30,6 +32,7 @@ const mockData: RunTimeParameter[] = [ default: true, }, { + value: true, displayName: 'Trash Tips', variableName: 'TIP_TRASH', description: @@ -38,6 +41,7 @@ const mockData: RunTimeParameter[] = [ default: true, }, { + value: true, displayName: 'Deactivate Temperatures', variableName: 'DEACTIVATE_TEMP', description: 'deactivate temperature on the module', @@ -45,6 +49,7 @@ const mockData: RunTimeParameter[] = [ default: true, }, { + value: 4, displayName: 'Columns of Samples', variableName: 'COLUMNS', description: 'How many columns do you want?', @@ -54,6 +59,7 @@ const mockData: RunTimeParameter[] = [ default: 4, }, { + value: 6, displayName: 'PCR Cycles', variableName: 'PCR_CYCLES', description: 'number of PCR cycles on a thermocycler', @@ -63,6 +69,7 @@ const mockData: RunTimeParameter[] = [ default: 6, }, { + value: 6.5, displayName: 'EtoH Volume', variableName: 'ETOH_VOLUME', description: '70% ethanol volume', @@ -73,6 +80,7 @@ const mockData: RunTimeParameter[] = [ default: 6.5, }, { + value: 'none', displayName: 'Default Module Offsets', variableName: 'DEFAULT_OFFSETS', description: 'default module offsets for temp, H-S, and none', @@ -94,6 +102,7 @@ const mockData: RunTimeParameter[] = [ default: 'none', }, { + value: 'left', displayName: 'pipette mount', variableName: 'mont', description: 'pipette mount', @@ -111,6 +120,7 @@ const mockData: RunTimeParameter[] = [ default: 'left', }, { + value: 'flex', displayName: 'short test case', variableName: 'short 2 options', description: 'this play 2 short options', @@ -128,6 +138,7 @@ const mockData: RunTimeParameter[] = [ default: 'flex', }, { + value: 'flex', displayName: 'long test case', variableName: 'long 2 options', description: 'this play 2 long options', diff --git a/app/src/pages/ProtocolDetails/fixtures.ts b/app/src/pages/ProtocolDetails/fixtures.ts index 4cb4649fd7e..4f5cfa6cdad 100644 --- a/app/src/pages/ProtocolDetails/fixtures.ts +++ b/app/src/pages/ProtocolDetails/fixtures.ts @@ -7,6 +7,7 @@ export const mockRunTimeParameterData: RunTimeParameter[] = [ description: 'a dry run description', type: 'boolean', default: false, + value: false, }, { displayName: 'Use Gripper', @@ -14,6 +15,7 @@ export const mockRunTimeParameterData: RunTimeParameter[] = [ description: '', type: 'boolean', default: true, + value: true, }, { displayName: 'Trash Tips', @@ -21,6 +23,7 @@ export const mockRunTimeParameterData: RunTimeParameter[] = [ description: 'throw tip in trash', type: 'boolean', default: true, + value: true, }, { displayName: 'Deactivate Temperatures', @@ -28,6 +31,7 @@ export const mockRunTimeParameterData: RunTimeParameter[] = [ description: 'deactivate temperature?', type: 'boolean', default: true, + value: true, }, { displayName: 'Columns of Samples', @@ -38,6 +42,7 @@ export const mockRunTimeParameterData: RunTimeParameter[] = [ min: 1, max: 14, default: 4, + value: 4, }, { displayName: 'PCR Cycles', @@ -47,6 +52,7 @@ export const mockRunTimeParameterData: RunTimeParameter[] = [ min: 1, max: 10, default: 6, + value: 6, }, { displayName: 'EtoH Volume', @@ -56,10 +62,12 @@ export const mockRunTimeParameterData: RunTimeParameter[] = [ min: 1.5, max: 10.0, default: 6.5, + value: 6.5, }, { displayName: 'Default Module Offsets', variableName: 'DEFAULT_OFFSETS', + value: 'none', description: '', type: 'str', choices: [ @@ -94,5 +102,6 @@ export const mockRunTimeParameterData: RunTimeParameter[] = [ }, ], default: '2', + value: '2', }, ] diff --git a/app/src/pages/Protocols/hooks/index.ts b/app/src/pages/Protocols/hooks/index.ts index 975d03c4690..9931a49444f 100644 --- a/app/src/pages/Protocols/hooks/index.ts +++ b/app/src/pages/Protocols/hooks/index.ts @@ -202,6 +202,7 @@ export const useRunTimeParameters = ( const mockData: RunTimeParameter[] = [ { + value: false, displayName: 'Dry Run', variableName: 'DRYRUN', description: 'Is this a dry or wet run? Wet is true, dry is false', @@ -209,6 +210,7 @@ export const useRunTimeParameters = ( default: false, }, { + value: true, displayName: 'Use Gripper', variableName: 'USE_GRIPPER', description: 'For using the gripper.', @@ -216,6 +218,7 @@ export const useRunTimeParameters = ( default: true, }, { + value: true, displayName: 'Trash Tips', variableName: 'TIP_TRASH', description: @@ -224,6 +227,7 @@ export const useRunTimeParameters = ( default: true, }, { + value: true, displayName: 'Deactivate Temperatures', variableName: 'DEACTIVATE_TEMP', description: 'deactivate temperature on the module', @@ -231,6 +235,7 @@ export const useRunTimeParameters = ( default: true, }, { + value: 4, displayName: 'Columns of Samples', variableName: 'COLUMNS', description: 'How many columns do you want?', @@ -240,6 +245,7 @@ export const useRunTimeParameters = ( default: 4, }, { + value: 6, displayName: 'PCR Cycles', variableName: 'PCR_CYCLES', description: 'number of PCR cycles on a thermocycler', @@ -249,6 +255,7 @@ export const useRunTimeParameters = ( default: 6, }, { + value: 6.5, displayName: 'EtoH Volume', variableName: 'ETOH_VOLUME', description: '70% ethanol volume', @@ -259,6 +266,7 @@ export const useRunTimeParameters = ( default: 6.5, }, { + value: 'none', displayName: 'Default Module Offsets', variableName: 'DEFAULT_OFFSETS', description: 'default module offsets for temp, H-S, and none', @@ -280,6 +288,7 @@ export const useRunTimeParameters = ( default: 'none', }, { + value: 'left', displayName: 'pipette mount', variableName: 'mont', description: 'pipette mount', @@ -297,6 +306,7 @@ export const useRunTimeParameters = ( default: 'left', }, { + value: 'flex', displayName: 'short test case', variableName: 'short 2 options', description: 'this play 2 short options', @@ -314,6 +324,7 @@ export const useRunTimeParameters = ( default: 'flex', }, { + value: 'flex', displayName: 'long test case', variableName: 'long 2 options', description: 'this play 2 long options', diff --git a/shared-data/js/types.ts b/shared-data/js/types.ts index 45bcee05ff8..dd0edd86530 100644 --- a/shared-data/js/types.ts +++ b/shared-data/js/types.ts @@ -621,6 +621,7 @@ interface BaseRunTimeParameter { variableName: string description: string type: RunTimeParameterType + value: unknown suffix?: string }