Skip to content

Commit

Permalink
home all
Browse files Browse the repository at this point in the history
  • Loading branch information
sfoster1 committed Nov 22, 2024
1 parent f85594c commit e27ff37
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
import { Trans, useTranslation } from 'react-i18next'
import { LegacyStyledText } from '@opentrons/components'
import { RECOVERY_MAP } from '../constants'
import { TwoColTextAndFailedStepNextStep } from '../shared'
import { RetryStep } from './RetryStep'
import { ManageTips } from './ManageTips'
import { SelectRecoveryOption } from './SelectRecoveryOption'

import type { RecoveryContentProps } from '../types'

const { HOME_AND_RETRY } = RECOVERY_MAP

Check failure on line 11 in app/src/organisms/ErrorRecoveryFlows/RecoveryOptions/HomeAndRetry.tsx

View workflow job for this annotation

GitHub Actions / js checks

Property 'HOME_AND_RETRY' does not exist on type '{ readonly DROP_TIP_FLOWS: { readonly ROUTE: "drop-tip"; readonly STEPS: { readonly BEGIN_REMOVAL: "begin-removal"; readonly BEFORE_BEGINNING: "before-beginning"; readonly CHOOSE_TIP_DROP: "choose-tip-drop"; readonly CHOOSE_BLOWOUT: "choose-blowout"; }; }; readonly ERROR_WHILE_RECOVERING: { readonly ROUTE: "error"; readonly STEPS: { readonly RECOVERY_ACTION_FAILED: "recovery-action-failed"; readonly DROP_TIP_BLOWOUT_FAILED: "drop-tip-blowout-failed"; readonly DROP_TIP_TIP_DROP_FAILED: "drop-tip-tip-drop-failed"; readonly DROP_TIP_GENERAL_ERROR: "drop-tip-general-error"; }; }; readonly ROBOT_CANCELING: { readonly ROUTE: "robot-cancel-run"; readonly STEPS: { readonly CANCELING: "canceling"; }; }; readonly ROBOT_IN_MOTION: { readonly ROUTE: "robot-in-motion"; readonly STEPS: { readonly IN_MOTION: "in-motion"; }; }; readonly ROBOT_PICKING_UP_TIPS: { readonly ROUTE: "robot-picking-up-tips"; readonly STEPS: { readonly PICKING_UP_TIPS: "picking-up-tips"; }; }; readonly ROBOT_RELEASING_LABWARE: { readonly ROUTE: "robot-releasing-labware"; readonly STEPS: { readonly RELEASING_LABWARE: "releasing-labware"; }; }; readonly ROBOT_RESUMING: { readonly ROUTE: "robot-resuming"; readonly STEPS: { readonly RESUMING: "resuming"; }; }; readonly ROBOT_RETRYING_STEP: { readonly ROUTE: "robot-retrying-step"; readonly STEPS: { readonly RETRYING: "retrying"; }; }; readonly ROBOT_SKIPPING_STEP: { readonly ROUTE: "robot-skipping-to-next-step"; readonly STEPS: { readonly SKIPPING: "skipping"; }; }; readonly ROBOT_DOOR_OPEN: { readonly ROUTE: "door"; readonly STEPS: { readonly DOOR_OPEN: "door-open"; }; }; readonly ROBOT_DOOR_OPEN_SPECIAL: { readonly ROUTE: "door-special"; readonly STEPS: { readonly DOOR_OPEN: "door-open"; }; }; readonly OPTION_SELECTION: { readonly ROUTE: "option-selection"; readonly STEPS: { readonly SELECT: "select"; }; }; readonly CANCEL_RUN: { readonly ROUTE: "cancel-run"; readonly STEPS: { readonly CONFIRM_CANCEL: "confirm-cancel"; }; }; readonly IGNORE_AND_SKIP: { readonly ROUTE: "ignore-and-skip-step"; readonly STEPS: { readonly SELECT_IGNORE_KIND: "select-ignore"; readonly SKIP_STEP: "skip-step"; }; }; readonly MANUAL_FILL_AND_SKIP: { readonly ROUTE: "manual-fill-well-and-skip"; readonly STEPS: { readonly MANUAL_FILL: "manual-fill"; readonly SKIP: "skip"; }; }; readonly MANUAL_MOVE_AND_SKIP: { readonly ROUTE: "manual-move-labware-and-skip"; readonly STEPS: { readonly GRIPPER_HOLDING_LABWARE: "gripper-holding-labware"; readonly GRIPPER_RELEASE_LABWARE: "gripper-release-labware"; readonly CLOSE_DOOR_GRIPPER_Z_HOME: "close-robot-door"; readonly MANUAL_MOVE: "manual-move"; readonly SKIP: "skip"; }; }; readonly MANUAL_REPLACE_AND_RETRY: { readonly ROUTE: "manual-replace-and-retry"; readonly STEPS: { readonly GRIPPER_HOLDING_LABWARE: "gripper-holding-labware"; readonly GRIPPER_RELEASE_LABWARE: "gripper-release-labware"; readonly CLOSE_DOOR_GRIPPER_Z_HOME: "close-robot-door"; readonly MANUAL_REPLACE: "manual-replace"; readonly RETRY: "retry"; }; }; readonly REFILL_AND_RESUME: { readonly ROUTE: "refill-and-resume"; readonly STEPS: {}; }; readonly RETRY_STEP: { readonly ROUTE: "retry-step"; readonly STEPS: { readonly CONFIRM_RETRY: "confirm-retry"; }; }; readonly RETRY_NEW_TIPS: { readonly ROUTE: "retry-new-tips"; readonly STEPS: { readonly DROP_TIPS: "drop-tips"; readonly REPLACE_TIPS: "replace-tips"; readonly SELECT_TIPS: "select-tips"; readonly RETRY: "retry"; }; }; readonly RETRY_SAME_TIPS: { readonly ROUTE: "retry-same-tips"; readonly STEPS: { readonly RETRY: "retry"; }; }; readonly SKIP_STEP_WITH_NEW_TIPS: { readonly ROUTE: "skip-to-next-step-new-tips"; readonly STEPS: { readonly DROP_TIPS: "drop-tips"; readonly REPLACE_TIPS: "replace-tips"; readonly SELECT_TIPS: "select-tips"; readonly SKIP: "skip"; }; }; readonly SKIP_STEP_WITH_SAME_TIPS: { readonly ROUTE: "skip-to-next-step-same-tips"; readonly STEPS: { readonly SKIP: "skip"; }; }; }'.
export function HomeAndRetry(props: RecoveryContentProps): JSX.Element {
const { recoveryMap } = props
const { route, step } = recoveryMap
switch (step) {
case HOME_AND_RETRY.STEPS.PREPARE_DECK_FOR_HOME: {
return <PrepareDeckForHome {...props} />
}
case HOME_AND_RETRY.STEPS.REMOVE_TIPS_FROM_PIPETTE: {
return <ManageTips {...props} />
}
case HOME_AND_RETRY.STEPS.HOME_BEFORE_RETRY: {
return <HomeGantryBeforeRetry {...props} />
}
case HOME_AND_RETRY.STEPS.CONFIRM_RETRY: {
return <RetryStep {...props} />
}
default:
console.warn(
`HomeAndRetry: ${step} in ${route} not explicitly handled. Rerouting.}`
)
return <SelectRecoveryOption {...props} />
}
}

