Skip to content

Commit

Permalink
fix(app): Add command text for reloadLabware (#16056)
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxColoring authored Aug 19, 2024
1 parent 332fbf6 commit f71c99e
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/src/assets/localization/en/protocol_command_text.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 14 additions & 0 deletions app/src/molecules/Command/__fixtures__/mockRobotSideAnalysis.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [],
Expand Down
17 changes: 17 additions & 0 deletions app/src/molecules/Command/__tests__/CommandText.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
<CommandText
commandTextData={mockCommandTextData}
robotType={FLEX_ROBOT_TYPE}
command={reloadLabwareCommand}
/>,
{ 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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export function useCommandTextString(
}

case 'loadLabware':
case 'reloadLabware':
case 'loadPipette':
case 'loadModule':
case 'loadLiquid':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down
17 changes: 17 additions & 0 deletions shared-data/command/types/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -76,6 +85,7 @@ export type SetupRunTimeCommand =
| ConfigureNozzleLayoutRunTimeCommand
| LoadPipetteRunTimeCommand
| LoadLabwareRunTimeCommand
| ReloadLabwareRunTimeCommand
| LoadModuleRunTimeCommand
| LoadLiquidRunTimeCommand
| MoveLabwareRunTimeCommand
Expand All @@ -84,6 +94,7 @@ export type SetupCreateCommand =
| ConfigureNozzleLayoutCreateCommand
| LoadPipetteCreateCommand
| LoadLabwareCreateCommand
| ReloadLabwareCreateCommand
| LoadModuleCreateCommand
| LoadLiquidCreateCommand
| MoveLabwareCreateCommand
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit f71c99e

Please sign in to comment.