Skip to content

Commit

Permalink
fix(app): require offsets before confirming (#15952)
Browse files Browse the repository at this point in the history
This forces you to take a pass through LPC or just commit to skipping it
all.

## reviewing and testing
- [x] you can't click the button on odd when there are no offsets
- [x] you can't click the button on desktop when there are no offsets
- [x] you can click the button on odd when there are offsets
- [x] you can click the button on desktop when there are offsets

Closes RQA-2930
  • Loading branch information
sfoster1 authored Aug 9, 2024
1 parent b321824 commit 42db1ee
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/src/assets/localization/en/protocol_setup.json
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@
"run_disabled_modules_and_calibration_not_complete": "Make sure robot calibration is complete and all modules are connected before proceeding to run",
"run_disabled_modules_not_connected": "Make sure all modules are connected before proceeding to run",
"run_labware_position_check": "run labware position check",
"run_labware_position_check_to_get_offsets": "Run Labware Position Check to get your labware offset data.",
"run_never_started": "Run was never started",
"run": "Run",
"secure_labware_instructions": "Secure labware instructions",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,18 @@ export function SetupLabwarePositionCheck(
id="LPC_setOffsetsConfirmed"
padding={`${SPACING.spacing8} ${SPACING.spacing16}`}
{...confirmOffsetsTargetProps}
disabled={offsetsConfirmed || lpcDisabledReason !== null}
disabled={
offsetsConfirmed ||
lpcDisabledReason !== null ||
nonIdentityOffsets.length === 0
}
>
{t('confirm_offsets')}
</SecondaryButton>
{lpcDisabledReason !== null ? (
{lpcDisabledReason != null || nonIdentityOffsets.length === 0 ? (
<Tooltip tooltipProps={confirmOffsetsTooltipProps}>
{lpcDisabledReason}
{lpcDisabledReason ??
t('run_labware_position_check_to_get_offsets')}
</Tooltip>
) : null}
<PrimaryButton
Expand Down
1 change: 1 addition & 0 deletions app/src/organisms/ProtocolSetupOffsets/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export function ProtocolSetupOffsets({
) : (
<SmallButton
buttonText={t('confirm_placements')}
disabled={nonIdentityOffsets.length === 0}
onClick={() => {
setIsConfirmed(true)
setSetupScreen('prepare to run')
Expand Down

0 comments on commit 42db1ee

Please sign in to comment.