export function PrepareDeckForHome(props: RecoveryContentProps): JSX.Element {
const { t } = useTranslation('error_recovery')
const { routeUpdateActions } = props
const { proceedToRouteAndStep } = routeUpdateActions
const primaryBtnOnClick = (): Promise<void> =>
proceedToRouteAndStep(
RECOVERY_MAP.HOME_AND_RETRY.ROUTE,

Check failure on line 42 in app/src/organisms/ErrorRecoveryFlows/RecoveryOptions/HomeAndRetry.tsx

View workflow job for this annotation

GitHub Actions / js checks

Property 'HOME_AND_RETRY' does not exist on type '{ readonly DROP_TIP_FLOWS: { readonly ROUTE: "drop-tip"; readonly STEPS: { readonly BEGIN_REMOVAL: "begin-removal"; readonly BEFORE_BEGINNING: "before-beginning"; readonly CHOOSE_TIP_DROP: "choose-tip-drop"; readonly CHOOSE_BLOWOUT: "choose-blowout"; }; }; readonly ERROR_WHILE_RECOVERING: { readonly ROUTE: "error"; readonly STEPS: { readonly RECOVERY_ACTION_FAILED: "recovery-action-failed"; readonly DROP_TIP_BLOWOUT_FAILED: "drop-tip-blowout-failed"; readonly DROP_TIP_TIP_DROP_FAILED: "drop-tip-tip-drop-failed"; readonly DROP_TIP_GENERAL_ERROR: "drop-tip-general-error"; }; }; readonly ROBOT_CANCELING: { readonly ROUTE: "robot-cancel-run"; readonly STEPS: { readonly CANCELING: "canceling"; }; }; readonly ROBOT_IN_MOTION: { readonly ROUTE: "robot-in-motion"; readonly STEPS: { readonly IN_MOTION: "in-motion"; }; }; readonly ROBOT_PICKING_UP_TIPS: { readonly ROUTE: "robot-picking-up-tips"; readonly STEPS: { readonly PICKING_UP_TIPS: "picking-up-tips"; }; }; readonly ROBOT_RELEASING_LABWARE: { readonly ROUTE: "robot-releasing-labware"; readonly STEPS: { readonly RELEASING_LABWARE: "releasing-labware"; }; }; readonly ROBOT_RESUMING: { readonly ROUTE: "robot-resuming"; readonly STEPS: { readonly RESUMING: "resuming"; }; }; readonly ROBOT_RETRYING_STEP: { readonly ROUTE: "robot-retrying-step"; readonly STEPS: { readonly RETRYING: "retrying"; }; }; readonly ROBOT_SKIPPING_STEP: { readonly ROUTE: "robot-skipping-to-next-step"; readonly STEPS: { readonly SKIPPING: "skipping"; }; }; readonly ROBOT_DOOR_OPEN: { readonly ROUTE: "door"; readonly STEPS: { readonly DOOR_OPEN: "door-open"; }; }; readonly ROBOT_DOOR_OPEN_SPECIAL: { readonly ROUTE: "door-special"; readonly STEPS: { readonly DOOR_OPEN: "door-open"; }; }; readonly OPTION_SELECTION: { readonly ROUTE: "option-selection"; readonly STEPS: { readonly SELECT: "select"; }; }; readonly CANCEL_RUN: { readonly ROUTE: "cancel-run"; readonly STEPS: { readonly CONFIRM_CANCEL: "confirm-cancel"; }; }; readonly IGNORE_AND_SKIP: { readonly ROUTE: "ignore-and-skip-step"; readonly STEPS: { readonly SELECT_IGNORE_KIND: "select-ignore"; readonly SKIP_STEP: "skip-step"; }; }; readonly MANUAL_FILL_AND_SKIP: { readonly ROUTE: "manual-fill-well-and-skip"; readonly STEPS: { readonly MANUAL_FILL: "manual-fill"; readonly SKIP: "skip"; }; }; readonly MANUAL_MOVE_AND_SKIP: { readonly ROUTE: "manual-move-labware-and-skip"; readonly STEPS: { readonly GRIPPER_HOLDING_LABWARE: "gripper-holding-labware"; readonly GRIPPER_RELEASE_LABWARE: "gripper-release-labware"; readonly CLOSE_DOOR_GRIPPER_Z_HOME: "close-robot-door"; readonly MANUAL_MOVE: "manual-move"; readonly SKIP: "skip"; }; }; readonly MANUAL_REPLACE_AND_RETRY: { readonly ROUTE: "manual-replace-and-retry"; readonly STEPS: { readonly GRIPPER_HOLDING_LABWARE: "gripper-holding-labware"; readonly GRIPPER_RELEASE_LABWARE: "gripper-release-labware"; readonly CLOSE_DOOR_GRIPPER_Z_HOME: "close-robot-door"; readonly MANUAL_REPLACE: "manual-replace"; readonly RETRY: "retry"; }; }; readonly REFILL_AND_RESUME: { readonly ROUTE: "refill-and-resume"; readonly STEPS: {}; }; readonly RETRY_STEP: { readonly ROUTE: "retry-step"; readonly STEPS: { readonly CONFIRM_RETRY: "confirm-retry"; }; }; readonly RETRY_NEW_TIPS: { readonly ROUTE: "retry-new-tips"; readonly STEPS: { readonly DROP_TIPS: "drop-tips"; readonly REPLACE_TIPS: "replace-tips"; readonly SELECT_TIPS: "select-tips"; readonly RETRY: "retry"; }; }; readonly RETRY_SAME_TIPS: { readonly ROUTE: "retry-same-tips"; readonly STEPS: { readonly RETRY: "retry"; }; }; readonly SKIP_STEP_WITH_NEW_TIPS: { readonly ROUTE: "skip-to-next-step-new-tips"; readonly STEPS: { readonly DROP_TIPS: "drop-tips"; readonly REPLACE_TIPS: "replace-tips"; readonly SELECT_TIPS: "select-tips"; readonly SKIP: "skip"; }; }; readonly SKIP_STEP_WITH_SAME_TIPS: { readonly ROUTE: "skip-to-next-step-same-tips"; readonly STEPS: { readonly SKIP: "skip"; }; }; }'.

Check failure on line 42 in app/src/organisms/ErrorRecoveryFlows/RecoveryOptions/HomeAndRetry.tsx

View workflow job for this annotation

GitHub Actions / js checks

Unsafe argument of type `any` assigned to a parameter of type `"error" | "drop-tip" | "robot-cancel-run" | "robot-in-motion" | "robot-picking-up-tips" | "robot-releasing-labware" | "robot-resuming" | "robot-retrying-step" | "robot-skipping-to-next-step" | "door" | "door-special" | "option-selection" | "cancel-run" | "ignore-and-skip-step" | "manual-fill-well-and-skip" | "manual-move-labware-and-skip" | "manual-replace-and-retry" | "refill-and-resume" | "retry-step" | "retry-new-tips" | "retry-same-tips" | "skip-to-next-step-new-tips" | "skip-to-next-step-same-tips"`
RECOVERY_MAP.HOME_AND_RETRY.STEPS.REMOVE_TIPS_FROM_PIPETTE

Check failure on line 43 in app/src/organisms/ErrorRecoveryFlows/RecoveryOptions/HomeAndRetry.tsx

View workflow job for this annotation

GitHub Actions / js checks

Property 'HOME_AND_RETRY' does not exist on type '{ readonly DROP_TIP_FLOWS: { readonly ROUTE: "drop-tip"; readonly STEPS: { readonly BEGIN_REMOVAL: "begin-removal"; readonly BEFORE_BEGINNING: "before-beginning"; readonly CHOOSE_TIP_DROP: "choose-tip-drop"; readonly CHOOSE_BLOWOUT: "choose-blowout"; }; }; readonly ERROR_WHILE_RECOVERING: { readonly ROUTE: "error"; readonly STEPS: { readonly RECOVERY_ACTION_FAILED: "recovery-action-failed"; readonly DROP_TIP_BLOWOUT_FAILED: "drop-tip-blowout-failed"; readonly DROP_TIP_TIP_DROP_FAILED: "drop-tip-tip-drop-failed"; readonly DROP_TIP_GENERAL_ERROR: "drop-tip-general-error"; }; }; readonly ROBOT_CANCELING: { readonly ROUTE: "robot-cancel-run"; readonly STEPS: { readonly CANCELING: "canceling"; }; }; readonly ROBOT_IN_MOTION: { readonly ROUTE: "robot-in-motion"; readonly STEPS: { readonly IN_MOTION: "in-motion"; }; }; readonly ROBOT_PICKING_UP_TIPS: { readonly ROUTE: "robot-picking-up-tips"; readonly STEPS: { readonly PICKING_UP_TIPS: "picking-up-tips"; }; }; readonly ROBOT_RELEASING_LABWARE: { readonly ROUTE: "robot-releasing-labware"; readonly STEPS: { readonly RELEASING_LABWARE: "releasing-labware"; }; }; readonly ROBOT_RESUMING: { readonly ROUTE: "robot-resuming"; readonly STEPS: { readonly RESUMING: "resuming"; }; }; readonly ROBOT_RETRYING_STEP: { readonly ROUTE: "robot-retrying-step"; readonly STEPS: { readonly RETRYING: "retrying"; }; }; readonly ROBOT_SKIPPING_STEP: { readonly ROUTE: "robot-skipping-to-next-step"; readonly STEPS: { readonly SKIPPING: "skipping"; }; }; readonly ROBOT_DOOR_OPEN: { readonly ROUTE: "door"; readonly STEPS: { readonly DOOR_OPEN: "door-open"; }; }; readonly ROBOT_DOOR_OPEN_SPECIAL: { readonly ROUTE: "door-special"; readonly STEPS: { readonly DOOR_OPEN: "door-open"; }; }; readonly OPTION_SELECTION: { readonly ROUTE: "option-selection"; readonly STEPS: { readonly SELECT: "select"; }; }; readonly CANCEL_RUN: { readonly ROUTE: "cancel-run"; readonly STEPS: { readonly CONFIRM_CANCEL: "confirm-cancel"; }; }; readonly IGNORE_AND_SKIP: { readonly ROUTE: "ignore-and-skip-step"; readonly STEPS: { readonly SELECT_IGNORE_KIND: "select-ignore"; readonly SKIP_STEP: "skip-step"; }; }; readonly MANUAL_FILL_AND_SKIP: { readonly ROUTE: "manual-fill-well-and-skip"; readonly STEPS: { readonly MANUAL_FILL: "manual-fill"; readonly SKIP: "skip"; }; }; readonly MANUAL_MOVE_AND_SKIP: { readonly ROUTE: "manual-move-labware-and-skip"; readonly STEPS: { readonly GRIPPER_HOLDING_LABWARE: "gripper-holding-labware"; readonly GRIPPER_RELEASE_LABWARE: "gripper-release-labware"; readonly CLOSE_DOOR_GRIPPER_Z_HOME: "close-robot-door"; readonly MANUAL_MOVE: "manual-move"; readonly SKIP: "skip"; }; }; readonly MANUAL_REPLACE_AND_RETRY: { readonly ROUTE: "manual-replace-and-retry"; readonly STEPS: { readonly GRIPPER_HOLDING_LABWARE: "gripper-holding-labware"; readonly GRIPPER_RELEASE_LABWARE: "gripper-release-labware"; readonly CLOSE_DOOR_GRIPPER_Z_HOME: "close-robot-door"; readonly MANUAL_REPLACE: "manual-replace"; readonly RETRY: "retry"; }; }; readonly REFILL_AND_RESUME: { readonly ROUTE: "refill-and-resume"; readonly STEPS: {}; }; readonly RETRY_STEP: { readonly ROUTE: "retry-step"; readonly STEPS: { readonly CONFIRM_RETRY: "confirm-retry"; }; }; readonly RETRY_NEW_TIPS: { readonly ROUTE: "retry-new-tips"; readonly STEPS: { readonly DROP_TIPS: "drop-tips"; readonly REPLACE_TIPS: "replace-tips"; readonly SELECT_TIPS: "select-tips"; readonly RETRY: "retry"; }; }; readonly RETRY_SAME_TIPS: { readonly ROUTE: "retry-same-tips"; readonly STEPS: { readonly RETRY: "retry"; }; }; readonly SKIP_STEP_WITH_NEW_TIPS: { readonly ROUTE: "skip-to-next-step-new-tips"; readonly STEPS: { readonly DROP_TIPS: "drop-tips"; readonly REPLACE_TIPS: "replace-tips"; readonly SELECT_TIPS: "select-tips"; readonly SKIP: "skip"; }; }; readonly SKIP_STEP_WITH_SAME_TIPS: { readonly ROUTE: "skip-to-next-step-same-tips"; readonly STEPS: { readonly SKIP: "skip"; }; }; }'.

Check failure on line 43 in app/src/organisms/ErrorRecoveryFlows/RecoveryOptions/HomeAndRetry.tsx

View workflow job for this annotation

GitHub Actions / js checks

Unsafe argument of type `any` assigned to a parameter of type `RouteStep | undefined`
)
const buildBodyText = (): JSX.Element => (
<Trans
t={t}
i18nKey="carefully_move_labware"
components={{ block: <LegacyStyledText as="p" /> }}
/>
)
return (
<TwoColTextAndFailedStepNextStep
{...props}
leftColTitle={t('prepare_deck_for_homing')}
leftColBodyText={buildBodyText()}
primaryBtnCopy={t('continue')}
primaryBtnOnClick={primaryBtnOnClick}
/>
)
}

