Skip to content

Commit d1db655

Browse files
authored
fix(app): fix cal check step numbers and return tip, labware offset data help copy (#12423)
Fix logic that calculates the step number within the newly redesigned calibration health check flow based on how many pipettes are being checked. Modernize contents of return tip step in cal check. fix help copy in learn more about labware position check offsets. Closes RQA-611, Closes RQA-609, Closes RAUT-393, Closes RQA-613
1 parent 4fca778 commit d1db655

File tree

15 files changed

+124
-117
lines changed

15 files changed

+124
-117
lines changed

app/src/assets/localization/en/device_settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,5 +226,6 @@
226226
"clear_all_stored_data": "Clear all stored data",
227227
"returns_your_device_to_new_state": "This returns your device to a new state.",
228228
"not_connected": "Not connected",
229-
"connected_via": "Connected via {{networkInterface}}"
229+
"connected_via": "Connected via {{networkInterface}}",
230+
"attach_a_pipette_before_calibrating": "Attach a pipette in order to perform calibration"
230231
}

app/src/assets/localization/en/labware_position_check.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
"slot": "Slot {{slotName}}",
6262
"robot_has_offsets_from_previous_runs": "This robot has offsets for labware used in this protocol. If you apply these offsets, you can still adjust them with Labware Position Check.",
6363
"no_offset_data_on_robot": "This robot has no useable labware offset data for this run.",
64-
"what_labware_offset": "What is labware offset?",
65-
"robot_has_no_offsets_from_previous_runs": "<block>Labware offset data references previous protocol run labware locations to save you time. Labware that has been used in the same slot as a protocol you are running will not need additional calibration. If all the labware in a new protocol have been checked in previous runs, you do not have to run Labware Position Check.</block> <block>You can add new offsets with Labware Position Check in later steps if you desire.</block>",
64+
"what_is_labware_offset_data": "What is labware offset data?",
65+
"robot_has_no_offsets_from_previous_runs": "<block>Labware offset data references previous protocol run labware locations to save you time. If all the labware in this protocol have been checked in previous runs, that data will be applied to this run.</block> <block>You can add new offsets with Labware Position Check in later steps.</block>",
6666
"see_how_offsets_work": "See how labware offsets work",
6767
"stored_offset_data": "Stored Labware Offset data",
6868
"applied_offset_data": "Applied Labware Offset data",

app/src/assets/localization/en/robot_calibration.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"check_tip_on_block": "Check tip on block",
2222
"check_tip_on_trash": "Check tip on trash bin",
2323
"check_xy_axes": "Check x- and y-axis in slot {{slotName}}",
24+
"check_z_axis_on_slot": "Check z-axis on slot 5",
2425
"check_z_axis_on_block": "Check z-axis on block",
2526
"check_z_axis_on_trash": "Check z-axis on trash bin",
2627
"clear_other_slots": "Clear all other deck slots",
@@ -124,5 +125,8 @@
124125
"opentrons": "opentrons",
125126
"custom": "custom",
126127
"confirm_tip_rack": "Confirm tip rack",
127-
"recalibrate_pipette": "Recalibrate pipette"
128+
"recalibrate_pipette": "Recalibrate pipette",
129+
"return_tip_and_continue": "Return tip and continue to next pipette",
130+
"return_tip_and_exit": "Return tip and see calibration health check results",
131+
"return_tip": "Return tip"
128132
}

