diff --git a/app/src/organisms/ChooseRobotSlideout/__tests__/ChooseRobotSlideout.test.tsx b/app/src/organisms/ChooseRobotSlideout/__tests__/ChooseRobotSlideout.test.tsx index ffaaf0f11eb..18bdf233f75 100644 --- a/app/src/organisms/ChooseRobotSlideout/__tests__/ChooseRobotSlideout.test.tsx +++ b/app/src/organisms/ChooseRobotSlideout/__tests__/ChooseRobotSlideout.test.tsx @@ -48,7 +48,7 @@ const mockRunTimeParameters: RunTimeParameter[] = [ value: false, variableName: 'DRYRUN', description: 'Is this a dry or wet run? Wet is true, dry is false', - type: 'boolean', + type: 'bool', default: false, }, { @@ -226,7 +226,7 @@ describe('ChooseRobotSlideout', () => { }) screen.getByText(param.displayName) - if (param.type === 'boolean' || 'choices' in param) { + if (param.type === 'bool' || 'choices' in param) { screen.getByText(param.description) } else { if (param.type === 'int') { diff --git a/app/src/organisms/ChooseRobotSlideout/index.tsx b/app/src/organisms/ChooseRobotSlideout/index.tsx index c6061d437e7..b21e417774b 100644 --- a/app/src/organisms/ChooseRobotSlideout/index.tsx +++ b/app/src/organisms/ChooseRobotSlideout/index.tsx @@ -422,7 +422,7 @@ export function ChooseRobotSlideout( }} /> ) - } else if (runtimeParam.type === 'boolean') { + } else if (runtimeParam.type === 'bool') { return ( { displayName: 'Dry Run', variableName: 'DRYRUN', description: 'Is this a dry or wet run? Wet is true, dry is false', - type: 'boolean', + type: 'bool', default: false, value: true, }, diff --git a/app/src/organisms/ProtocolDetails/ProtocolParameters/__tests__/ProtocolParameters.test.tsx b/app/src/organisms/ProtocolDetails/ProtocolParameters/__tests__/ProtocolParameters.test.tsx index 727ca022890..a752d19c8a4 100644 --- a/app/src/organisms/ProtocolDetails/ProtocolParameters/__tests__/ProtocolParameters.test.tsx +++ b/app/src/organisms/ProtocolDetails/ProtocolParameters/__tests__/ProtocolParameters.test.tsx @@ -25,7 +25,7 @@ const mockRunTimeParameter: RunTimeParameter[] = [ variableName: 'TIP_TRASH', description: 'to throw tip into the trash or to not throw tip into the trash', - type: 'boolean', + type: 'bool', default: true, value: true, }, diff --git a/app/src/organisms/ProtocolSetupParameters/index.tsx b/app/src/organisms/ProtocolSetupParameters/index.tsx index c99c4ebeff6..d3081159365 100644 --- a/app/src/organisms/ProtocolSetupParameters/index.tsx +++ b/app/src/organisms/ProtocolSetupParameters/index.tsx @@ -24,7 +24,7 @@ export const mockData: RunTimeParameter[] = [ displayName: 'Dry Run', variableName: 'DRYRUN', description: 'Is this a dry or wet run? Wet is true, dry is false', - type: 'boolean', + type: 'bool', default: false, }, { @@ -32,7 +32,7 @@ export const mockData: RunTimeParameter[] = [ displayName: 'Use Gripper', variableName: 'USE_GRIPPER', description: 'For using the gripper.', - type: 'boolean', + type: 'bool', default: true, }, { @@ -41,7 +41,7 @@ export const mockData: RunTimeParameter[] = [ variableName: 'TIP_TRASH', description: 'to throw tip into the trash or to not throw tip into the trash', - type: 'boolean', + type: 'bool', default: true, }, { @@ -49,7 +49,7 @@ export const mockData: RunTimeParameter[] = [ displayName: 'Deactivate Temperatures', variableName: 'DEACTIVATE_TEMP', description: 'deactivate temperature on the module', - type: 'boolean', + type: 'bool', default: true, }, { @@ -224,7 +224,7 @@ export function ProtocolSetupParameters({ return ( console.log('TODO: wire this up')} diff --git a/app/src/pages/ProtocolDetails/Parameters.tsx b/app/src/pages/ProtocolDetails/Parameters.tsx index 0e12e8d7997..c43b56d7242 100644 --- a/app/src/pages/ProtocolDetails/Parameters.tsx +++ b/app/src/pages/ProtocolDetails/Parameters.tsx @@ -70,7 +70,7 @@ export const Parameters = (props: { protocolId: string }): JSX.Element => { } switch (type) { - case 'boolean': { + case 'bool': { return t('on_off') } case 'float': diff --git a/app/src/pages/ProtocolDetails/fixtures.ts b/app/src/pages/ProtocolDetails/fixtures.ts index 4f5cfa6cdad..d1752853bda 100644 --- a/app/src/pages/ProtocolDetails/fixtures.ts +++ b/app/src/pages/ProtocolDetails/fixtures.ts @@ -5,7 +5,7 @@ export const mockRunTimeParameterData: RunTimeParameter[] = [ displayName: 'Dry Run', variableName: 'DRYRUN', description: 'a dry run description', - type: 'boolean', + type: 'bool', default: false, value: false, }, @@ -13,7 +13,7 @@ export const mockRunTimeParameterData: RunTimeParameter[] = [ displayName: 'Use Gripper', variableName: 'USE_GRIPPER', description: '', - type: 'boolean', + type: 'bool', default: true, value: true, }, @@ -21,7 +21,7 @@ export const mockRunTimeParameterData: RunTimeParameter[] = [ displayName: 'Trash Tips', variableName: 'TIP_TRASH', description: 'throw tip in trash', - type: 'boolean', + type: 'bool', default: true, value: true, }, @@ -29,7 +29,7 @@ export const mockRunTimeParameterData: RunTimeParameter[] = [ displayName: 'Deactivate Temperatures', variableName: 'DEACTIVATE_TEMP', description: 'deactivate temperature?', - type: 'boolean', + type: 'bool', default: true, value: true, }, diff --git a/app/src/pages/Protocols/hooks/__tests__/hooks.test.tsx b/app/src/pages/Protocols/hooks/__tests__/hooks.test.tsx index ce09a610ff7..aa8d9f07e8a 100644 --- a/app/src/pages/Protocols/hooks/__tests__/hooks.test.tsx +++ b/app/src/pages/Protocols/hooks/__tests__/hooks.test.tsx @@ -38,28 +38,28 @@ const mockRTPData = [ displayName: 'Dry Run', variableName: 'DRYRUN', description: 'a dry run description', - type: 'boolean', + type: 'bool', default: false, }, { displayName: 'Use Gripper', variableName: 'USE_GRIPPER', description: '', - type: 'boolean', + type: 'bool', default: true, }, { displayName: 'Trash Tips', variableName: 'TIP_TRASH', description: 'throw tip in trash', - type: 'boolean', + type: 'bool', default: true, }, { displayName: 'Deactivate Temperatures', variableName: 'DEACTIVATE_TEMP', description: 'deactivate temperature?', - type: 'boolean', + type: 'bool', default: true, }, { diff --git a/app/src/pages/Protocols/hooks/index.ts b/app/src/pages/Protocols/hooks/index.ts index 9931a49444f..c873ff35a9f 100644 --- a/app/src/pages/Protocols/hooks/index.ts +++ b/app/src/pages/Protocols/hooks/index.ts @@ -206,7 +206,7 @@ export const useRunTimeParameters = ( displayName: 'Dry Run', variableName: 'DRYRUN', description: 'Is this a dry or wet run? Wet is true, dry is false', - type: 'boolean', + type: 'bool', default: false, }, { @@ -214,7 +214,7 @@ export const useRunTimeParameters = ( displayName: 'Use Gripper', variableName: 'USE_GRIPPER', description: 'For using the gripper.', - type: 'boolean', + type: 'bool', default: true, }, { @@ -223,7 +223,7 @@ export const useRunTimeParameters = ( variableName: 'TIP_TRASH', description: 'to throw tip into the trash or to not throw tip into the trash', - type: 'boolean', + type: 'bool', default: true, }, { @@ -231,7 +231,7 @@ export const useRunTimeParameters = ( displayName: 'Deactivate Temperatures', variableName: 'DEACTIVATE_TEMP', description: 'deactivate temperature on the module', - type: 'boolean', + type: 'bool', default: true, }, { diff --git a/components/src/molecules/ParametersTable/ParametersTable.stories.tsx b/components/src/molecules/ParametersTable/ParametersTable.stories.tsx index ce55f700dc3..93ba92cfdd4 100644 --- a/components/src/molecules/ParametersTable/ParametersTable.stories.tsx +++ b/components/src/molecules/ParametersTable/ParametersTable.stories.tsx @@ -17,7 +17,7 @@ const runTimeParameters: RunTimeParameter[] = [ displayName: 'Dry Run', variableName: 'DRYRUN', description: 'Is this a dry or wet run? Wet is true, dry is false', - type: 'boolean', + type: 'bool', default: false, }, { @@ -25,7 +25,7 @@ const runTimeParameters: RunTimeParameter[] = [ displayName: 'Use Gripper', variableName: 'USE_GRIPPER', description: 'For using the gripper.', - type: 'boolean', + type: 'bool', default: true, }, { @@ -34,7 +34,7 @@ const runTimeParameters: RunTimeParameter[] = [ variableName: 'TIP_TRASH', description: 'to throw tip into the trash or to not throw tip into the trash', - type: 'boolean', + type: 'bool', default: true, }, { @@ -42,7 +42,7 @@ const runTimeParameters: RunTimeParameter[] = [ displayName: 'Deactivate Temperatures', variableName: 'DEACTIVATE_TEMP', description: 'deactivate temperature on the module', - type: 'boolean', + type: 'bool', default: true, }, { diff --git a/components/src/molecules/ParametersTable/__tests__/ParametersTable.test.tsx b/components/src/molecules/ParametersTable/__tests__/ParametersTable.test.tsx index 1c9cd2d571c..6a4fe44bff0 100644 --- a/components/src/molecules/ParametersTable/__tests__/ParametersTable.test.tsx +++ b/components/src/molecules/ParametersTable/__tests__/ParametersTable.test.tsx @@ -13,7 +13,7 @@ const mockRunTimeParameter: RunTimeParameter[] = [ variableName: 'TIP_TRASH', description: 'to throw tip into the trash or to not throw tip into the trash', - type: 'boolean', + type: 'bool', default: true, value: true, }, diff --git a/components/src/molecules/ParametersTable/index.tsx b/components/src/molecules/ParametersTable/index.tsx index 4ff5cdeeb18..358b09c65c0 100644 --- a/components/src/molecules/ParametersTable/index.tsx +++ b/components/src/molecules/ParametersTable/index.tsx @@ -32,7 +32,7 @@ export function ParametersTable({ case 'int': case 'float': return minMax - case 'boolean': + case 'bool': return t != null ? t('on_off') : 'On, off' case 'str': if (count > 2) { diff --git a/shared-data/js/helpers/__tests__/formatRunTimeParameterValue.test.ts b/shared-data/js/helpers/__tests__/formatRunTimeParameterValue.test.ts index bfdad493913..fec7bd7f4b2 100644 --- a/shared-data/js/helpers/__tests__/formatRunTimeParameterValue.test.ts +++ b/shared-data/js/helpers/__tests__/formatRunTimeParameterValue.test.ts @@ -70,7 +70,7 @@ describe('utils-formatRunTimeParameterValue', () => { displayName: 'Deactivate Temperatures', variableName: 'DEACTIVATE_TEMP', description: 'deactivate temperature on the module', - type: 'boolean', + type: 'bool', default: true, } as RunTimeParameter const result = formatRunTimeParameterValue(mockData, mockTFunction) @@ -83,7 +83,7 @@ describe('utils-formatRunTimeParameterValue', () => { displayName: 'Dry Run', variableName: 'DRYRUN', description: 'Is this a dry or wet run? Wet is true, dry is false', - type: 'boolean', + type: 'bool', default: false, } as RunTimeParameter const result = formatRunTimeParameterValue(mockData, mockTFunction) diff --git a/shared-data/js/helpers/formatRunTimeParameterValue.ts b/shared-data/js/helpers/formatRunTimeParameterValue.ts index ffbab087849..ed154bbcf8a 100644 --- a/shared-data/js/helpers/formatRunTimeParameterValue.ts +++ b/shared-data/js/helpers/formatRunTimeParameterValue.ts @@ -15,7 +15,7 @@ export const formatRunTimeParameterValue = ( return suffix !== null ? `${defaultValue.toString()} ${suffix}` : defaultValue.toString() - case 'boolean': + case 'bool': if (t != null) { return Boolean(defaultValue) ? t('on') : t('off') } else { diff --git a/shared-data/js/types.ts b/shared-data/js/types.ts index 12e991ce7f3..13fa4491a43 100644 --- a/shared-data/js/types.ts +++ b/shared-data/js/types.ts @@ -614,7 +614,7 @@ interface BooleanParameter { } type NumberParameterType = 'int' | 'float' -type BooleanParameterType = 'boolean' +type BooleanParameterType = 'bool' type StringParameterType = 'str' type RunTimeParameterType = | NumberParameter