Skip to content

Commit

Permalink
fix(app): Fix green check flows post DQA (#16063)
Browse files Browse the repository at this point in the history
Closes RQA-3040, and RQA-3035
  • Loading branch information
mjhuff authored Aug 20, 2024
1 parent af14eb8 commit 3f48d03
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
13 changes: 6 additions & 7 deletions app/src/organisms/Devices/ProtocolRun/ProtocolRunSetup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
FLEX_ROBOT_TYPE,
OT2_ROBOT_TYPE,
parseAllRequiredModuleModels,
parseLiquidsInLoadOrder,
} from '@opentrons/shared-data'

import { Line } from '../../../atoms/structure'
Expand Down Expand Up @@ -165,11 +164,7 @@ export function ProtocolRunSetup({
})

const liquids = protocolAnalysis?.liquids ?? []
const liquidsInLoadOrder =
protocolAnalysis != null
? parseLiquidsInLoadOrder(liquids, protocolAnalysis.commands)
: []
const hasLiquids = liquidsInLoadOrder.length > 0
const hasLiquids = liquids.length > 0
const hasModules = protocolAnalysis != null && modules.length > 0
// need config compatibility (including check for single slot conflicts)
const requiredDeckConfigCompatibility = getRequiredDeckConfig(
Expand All @@ -191,7 +186,11 @@ export function ProtocolRunSetup({
const [liquidSetupComplete, setLiquidSetupComplete] = React.useState<boolean>(
!hasLiquids
)
if (!hasLiquids && missingSteps.includes('liquids')) {
if (
!hasLiquids &&
protocolAnalysis != null &&
missingSteps.includes('liquids')
) {
setMissingSteps(missingSteps.filter(step => step !== 'liquids'))
}
const [lpcComplete, setLpcComplete] = React.useState<boolean>(false)
Expand Down
15 changes: 8 additions & 7 deletions app/src/pages/ProtocolSetup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ function PrepareToRun({
: 'not ready'
// Liquids information
const liquidsInProtocol = mostRecentAnalysis?.liquids ?? []
const areLiquidsInProtocol = liquidsInProtocol.length > 0

const isReadyToRun =
incompleteInstrumentCount === 0 && areModulesReady && areFixturesReady
Expand All @@ -528,7 +529,7 @@ function PrepareToRun({
!(
labwareConfirmed &&
offsetsConfirmed &&
(liquidsConfirmed || liquidsInProtocol.length === 0)
(liquidsConfirmed || !areLiquidsInProtocol)
)
) {
confirmStepsComplete()
Expand Down Expand Up @@ -803,18 +804,16 @@ function PrepareToRun({
}}
title={i18n.format(t('liquids'), 'capitalize')}
status={
liquidsConfirmed || liquidsInProtocol.length === 0
? 'ready'
: 'general'
liquidsConfirmed || !areLiquidsInProtocol ? 'ready' : 'general'
}
detail={
liquidsInProtocol.length > 0
areLiquidsInProtocol
? t('initial_liquids_num', {
count: liquidsInProtocol.length,
})
: t('liquids_not_in_setup')
}
interactionDisabled={liquidsInProtocol.length === 0}
interactionDisabled={!areLiquidsInProtocol}
/>
</>
) : (
Expand Down Expand Up @@ -889,6 +888,8 @@ export function ProtocolSetup(): JSX.Element {
}
)

const areLiquidsInProtocol = (mostRecentAnalysis?.liquids?.length ?? 0) > 0

React.useEffect(() => {
if (mostRecentAnalysis?.status === 'completed') {
setIsPollingForCompletedAnalysis(false)
Expand Down Expand Up @@ -954,7 +955,7 @@ export function ProtocolSetup(): JSX.Element {
const missingSteps = [
!offsetsConfirmed ? t('applied_labware_offsets') : null,
!labwareConfirmed ? t('labware_placement') : null,
!liquidsConfirmed ? t('liquids') : null,
!liquidsConfirmed && areLiquidsInProtocol ? t('liquids') : null,
].filter(s => s != null)
const {
confirm: confirmMissingSteps,
Expand Down

0 comments on commit 3f48d03

Please sign in to comment.