app/src/organisms/ApplyHistoricOffsets/__tests__/ApplyHistoricOffsets.test.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,15 @@ describe('ApplyHistoricOffsets', () => {
115115
getByText('No offset data available')
116116
getByText('Learn more').click()
117117

118-
getByRole('heading', { name: 'No labware offset data available' })
119-
getByText('This robot has no useable labware offset data for this run.')
120-
getByText('What is labware offset?')
118+
getByRole('heading', { name: 'What is labware offset data?' })
119+
121120
getByText(
122-
'Labware offset data references previous protocol run labware locations to save you time. Labware that has been used in the same slot as a protocol you are running will not need additional calibration. If all the labware in a new protocol have been checked in previous runs, you do not have to run Labware Position Check.'
121+
'Labware offset data references previous protocol run labware locations to save you time. If all the labware in this protocol have been checked in previous runs, that data will be applied to this run.'
123122
)
124123
getByText(
125-
'You can add new offsets with Labware Position Check in later steps if you desire.'
124+
'You can add new offsets with Labware Position Check in later steps.'
126125
)
126+
127127
expect(
128128
getByRole('link', { name: 'See how labware offsets work' })
129129
).toHaveAttribute(

app/src/organisms/ApplyHistoricOffsets/index.tsx

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import type {
2727
LoadedModule,
2828
RunTimeCommand,
2929
} from '@opentrons/shared-data'
30+
import { ExternalLink } from '../../atoms/Link/ExternalLink'
3031

3132
const HOW_OFFSETS_WORK_SUPPORT_URL =
3233
'https://support.opentrons.com/s/article/How-Labware-Offsets-work-on-the-OT-2'
@@ -110,7 +111,7 @@ export function ApplyHistoricOffsets(
110111
<ModalHeader
111112
title={t(
112113
noOffsetData
113-
? 'no_offset_data_available'
114+
? 'what_is_labware_offset_data'
114115
: 'stored_offset_data'
115116
)}
116117
onClose={() => setShowOffsetDataModal(false)}
@@ -126,36 +127,26 @@ export function ApplyHistoricOffsets(
126127
}
127128
>
128129
{noOffsetData ? (
129-
<>
130-
<StyledText as="p" marginBottom={SPACING.spacing3}>
131-
{t('no_offset_data_on_robot')}
132-
</StyledText>
133-
<StyledText css={TYPOGRAPHY.pSemiBold}>
134-
{t('what_labware_offset')}
135-
</StyledText>
136-
<Trans
137-
t={t}
138-
i18nKey={'robot_has_no_offsets_from_previous_runs'}
139-
components={{
140-
block: (
141-
<StyledText as="p" marginBottom={SPACING.spacing3} />
142-
),
143-
}}
144-
/>
145-
</>
130+
<Trans
131+
t={t}
132+
i18nKey={'robot_has_no_offsets_from_previous_runs'}
133+
components={{
134+
block: (
135+
<StyledText as="p" marginBottom={SPACING.spacing3} />
136+
),
137+
}}
138+
/>
146139
) : (
147140
<StyledText as="p">
148141
{t('robot_has_offsets_from_previous_runs')}
149142
</StyledText>
150143
)}
151-
<Link
152-
external
153-
css={TYPOGRAPHY.linkPSemiBold}
144+
<ExternalLink
154145
marginTop={noOffsetData ? '0px' : SPACING.spacing3}
155146
href={HOW_OFFSETS_WORK_SUPPORT_URL}
156147
>
157148
{t('see_how_offsets_work')}
158-
</Link>
149+
</ExternalLink>
159150
{!noOffsetData ? (
160151
isLabwareOffsetCodeSnippetsOn ? (
161152
<LabwareOffsetTabs

app/src/organisms/CalibrationPanels/SaveZPoint.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const assetMap = {
4545

4646
export function SaveZPoint(props: CalibrationPanelProps): JSX.Element {
4747
const { t } = useTranslation('robot_calibration')
48-
const { isMulti, mount, sendCommands, sessionType, calBlock } = props
48+
const { isMulti, mount, sendCommands, sessionType } = props
4949
const demoAsset = React.useMemo(
5050
() => mount && assetMap[mount][isMulti ? 'multi' : 'single'],
5151
[mount, isMulti]
@@ -79,14 +79,9 @@ export function SaveZPoint(props: CalibrationPanelProps): JSX.Element {
7979
)
8080

8181
let title = t('calibrate_z_axis_on_slot')
82-
let bodyTranlsationKey = 'jog_pipette_to_touch_slot'
82+
const bodyTranslationKey = 'jog_pipette_to_touch_slot'
8383
if (isHealthCheck) {
84-
title =
85-
calBlock != null ? t('check_z_axis_on_block') : t('check_z_axis_on_trash')
86-
bodyTranlsationKey =
87-
calBlock != null
88-
? 'jog_pipette_to_touch_block'
89-
: 'jog_pipette_to_touch_trash'
84+
title = t('check_z_axis_on_slot')
9085
}
9186

9287
return (
@@ -108,7 +103,7 @@ export function SaveZPoint(props: CalibrationPanelProps): JSX.Element {
108103
</StyledText>
109104
<Trans
110105
t={t}
111-
i18nKey={bodyTranlsationKey}
106+
i18nKey={bodyTranslationKey}
112107
components={{
113108
block: <StyledText as="p" marginBottom={SPACING.spacing3} />,
114109
}}

app/src/organisms/CalibrationPanels/__tests__/SaveZPoint.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,19 +168,19 @@ describe('SaveZPoint', () => {
168168
sessionType: Sessions.SESSION_TYPE_CALIBRATION_HEALTH_CHECK,
169169
calBlock: mockTipLengthCalBlock,
170170
})[0]
171-
getByRole('heading', { name: 'Check z-axis on block' })
171+
getByRole('heading', { name: 'Check z-axis on slot 5' })
172172
getByText(
173-
'Jog the pipette until the tip is barely touching (less than 0.1 mm) the block in slot 6.'
173+
'Jog the pipette until the tip is barely touching (less than 0.1 mm) the deck in slot 5.'
174174
)
175175
})
176176

177177
it('health check session type shows correct text without block', () => {
178178
const { getByText, getByRole } = render({
179179
sessionType: Sessions.SESSION_TYPE_CALIBRATION_HEALTH_CHECK,
180180
})[0]
181-
getByRole('heading', { name: 'Check z-axis on trash bin' })
181+
getByRole('heading', { name: 'Check z-axis on slot 5' })
182182
getByText(
183-
'Jog the pipette until the tip is barely touching (less than 0.1 mm) the flat surface of the trash bin.'
183+
'Jog the pipette until the tip is barely touching (less than 0.1 mm) the deck in slot 5.'
184184
)
185185
})
186186
})

app/src/organisms/CalibrationTaskList/__tests__/CalibrationTaskList.test.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ import {
1515
expectedIncompleteRightMountTaskList,
1616
expectedIncompleteLeftMountTaskList,
1717
} from '../../Devices/hooks/__fixtures__/taskListFixtures'
18-
import { useCalibrationTaskList, useRunHasStarted } from '../../Devices/hooks'
18+
import {
19+
useCalibrationTaskList,
20+
useRunHasStarted,
21+
useAttachedPipettes,
22+
} from '../../Devices/hooks'
23+
import { mockLeftProtoPipette } from '../../../redux/pipettes/__fixtures__'
1924

2025
jest.mock('../../Devices/hooks')
2126
jest.mock('../../ProtocolUpload/hooks')
@@ -26,6 +31,9 @@ const mockUseCalibrationTaskList = useCalibrationTaskList as jest.MockedFunction
2631
const mockUseRunHasStarted = useRunHasStarted as jest.MockedFunction<
2732
typeof useRunHasStarted
2833
>
34+
const mockUseAttachedPipettes = useAttachedPipettes as jest.MockedFunction<
35+
typeof useAttachedPipettes
36+
>
2937

3038
const render = (robotName: string = 'otie') => {
3139
return renderWithProviders(
@@ -47,6 +55,10 @@ describe('CalibrationTaskList', () => {
4755
beforeEach(() => {
4856
mockUseCalibrationTaskList.mockReturnValue(expectedTaskList)
4957
mockUseRunHasStarted.mockReturnValue(false)
58+
mockUseAttachedPipettes.mockReturnValue({
59+
left: mockLeftProtoPipette,
60+
right: null,
61+
})
5062
})
5163

5264
afterEach(() => {

app/src/organisms/CalibrationTaskList/index.tsx

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ import { StyledText } from '../../atoms/text'
1919
import { Modal } from '../../molecules/Modal'
2020
import { TaskList } from '../TaskList'
2121

22-
import { useCalibrationTaskList, useRunHasStarted } from '../Devices/hooks'
22+
import {
23+
useAttachedPipettes,
24+
useCalibrationTaskList,
25+
useRunHasStarted,
26+
} from '../Devices/hooks'
2327
import { useCurrentRunId } from '../ProtocolUpload/hooks'
2428

2529
import type { DashboardCalOffsetInvoker } from '../../pages/Devices/CalibrationDashboard/hooks/useDashboardCalibratePipOffset'
@@ -55,7 +59,21 @@ export function CalibrationTaskList({
5559
deckCalLauncher
5660
)
5761
const runId = useCurrentRunId()
62+
63+
let generalTaskDisabledReason = null
64+
65+
const attachedPipettes = useAttachedPipettes()
66+
if (attachedPipettes.left == null && attachedPipettes.right == null) {
67+
generalTaskDisabledReason = t(
68+
'device_settings:attach_a_pipette_before_calibrating'
69+
)
70+
}
71+
5872
const runHasStarted = useRunHasStarted(runId)
73+
if (runHasStarted)
74+
generalTaskDisabledReason = t(
75+
'device_settings:some_robot_controls_are_not_available'
76+
)
5977

6078
React.useEffect(() => {
6179
if (
@@ -148,11 +166,7 @@ export function CalibrationTaskList({
148166
taskList={taskList}
149167
taskListStatus={taskListStatus}
150168
generalTaskClickHandler={() => setHasLaunchedWizard(true)}
151-
generalTaskDisabledReason={
152-
runHasStarted
153-
? t('device_settings:some_robot_controls_are_not_available')
154-
: null
155-
}
169+
generalTaskDisabledReason={generalTaskDisabledReason}
156170
/>
157171
</>
158172
)}

app/src/organisms/CheckCalibration/ConfirmExitModal.tsx

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)