export function HomeGantryBeforeRetry(
props: RecoveryContentProps
): JSX.Element {
const { t } = useTranslation('error_recovery')
const { recoveryCommands, routeUpdateActions } = props
const { homeAll } = recoveryCommands
const { handleMotionRouting, proceedToRouteAndStep } = routeUpdateActions
const { HOME_AND_RETRY } = RECOVERY_MAP

Check failure on line 70 in app/src/organisms/ErrorRecoveryFlows/RecoveryOptions/HomeAndRetry.tsx

View workflow job for this annotation

GitHub Actions / js checks

Property 'HOME_AND_RETRY' does not exist on type '{ readonly DROP_TIP_FLOWS: { readonly ROUTE: "drop-tip"; readonly STEPS: { readonly BEGIN_REMOVAL: "begin-removal"; readonly BEFORE_BEGINNING: "before-beginning"; readonly CHOOSE_TIP_DROP: "choose-tip-drop"; readonly CHOOSE_BLOWOUT: "choose-blowout"; }; }; readonly ERROR_WHILE_RECOVERING: { readonly ROUTE: "error"; readonly STEPS: { readonly RECOVERY_ACTION_FAILED: "recovery-action-failed"; readonly DROP_TIP_BLOWOUT_FAILED: "drop-tip-blowout-failed"; readonly DROP_TIP_TIP_DROP_FAILED: "drop-tip-tip-drop-failed"; readonly DROP_TIP_GENERAL_ERROR: "drop-tip-general-error"; }; }; readonly ROBOT_CANCELING: { readonly ROUTE: "robot-cancel-run"; readonly STEPS: { readonly CANCELING: "canceling"; }; }; readonly ROBOT_IN_MOTION: { readonly ROUTE: "robot-in-motion"; readonly STEPS: { readonly IN_MOTION: "in-motion"; }; }; readonly ROBOT_PICKING_UP_TIPS: { readonly ROUTE: "robot-picking-up-tips"; readonly STEPS: { readonly PICKING_UP_TIPS: "picking-up-tips"; }; }; readonly ROBOT_RELEASING_LABWARE: { readonly ROUTE: "robot-releasing-labware"; readonly STEPS: { readonly RELEASING_LABWARE: "releasing-labware"; }; }; readonly ROBOT_RESUMING: { readonly ROUTE: "robot-resuming"; readonly STEPS: { readonly RESUMING: "resuming"; }; }; readonly ROBOT_RETRYING_STEP: { readonly ROUTE: "robot-retrying-step"; readonly STEPS: { readonly RETRYING: "retrying"; }; }; readonly ROBOT_SKIPPING_STEP: { readonly ROUTE: "robot-skipping-to-next-step"; readonly STEPS: { readonly SKIPPING: "skipping"; }; }; readonly ROBOT_DOOR_OPEN: { readonly ROUTE: "door"; readonly STEPS: { readonly DOOR_OPEN: "door-open"; }; }; readonly ROBOT_DOOR_OPEN_SPECIAL: { readonly ROUTE: "door-special"; readonly STEPS: { readonly DOOR_OPEN: "door-open"; }; }; readonly OPTION_SELECTION: { readonly ROUTE: "option-selection"; readonly STEPS: { readonly SELECT: "select"; }; }; readonly CANCEL_RUN: { readonly ROUTE: "cancel-run"; readonly STEPS: { readonly CONFIRM_CANCEL: "confirm-cancel"; }; }; readonly IGNORE_AND_SKIP: { readonly ROUTE: "ignore-and-skip-step"; readonly STEPS: { readonly SELECT_IGNORE_KIND: "select-ignore"; readonly SKIP_STEP: "skip-step"; }; }; readonly MANUAL_FILL_AND_SKIP: { readonly ROUTE: "manual-fill-well-and-skip"; readonly STEPS: { readonly MANUAL_FILL: "manual-fill"; readonly SKIP: "skip"; }; }; readonly MANUAL_MOVE_AND_SKIP: { readonly ROUTE: "manual-move-labware-and-skip"; readonly STEPS: { readonly GRIPPER_HOLDING_LABWARE: "gripper-holding-labware"; readonly GRIPPER_RELEASE_LABWARE: "gripper-release-labware"; readonly CLOSE_DOOR_GRIPPER_Z_HOME: "close-robot-door"; readonly MANUAL_MOVE: "manual-move"; readonly SKIP: "skip"; }; }; readonly MANUAL_REPLACE_AND_RETRY: { readonly ROUTE: "manual-replace-and-retry"; readonly STEPS: { readonly GRIPPER_HOLDING_LABWARE: "gripper-holding-labware"; readonly GRIPPER_RELEASE_LABWARE: "gripper-release-labware"; readonly CLOSE_DOOR_GRIPPER_Z_HOME: "close-robot-door"; readonly MANUAL_REPLACE: "manual-replace"; readonly RETRY: "retry"; }; }; readonly REFILL_AND_RESUME: { readonly ROUTE: "refill-and-resume"; readonly STEPS: {}; }; readonly RETRY_STEP: { readonly ROUTE: "retry-step"; readonly STEPS: { readonly CONFIRM_RETRY: "confirm-retry"; }; }; readonly RETRY_NEW_TIPS: { readonly ROUTE: "retry-new-tips"; readonly STEPS: { readonly DROP_TIPS: "drop-tips"; readonly REPLACE_TIPS: "replace-tips"; readonly SELECT_TIPS: "select-tips"; readonly RETRY: "retry"; }; }; readonly RETRY_SAME_TIPS: { readonly ROUTE: "retry-same-tips"; readonly STEPS: { readonly RETRY: "retry"; }; }; readonly SKIP_STEP_WITH_NEW_TIPS: { readonly ROUTE: "skip-to-next-step-new-tips"; readonly STEPS: { readonly DROP_TIPS: "drop-tips"; readonly REPLACE_TIPS: "replace-tips"; readonly SELECT_TIPS: "select-tips"; readonly SKIP: "skip"; }; }; readonly SKIP_STEP_WITH_SAME_TIPS: { readonly ROUTE: "skip-to-next-step-same-tips"; readonly STEPS: { readonly SKIP: "skip"; }; }; }'.
const buildBodyText = (): JSX.Element => (
<Trans
t={t}
i18nKey="take_necessary_actions_home"
components={{ block: <LegacyStyledText as="p" /> }}
/>
)
const primaryBtnOnClick = (): Promise<void> =>
handleMotionRouting(true)
.then(() => homeAll())
.then(() => handleMotionRouting(false))
.then(() =>
proceedToRouteAndStep(
HOME_AND_RETRY.ROUTE,

Check failure on line 84 in app/src/organisms/ErrorRecoveryFlows/RecoveryOptions/HomeAndRetry.tsx

View workflow job for this annotation

GitHub Actions / js checks

Unsafe argument of type `any` assigned to a parameter of type `"error" | "drop-tip" | "robot-cancel-run" | "robot-in-motion" | "robot-picking-up-tips" | "robot-releasing-labware" | "robot-resuming" | "robot-retrying-step" | "robot-skipping-to-next-step" | "door" | "door-special" | "option-selection" | "cancel-run" | "ignore-and-skip-step" | "manual-fill-well-and-skip" | "manual-move-labware-and-skip" | "manual-replace-and-retry" | "refill-and-resume" | "retry-step" | "retry-new-tips" | "retry-same-tips" | "skip-to-next-step-new-tips" | "skip-to-next-step-same-tips"`
HOME_AND_RETRY.STEPS.CONFIRM_RETRY

Check failure on line 85 in app/src/organisms/ErrorRecoveryFlows/RecoveryOptions/HomeAndRetry.tsx

View workflow job for this annotation

GitHub Actions / js checks

Unsafe argument of type `any` assigned to a parameter of type `RouteStep | undefined`
)
)

return (
<TwoColTextAndFailedStepNextStep
{...props}
leftColTitle={t('home_gantry')}
leftColBodyText={buildBodyText()}
primaryBtnCopy={t('home_now')}
primaryBtnOnClick={primaryBtnOnClick}
/>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ export interface UseRecoveryCommandsResult {
homeExceptPlungers: () => Promise<CommandData[]>
/* A non-terminal recovery command */
moveLabwareWithoutPause: () => Promise<CommandData[]>

/* Home all attached axes */
homeAll: () => Promise<CommandData[]>
}

// TODO(jh, 07-24-24): Create tighter abstractions for terminal vs. non-terminal commands.
Expand Down Expand Up @@ -349,6 +352,12 @@ export const RELEASE_GRIPPER_JAW: CreateCommand = {
intent: 'fixit',
}

export const HOME_ALL: CreateCommand = {
commandType: 'home',
params: {},
intent: 'fixit',
}

// in case the gripper does not know the position after a stall/collision we must update the position.
export const UPDATE_ESTIMATORS_EXCEPT_PLUNGERS: CreateCommand = {
commandType: 'unsafe/updatePositionEstimators',
Expand Down

0 comments on commit e27ff37

Please sign in to comment.