Skip to content

Commit 4134efc

Browse files
authored
fix(app): fix align error display with pd and fix conditional issues (#18998)
* fix(app): fix align error display with pd and fix conditional issues
1 parent 9317ea9 commit 4134efc

File tree

14 files changed

+79
-21
lines changed

14 files changed

+79
-21
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"compatibility_error": "The {{pipetteOrLabware}} is incompatible with this liquid class",
4545
"condition_before_aspirating": "Condition before aspirating",
4646
"condition_description": "First aspirate and dispense liquid into the source well to ensure a more accurate first multi-dispense",
47+
"condition_max_volume": "Max {{max}} µL",
4748
"condition_volume": "Conditioning volume (µL)",
4849
"condition": "Condition",
4950
"consolidate_volume_error": "The selected destination well is too small to consolidate into. Try consolidating from fewer wells.",
@@ -73,6 +74,7 @@
7374
"dispense_volume_µL": "Dispense volume per well (µL)",
7475
"dispense_volume": "Dispense volume per well",
7576
"dispense": "Dispense",
77+
"disposal_volume_flow_rate": "Between {{min}} and {{max}}",
7678
"disposal_volume_label": "{{volume}}, {{location}}, {{flowRate}} µL/s",
7779
"disposal_volume_µL": "Disposal volume (µL)",
7880
"disposal_volume": "Disposal volume",
@@ -128,8 +130,8 @@
128130
"pre_wet_tip": "Pre-wet tip",
129131
"push_out_after_dispensing": "Push out after dispensing",
130132
"push_out_description": "Helps ensure all liquid leaves the tip",
131-
"push_out_volume": "Push out volume (µL)",
132133
"push_out_value": "{{volume}} µL",
134+
"push_out_volume": "Push out volume (µL)",
133135
"push_out": "Push out",
134136
"quick_transfer_volume": "Quick Transfer {{volume}}µL",
135137
"quick_transfer": "Quick transfer",
@@ -188,6 +190,7 @@
188190
"touch_tip_after_dispensing": "Touch tip after dispensing",
189191
"touch_tip_description_aspirating": "Touch tip to each side of the well after aspirating",
190192
"touch_tip_description_dispensing": "Touch tip to each side of the well after dispensing",
193+
"touch_tip_from_top": "Between {{min}} and {{max}}",
191194
"touch_tip_position_mm": "Touch tip position from top of well (mm)",
192195
"touch_tip_value": "{{speed}}mm/s, {{position}} mm from bottom",
193196
"touch_tip": "Touch tip",

app/src/organisms/ODD/ProtocolDetails/ProtocolDetailsSkeleton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function ProtocolDetailsHeaderChipSkeleton(): JSX.Element {
1313
)
1414
}
1515

