Skip to content

Commit 9c3d07a

Browse files
authored
refactor(app): QT disposal volume field unification (#20230)
closes AUTH-2539 AUTH-2542
1 parent 141e6cb commit 9c3d07a

File tree

8 files changed

+97
-47
lines changed

8 files changed

+97
-47
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export function AirGap(props: AirGapProps): JSX.Element {
119119
? getAspirateAirGapVolumeRange(state.pipette, state.tipRack)
120120
: getDispenseAirGapVolumeRange(
121121
state.volume,
122-
state?.disposalVolume ?? 0,
122+
state?.disposalVolumeDispenseSettings?.volume ?? 0,
123123
state.path,
124124
state.pipette,
125125
state.tipRack

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export function PipettePath(props: PipettePathProps): JSX.Element {
5353
>(state.blowOutDispense?.location)
5454

5555
const [disposalVolume, setDisposalVolume] = useState<number | undefined>(
56-
state?.disposalVolume
56+
state?.disposalVolumeDispenseSettings?.volume
5757
)
5858
const maxPipetteVolume = Object.values(state.pipette.liquids)[0].maxVolume
5959
const tipVolume = Object.values(state.tipRack.wells)[0].totalLiquidVolume
@@ -118,8 +118,6 @@ export function PipettePath(props: PipettePathProps): JSX.Element {
118118
dispatch({
119119
type: ACTIONS.SET_PIPETTE_PATH,
120120
path: selectedPath as PathOption,
121-
disposalVolume,
122-
blowOutLocation,
123121
})
124122
trackEventWithRobotSerial({
125123
name: ANALYTICS_QUICK_TRANSFER_SETTING_SAVED,

app/src/organisms/ODD/QuickTransferFlow/__tests__/QuickTransferAdvancedSettings/PipettePath.test.tsx

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,10 @@ describe('PipettePath', () => {
156156
state: {
157157
...props.state,
158158
transferType: 'distribute',
159-
disposalVolume: 20,
160-
blowOutDispense: {
161-
location: 'source_well',
159+
path: 'multiDispense',
160+
disposalVolumeDispenseSettings: {
161+
volume: 20,
162+
blowOutLocation: 'source_well',
162163
flowRate: 10,
163164
},
164165
},
@@ -188,9 +189,9 @@ describe('PipettePath', () => {
188189
...props.state,
189190
transferType: 'distribute',
190191
path: 'multiDispense',
191-
disposalVolume: 20,
192-
blowOutDispense: {
193-
location: 'source_well',
192+
disposalVolumeDispenseSettings: {
193+
volume: 20,
194+
blowOutLocation: 'source_well',
194195
flowRate: 10,
195196
},
196197
},
@@ -221,9 +222,9 @@ describe('PipettePath', () => {
221222
...props.state,
222223
transferType: 'distribute',
223224
path: 'multiDispense',
224-
disposalVolume: 20,
225-
blowOutDispense: {
226-
location: 'source_well',
225+
disposalVolumeDispenseSettings: {
226+
volume: 20,
227+
blowOutLocation: 'source_well',
227228
flowRate: 10,
228229
},
229230
},
@@ -233,9 +234,5 @@ describe('PipettePath', () => {
233234
fireEvent.click(continueBtn)
234235
fireEvent.click(continueBtn)
235236
screen.getByText('Source well')
236-
const saveBtn = screen.getByTestId('ChildNavigation_Primary_Button')
237-
fireEvent.click(saveBtn)
238-
expect(props.dispatch).toHaveBeenCalled()
239-
expect(mockTrackEventWithRobotSerial).toHaveBeenCalled()
240237
})
241238
})

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

Lines changed: 64 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ describe('getInitialSummaryState', () => {
4242
path: 'single',
4343
liquidClassValuesInitialized: false,
4444
changeTip: 'always',
45+
blowOutDispense: {
46+
flowRate: 75,
47+
location: {
48+
cutoutFixtureId: 'trashBinAdapter',
49+
cutoutId: 'cutoutA3',
50+
},
51+
},
4552
} as any,
4653
deckConfig: [
4754
{
@@ -125,17 +132,71 @@ describe('getInitialSummaryState', () => {
125132
})
126133
})
127134
it('generates the summary state with correct default value for 1 to n transfer', () => {
135+
const distributeProps = {
136+
state: {
137+
pipette: {
138+
channels: 1,
139+
liquids: {
140+
default: {
141+
maxVolume: 100,
142+
supportedTips: {
143+
t50: {
144+
defaultAspirateFlowRate: {
145+
default: 50,
146+
},
147+
defaultDispenseFlowRate: {
148+
default: 75,
149+
},
150+
},
151+
},
152+
},
153+
},
154+
} as any,
155+
mount: 'left',
156+
tipRack: {
157+
wells: {
158+
A1: {
159+
totalLiquidVolume: 50,
160+
},
161+
},
162+
} as any,
163+
source: {} as any,
164+
sourceWells: ['A1'],
165+
destination: 'source',
166+
destinationWells: ['A1'],
167+
transferType: 'transfer',
168+
volume: 25,
169+
path: 'single',
170+
liquidClassValuesInitialized: false,
171+
changeTip: 'always',
172+
disposalVolumeDispenseSettings: {
173+
volume: 1,
174+
flowRate: 75,
175+
blowoutLocation: {
176+
cutoutFixtureId: 'trashBinAdapter',
177+
cutoutId: 'cutoutA3',
178+
},
179+
},
180+
} as any,
181+
deckConfig: [
182+
{
183+
cutoutId: 'cutoutA3',
184+
cutoutFixtureId: 'trashBinAdapter',
185+
},
186+
],
187+
} as any
188+
128189
const initialSummaryState = getInitialSummaryState({
129-
...props,
190+
...distributeProps,
130191
state: {
131-
...props.state,
192+
...distributeProps.state,
132193
volume: 1,
133194
path: 'multiDispense',
134195
transferType: 'distribute',
135196
},
136197
})
137198
expect(initialSummaryState).toEqual({
138-
...props.state,
199+
...distributeProps.state,
139200
volume: 1,
140201
transferType: 'distribute',
141202
aspirateFlowRate: 50,
@@ -149,11 +210,6 @@ describe('getInitialSummaryState', () => {
149210
cutoutId: 'cutoutA3',
150211
cutoutFixtureId: 'trashBinAdapter',
151212
},
152-
disposalVolume: 1,
153-
blowOutDispense: {
154-
location: { cutoutId: 'cutoutA3', cutoutFixtureId: 'trashBinAdapter' },
155-
flowRate: 75,
156-
},
157213
})
158214
})
159215
it('generates the summary state with correct default value for 1 to n transfer with too high of volume for multiDispense', () => {

app/src/organisms/ODD/QuickTransferFlow/reducers.ts

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export function quickTransferWizardReducer(
9696
path: action.path,
9797
}
9898
}
99+
99100
case 'SET_CHANGE_TIP': {
100101
return {
101102
...state,
@@ -135,22 +136,9 @@ export function quickTransferSummaryReducer(
135136
}
136137
}
137138
case 'SET_PIPETTE_PATH': {
138-
if (action.path === 'multiDispense') {
139-
return {
140-
...state,
141-
path: action.path,
142-
disposalVolume: action.disposalVolume,
143-
blowOutDispense: {
144-
location: action.blowOutLocation,
145-
flowRate: state.dispenseFlowRate,
146-
},
147-
}
148-
} else {
149-
return {
150-
...state,
151-
path: action.path,
152-
disposalVolume: undefined,
153-
}
139+
return {
140+
...state,
141+
path: action.path,
154142
}
155143
}
156144
case 'SET_ASPIRATE_TIP_POSITION': {

app/src/organisms/ODD/QuickTransferFlow/types.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ export interface QuickTransferWizardState {
2929
changeTip?: ChangeTipOptions
3030
dropTipLocation?: CutoutConfig | string
3131
liquidClassName?: string
32+
disposalVolumeDispenseSettings?: {
33+
volume: number
34+
blowOutLocation: BlowOutLocation
35+
flowRate: number
36+
}
3237
}
3338
export type PathOption = 'single' | 'multiAspirate' | 'multiDispense'
3439
export type ChangeTipOptions =
@@ -113,7 +118,6 @@ export interface QuickTransferSummaryState {
113118
}
114119
touchTipDispense?: number // specifies the tip position from the top of the well
115120
touchTipDispenseSpeed?: number
116-
disposalVolume?: number
117121
blowOutDispense?: {
118122
location?: BlowOutLocation
119123
flowRate?: number
@@ -188,8 +192,6 @@ interface SetDispenseFlowRateAction {
188192
interface SetPipettePath {
189193
type: typeof ACTIONS.SET_PIPETTE_PATH
190194
path: PathOption
191-
disposalVolume?: number
192-
blowOutLocation?: BlowOutLocation
193195
}
194196
interface SetAspirateTipPosition {
195197
type: typeof ACTIONS.SET_ASPIRATE_TIP_POSITION

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import type {
1212
PipetteV2Specs,
1313
} from '@opentrons/shared-data'
1414
import type {
15+
BlowOutLocation,
1516
ChangeTipOptions,
1617
PathOption,
1718
QuickTransferSummaryState,
@@ -36,6 +37,11 @@ export interface InitialSummaryStateProps {
3637
}
3738
changeTip: ChangeTipOptions
3839
dropTipLocation?: CutoutConfig
40+
disposalVolumeDispenseSettings?: {
41+
volume: number
42+
blowOutLocation: BlowOutLocation
43+
flowRate: number
44+
}
3945
}
4046
deckConfig: DeckConfiguration
4147
}
@@ -96,9 +102,12 @@ export function getInitialSummaryState(
96102
aspirateFlowRate: flowRatesForSupportedTip.defaultAspirateFlowRate.default,
97103
dispenseFlowRate: flowRatesForSupportedTip.defaultDispenseFlowRate.default,
98104
path,
99-
disposalVolume: path === 'multiDispense' ? state.volume : undefined,
100-
blowOutDispense:
105+
disposalVolumeDispenseSettings:
101106
path === 'multiDispense'
107+
? state.disposalVolumeDispenseSettings
108+
: undefined,
109+
blowOutDispense:
110+
path !== 'multiDispense'
102111
? {
103112
location: trashConfigCutout,
104113
flowRate: flowRatesForSupportedTip.defaultDispenseFlowRate.default,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ const getNoLiquidClassValues = (
220220
: dispense.retract.touchTip.params?.zOffset,
221221
touchTipDispenseSpeed: dispense.retract.touchTip.params?.speed,
222222
disposalVolumeDispenseSettings: {
223-
volume: 0,
223+
volume: pipette.liquids.default.minVolume,
224224
blowOutLocation:
225225
convertBlowoutLocation(
226226
dispense?.retract.blowout?.params?.location,

0 commit comments

Comments
 (0)