Skip to content

Commit

Permalink
feat(app): add overpressure during prepare to aspirate to Error Recov…
Browse files Browse the repository at this point in the history
…ery (#16549)

Closes EXEC-557
  • Loading branch information
mjhuff authored Oct 21, 2024
1 parent d2829dd commit a5ae3fe
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { useState, useEffect } from 'react'
import head from 'lodash/head'
import { useTranslation } from 'react-i18next'
import { css } from 'styled-components'

import {
RESPONSIVENESS,
DIRECTION_COLUMN,
Flex,
SPACING,
Expand Down Expand Up @@ -108,11 +110,7 @@ export function RecoveryOptions({
isOnDevice,
}: RecoveryOptionsProps): JSX.Element {
return (
<Flex
flexDirection={DIRECTION_COLUMN}
gridGap={SPACING.spacing8}
width="100%"
>
<Flex css={RECOVERY_OPTION_CONTAINER_STYLE}>
{validRecoveryOptions.map((recoveryOption: RecoveryRoute) => {
const optionName = getRecoveryOptionCopy(recoveryOption, errorKind)
return (
Expand All @@ -133,6 +131,16 @@ export function RecoveryOptions({
)
}

const RECOVERY_OPTION_CONTAINER_STYLE = css`
flex-direction: ${DIRECTION_COLUMN};
grid-gap: ${SPACING.spacing4};
width: 100%;
@media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} {
grid-gap: ${SPACING.spacing8};
}
`

// Pre-fetch tip attachment status. Users are not blocked from proceeding at this step.
export function useCurrentTipStatus(
determineTipStatus: () => Promise<PipetteWithTip[]>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ import type { RunCommandError, RunTimeCommand } from '@opentrons/shared-data'

describe('getErrorKind', () => {
it.each([
{
commandType: 'prepareToAspirate',
errorType: DEFINED_ERROR_TYPES.OVERPRESSURE,
expectedError: ERROR_KINDS.OVERPRESSURE_PREPARE_TO_ASPIRATE,
},
{
commandType: 'aspirate',
errorType: DEFINED_ERROR_TYPES.OVERPRESSURE,
Expand Down
7 changes: 5 additions & 2 deletions app/src/organisms/ErrorRecoveryFlows/utils/getErrorKind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ export function getErrorKind(failedCommand: RunTimeCommand | null): ErrorKind {
const errorType = failedCommand?.error?.errorType

if (errorIsDefined) {
// todo(mm, 2024-07-02): Also handle aspirateInPlace and dispenseInPlace.
// https://opentrons.atlassian.net/browse/EXEC-593
if (
commandType === 'prepareToAspirate' &&
errorType === DEFINED_ERROR_TYPES.OVERPRESSURE
) {
return ERROR_KINDS.OVERPRESSURE_PREPARE_TO_ASPIRATE
} else if (
(commandType === 'aspirate' || commandType === 'aspirateInPlace') &&
errorType === DEFINED_ERROR_TYPES.OVERPRESSURE
) {
Expand Down

0 comments on commit a5ae3fe

Please sign in to comment.