16-
export function ProcotolDetailsHeaderTitleSkeleton(): JSX.Element {
16+
export function ProtocolDetailsHeaderTitleSkeleton(): JSX.Element {
1717
return (
1818
<Skeleton
1919
width="42rem"

app/src/organisms/ODD/ProtocolDetails/__tests__/ProtocolDetailsSkeleton.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { render, screen } from '@testing-library/react'
22
import { describe, expect, it } from 'vitest'
33

44
import {
5-
ProcotolDetailsHeaderTitleSkeleton,
65
ProtocolDetailsHeaderChipSkeleton,
6+
ProtocolDetailsHeaderTitleSkeleton,
77
ProtocolDetailsSectionContentSkeleton,
88
} from '../ProtocolDetailsSkeleton'
99

@@ -16,7 +16,7 @@ describe('ProtocolDetailsSkeleton', () => {
1616
})
1717

1818
it('renders a Skeleton to replace the title section', () => {
19-
render(<ProcotolDetailsHeaderTitleSkeleton />)
19+
render(<ProtocolDetailsHeaderTitleSkeleton />)
2020
const titleSkeleton = screen.getAllByTestId('Skeleton')
2121
expect(titleSkeleton.length).toEqual(1)
2222
expect(titleSkeleton[0]).toHaveStyle('background-size: 99rem')

app/src/organisms/ODD/QuickTransferFlow/QuickTransferAdvancedSettings/Condition.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { useTrackEventWithRobotSerial } from '/app/redux-resources/analytics'
2222
import { ANALYTICS_QUICK_TRANSFER_SETTING_SAVED } from '/app/redux/analytics'
2323

2424
import { ACTIONS } from '../constants'
25+
import { getMaxConditioningVolume } from '../utils'
2526

2627
import type { Dispatch } from 'react'
2728
import type {
@@ -119,6 +120,18 @@ export function Condition(props: DelayProps): JSX.Element {
119120
buttonIsDisabled = conditionVolume == null
120121
}
121122

123+
const maxConditioningVolume = getMaxConditioningVolume(
124+
state.volume,
125+
state.disposalVolumeDispenseSettings?.volume ?? 0,
126+
state.tipRack,
127+
state.pipette
128+
)
129+
130+
const volumeError =
131+
conditionVolume != null && conditionVolume > maxConditioningVolume
132+
? t('value_out_of_range', { min: 0, max: maxConditioningVolume })
133+
: null
134+
122135
return createPortal(
123136
<Flex position={POSITION_FIXED} backgroundColor={COLORS.white} width="100%">
124137
<ChildNavigation
@@ -167,16 +180,20 @@ export function Condition(props: DelayProps): JSX.Element {
167180
<Flex
168181
width="30.5rem"
169182
height="100%"
170-
gridGap={SPACING.spacing24}
183+
gridGap={SPACING.spacing8}
171184
flexDirection={DIRECTION_COLUMN}
172185
marginTop={SPACING.spacing68}
173186
>
174187
<InputField
175188
type="number"
176189
value={conditionVolume}
177190
title={t('condition_volume')}
191+
error={volumeError}
178192
readOnly
179193
/>
194+
<StyledText oddStyle="bodyTextRegular" color={COLORS.grey60}>
195+
{t('condition_max_volume', { max: maxConditioningVolume })}
196+
</StyledText>
180197
</Flex>
181198
<Flex
182199
paddingX={SPACING.spacing24}

app/src/organisms/ODD/QuickTransferFlow/QuickTransferAdvancedSettings/DisposalVolume.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export function DisposalVolume(props: DisposalVolumeProps): JSX.Element {
118118
LOW_VOLUME_PIPETTES.includes(pipetteName)
119119
? liquidSpecs.lowVolumeDefault.supportedTips[tipType]
120120
: liquidSpecs.default.supportedTips[tipType]
121-
const minFlowRate = 1
121+
const minFlowRate = 0.1
122122
const maxFlowRate = Math.floor(flowRatesForSupportedTip?.uiMaxFlowRate ?? 0)
123123

124124
const flowRateError =
@@ -168,8 +168,6 @@ export function DisposalVolume(props: DisposalVolumeProps): JSX.Element {
168168
const setSaveOrContinueButtonText =
169169
currentStep < 3 ? t('shared:continue') : t('shared:save')
170170

171-
// ToDo Add flowRate range
172-
173171
let buttonIsDisabled = false
174172
if (currentStep === 2) {
175173
buttonIsDisabled = volume == null
@@ -295,6 +293,12 @@ export function DisposalVolume(props: DisposalVolumeProps): JSX.Element {
295293
error={flowRateError}
296294
readOnly
297295
/>
296+
<StyledText oddStyle="bodyTextRegular" color={COLORS.grey60}>
297+
{t('disposal_volume_flow_rate', {
298+
min: minFlowRate,
299+
max: maxFlowRate,
300+
})}
301+
</StyledText>
298302
</Flex>
299303
<Flex
300304
paddingX={SPACING.spacing24}

app/src/organisms/ODD/QuickTransferFlow/QuickTransferAdvancedSettings/TouchTip.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ export function TouchTip(props: TouchTipProps): JSX.Element {
268268
<Flex
269269
width="30.5rem"
270270
height="100%"
271-
gridGap={SPACING.spacing24}
271+
gridGap={SPACING.spacing8}
272272
flexDirection={DIRECTION_COLUMN}
273273
marginTop={SPACING.spacing68}
274274
>
@@ -279,6 +279,12 @@ export function TouchTip(props: TouchTipProps): JSX.Element {
279279
error={positionError}
280280
readOnly
281281
/>
282+
<StyledText oddStyle="bodyTextRegular" color={COLORS.grey60}>
283+
{t('touch_tip_from_top', {
284+
min: positionRange.min,
285+
max: positionRange.max,
286+
})}
287+
</StyledText>
282288
</Flex>
283289
<Flex
284290
paddingX={SPACING.spacing24}

app/src/organisms/ODD/QuickTransferFlow/SummaryAndSettings.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ export function SummaryAndSettings(
105105
}
106106
})
107107

108-
const isMultiTransferAspirate = state?.path === 'multiAspirate'
109-
const isMultiTransferDispense = state?.path === 'multiDispense'
108+
const isMultiTransferAspirate = state?.path === 'multiDispense'
109+
const isMultiTransferDispense = state?.path === 'multiAspirate'
110110

111111
const handleClickCreateTransfer = (): void => {
112112
setShowSaveOrRunModal(true)

app/src/organisms/ODD/QuickTransferFlow/__tests__/utils/checkLiquidClassCompatibility.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ describe('checkLiquidClassCompatibility', () => {
120120
})
121121

122122
it('liquid volume should be less than 10 incompatible', () => {
123-
const invalidState = { ...mockState, volume: 10 }
124-
console.log('invalidState', invalidState)
123+
const invalidState = { ...mockState, volume: 0 }
125124
const result = checkLiquidClassCompatibility(mockLiquid, invalidState)
126125
expect(result.incompatible).toBe(true)
127126
expect(result.volumeIncompatible).toBe(true)

app/src/organisms/ODD/QuickTransferFlow/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import type { ComponentProps } from 'react'
3131
import type { SmallButton } from '/app/atoms/buttons'
3232
import type { QuickTransferWizardState } from './types'
3333

34-
// const QUICK_TRANSFER_WIZARD_STEPS = 8
3534
const initialQuickTransferState: QuickTransferWizardState = {}
3635

3736
export const QuickTransferFlow = (): JSX.Element => {

app/src/organisms/ODD/QuickTransferFlow/utils/checkLiquidClassCompatibility.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { getFlexNameConversion } from '@opentrons/shared-data'
33
import type { LiquidClass } from '@opentrons/shared-data'
44
import type { QuickTransferWizardState } from '../types'
55

6-
const MINIMUM_LIQUID_CLASS_VOLUME = 10
6+
const MINIMUM_LIQUID_CLASS_VOLUME = 1
77
export interface Compatibility {
88
pipetteIncompatible?: boolean
99
tipRackIncompatible?: boolean

0 commit comments

Comments
 (0)