Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
mjhuff committed Jul 19, 2024
1 parent aab3ff2 commit a1b4c60
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 8 deletions.
20 changes: 20 additions & 0 deletions app/src/molecules/Command/__fixtures__/mockRobotSideAnalysis.json
Original file line number Diff line number Diff line change
Expand Up @@ -6411,6 +6411,26 @@
},
"pipetteId": "f6d1c83c-9d1b-4d0d-9de3-e6d649739cfb"
}
},
{
"id": "84f7af1d-c097-4d4b-9819-ad56479bbbb8",
"createdAt": "2023-01-31T21:53:04.965216+00:00",
"commandType": "tryLiquidProbe",
"key": "1248111104",
"status": "succeeded",
"params": {
"labwareId": "b2a40c9d-31b0-4f27-ad4a-c92ced91204d",
"wellName": "A1",
"wellLocation": {
"origin": "top",
"offset": {
"x": 0,
"y": 0,
"z": 0
}
},
"pipetteId": "f6d1c83c-9d1b-4d0d-9de3-e6d649739cfb"
}
}
],
"errors": [],
Expand Down
20 changes: 20 additions & 0 deletions app/src/molecules/Command/__tests__/CommandText.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1421,4 +1421,24 @@ describe('CommandText', () => {
)
}
})

it('renders correct text for tryLiquidProbe', () => {
const command = mockCommandTextData.commands.find(
c => c.commandType === 'tryLiquidProbe'
)
expect(command).not.toBeUndefined()
if (command != null) {
renderWithProviders(
<CommandText
commandTextData={mockCommandTextData}
robotType={FLEX_ROBOT_TYPE}
command={command}
/>,
{ i18nInstance: i18n }
)
screen.getByText(
'Detecting liquid presence in well A1 of Opentrons 96 Tip Rack 300 µL in Slot 9'
)
}
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export function useCommandTextString(
}

case 'liquidProbe':
case 'tryLiquidProbe':
return {
commandText: utils.getLiquidProbeCommandText({
...fullParams,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
import type {
LiquidProbeRunTimeCommand,
RunTimeCommand,
} from '@opentrons/shared-data'
import type { HandlesCommands } from './types'
import {
getFinalLabwareLocation,
getLabwareDisplayLocation,
getLabwareName,
} from '../../../utils'

import type {
LiquidProbeRunTimeCommand,
RunTimeCommand,
TryLiquidProbeRunTimeCommand,
} from '@opentrons/shared-data'
import type { HandlesCommands } from './types'
import type { TFunction } from 'i18next'

type LiquidProbeRunTimeCommands =
| LiquidProbeRunTimeCommand
| TryLiquidProbeRunTimeCommand

export function getLiquidProbeCommandText({
command,
commandTextData,
t,
robotType,
}: HandlesCommands<LiquidProbeRunTimeCommand>): string {
}: HandlesCommands<LiquidProbeRunTimeCommands>): string {
const { wellName, labwareId } = command.params

const allPreviousCommands = commandTextData?.commands.slice(
Expand All @@ -26,7 +32,7 @@ export function getLiquidProbeCommandText({
const labwareLocation =
allPreviousCommands != null
? getFinalLabwareLocation(
labwareId,
labwareId as string,
allPreviousCommands as RunTimeCommand[]
)
: null
Expand All @@ -42,7 +48,9 @@ export function getLiquidProbeCommandText({
: ''

const labware =
commandTextData != null ? getLabwareName(commandTextData, labwareId) : null
commandTextData != null
? getLabwareName(commandTextData, labwareId as string)
: null

return t('detect_liquid_presence', {
labware,
Expand Down
12 changes: 12 additions & 0 deletions shared-data/command/types/pipetting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export type PipettingRunTimeCommand =
| TouchTipRunTimeCommand
| VerifyTipPresenceRunTimeCommand
| LiquidProbeRunTimeCommand
| TryLiquidProbeRunTimeCommand

export type PipettingCreateCommand =
| AspirateCreateCommand
Expand All @@ -36,6 +37,7 @@ export type PipettingCreateCommand =
| TouchTipCreateCommand
| VerifyTipPresenceCreateCommand
| LiquidProbeCreateCommand
| TryLiquidProbeCreateCommand

export interface ConfigureForVolumeCreateCommand
extends CommonCommandCreateInfo {
Expand Down Expand Up @@ -206,6 +208,16 @@ export interface LiquidProbeRunTimeCommand
result?: Record<string, unknown>
}

export interface TryLiquidProbeCreateCommand extends CommonCommandCreateInfo {
commandType: 'tryLiquidProbe'
params: WellLocationParam & PipetteAccessParams
}
export interface TryLiquidProbeRunTimeCommand
extends CommonCommandRunTimeInfo,
TryLiquidProbeCreateCommand {
result?: Record<string, unknown>
}

export type AspDispAirgapParams = FlowRateParams &
PipetteAccessParams &
VolumeParams &
Expand Down

0 comments on commit a1b4c60

Please sign in to comment.