From f71c99ee41c16110a7bdd4d642210d1f38f63dee Mon Sep 17 00:00:00 2001 From: Max Marrone Date: Mon, 19 Aug 2024 17:17:18 -0400 Subject: [PATCH] fix(app): Add command text for reloadLabware (#16056) --- .../localization/en/protocol_command_text.json | 1 + .../__fixtures__/mockRobotSideAnalysis.json | 14 ++++++++++++++ .../Command/__tests__/CommandText.test.tsx | 17 +++++++++++++++++ .../hooks/useCommandTextString/index.tsx | 1 + .../utils/getLoadCommandText.ts | 8 ++++++++ shared-data/command/types/setup.ts | 17 +++++++++++++++++ 6 files changed, 58 insertions(+) diff --git a/app/src/assets/localization/en/protocol_command_text.json b/app/src/assets/localization/en/protocol_command_text.json index 484ec67124a..b050ff7bc7a 100644 --- a/app/src/assets/localization/en/protocol_command_text.json +++ b/app/src/assets/localization/en/protocol_command_text.json @@ -57,6 +57,7 @@ "pause_on": "Pause on {{robot_name}}", "pickup_tip": "Picking up tip(s) from {{well_range}} of {{labware}} in {{labware_location}}", "prepare_to_aspirate": "Preparing {{pipette}} to aspirate", + "reloading_labware": "Reloading {{labware}}", "return_tip": "Returning tip to {{well_name}} of {{labware}} in {{labware_location}}", "right": "Right", "save_position": "Saving position", diff --git a/app/src/molecules/Command/__fixtures__/mockRobotSideAnalysis.json b/app/src/molecules/Command/__fixtures__/mockRobotSideAnalysis.json index b4a041b36f9..cd2bd35c802 100644 --- a/app/src/molecules/Command/__fixtures__/mockRobotSideAnalysis.json +++ b/app/src/molecules/Command/__fixtures__/mockRobotSideAnalysis.json @@ -6431,6 +6431,20 @@ }, "pipetteId": "f6d1c83c-9d1b-4d0d-9de3-e6d649739cfb" } + }, + { + "id": "84f7af1d-c097-4d4b-9819-ad56479bbbb8", + "createdAt": "2023-01-31T21:53:04.965216+00:00", + "commandType": "reloadLabware", + "key": "1248111104", + "status": "succeeded", + "params": { + "labwareId": "c8f42311-f83f-4722-9821-9d2225e4b0b5" + }, + "result": { + "labwareId": "c8f42311-f83f-4722-9821-9d2225e4b0b5", + "offsetId": "offsetId-abc123" + } } ], "errors": [], diff --git a/app/src/molecules/Command/__tests__/CommandText.test.tsx b/app/src/molecules/Command/__tests__/CommandText.test.tsx index 9226f258830..09856d77ba1 100644 --- a/app/src/molecules/Command/__tests__/CommandText.test.tsx +++ b/app/src/molecules/Command/__tests__/CommandText.test.tsx @@ -588,6 +588,23 @@ describe('CommandText', () => { ) screen.getByText('Load NEST 96 Well Plate 100 µL PCR Full Skirt off deck') }) + it('renders correct text for reloadLabware', () => { + const reloadLabwareCommand = mockCommandTextData.commands.find( + c => c.commandType === 'reloadLabware' + ) + expect(reloadLabwareCommand).not.toBeUndefined() + if (reloadLabwareCommand != null) { + renderWithProviders( + , + { i18nInstance: i18n } + ) + } + screen.getByText('Reloading NEST 96 Well Plate 100 µL PCR Full Skirt (1)') + }) it('renders correct text for loadLiquid', () => { const loadLabwareCommands = mockCommandTextData.commands.filter( c => c.commandType === 'loadLabware' diff --git a/app/src/molecules/Command/hooks/useCommandTextString/index.tsx b/app/src/molecules/Command/hooks/useCommandTextString/index.tsx index 093593dc911..05552f062f9 100644 --- a/app/src/molecules/Command/hooks/useCommandTextString/index.tsx +++ b/app/src/molecules/Command/hooks/useCommandTextString/index.tsx @@ -71,6 +71,7 @@ export function useCommandTextString( } case 'loadLabware': + case 'reloadLabware': case 'loadPipette': case 'loadModule': case 'loadLiquid': diff --git a/app/src/molecules/Command/hooks/useCommandTextString/utils/getLoadCommandText.ts b/app/src/molecules/Command/hooks/useCommandTextString/utils/getLoadCommandText.ts index b2da948d58d..e28d52f3959 100644 --- a/app/src/molecules/Command/hooks/useCommandTextString/utils/getLoadCommandText.ts +++ b/app/src/molecules/Command/hooks/useCommandTextString/utils/getLoadCommandText.ts @@ -140,6 +140,14 @@ export const getLoadCommandText = ({ }) } } + case 'reloadLabware': { + const { labwareId } = command.params + const labware = + commandTextData != null + ? getLabwareName(commandTextData, labwareId) + : null + return t('reloading_labware', { labware }) + } case 'loadLiquid': { const { liquidId, labwareId } = command.params return t('load_liquids_info_protocol_setup', { diff --git a/shared-data/command/types/setup.ts b/shared-data/command/types/setup.ts index b3f54cdaad8..85613421b45 100644 --- a/shared-data/command/types/setup.ts +++ b/shared-data/command/types/setup.ts @@ -29,6 +29,15 @@ export interface LoadLabwareRunTimeCommand LoadLabwareCreateCommand { result?: LoadLabwareResult } +export interface ReloadLabwareCreateCommand extends CommonCommandCreateInfo { + commandType: 'reloadLabware' + params: { labwareId: string } +} +export interface ReloadLabwareRunTimeCommand + extends CommonCommandRunTimeInfo, + ReloadLabwareCreateCommand { + result?: ReloadLabwareResult +} export interface MoveLabwareCreateCommand extends CommonCommandCreateInfo { commandType: 'moveLabware' params: MoveLabwareParams @@ -76,6 +85,7 @@ export type SetupRunTimeCommand = | ConfigureNozzleLayoutRunTimeCommand | LoadPipetteRunTimeCommand | LoadLabwareRunTimeCommand + | ReloadLabwareRunTimeCommand | LoadModuleRunTimeCommand | LoadLiquidRunTimeCommand | MoveLabwareRunTimeCommand @@ -84,6 +94,7 @@ export type SetupCreateCommand = | ConfigureNozzleLayoutCreateCommand | LoadPipetteCreateCommand | LoadLabwareCreateCommand + | ReloadLabwareCreateCommand | LoadModuleCreateCommand | LoadLiquidCreateCommand | MoveLabwareCreateCommand @@ -123,8 +134,14 @@ interface LoadLabwareParams { interface LoadLabwareResult { labwareId: string definition: LabwareDefinition2 + // todo(mm, 2024-08-19): This does not match the server-returned offsetId field. + // Confirm nothing client-side is trying to use this, then replace it with offsetId. offset: LabwareOffset } +interface ReloadLabwareResult { + labwareId: string + offsetId?: string | null +} export type LabwareMovementStrategy = | 'usingGripper'