@@ -377,16 +377,39 @@ export const savedStepForms = (
377
377
const prevInitialDeckSetupStep =
378
378
savedStepForms [ INITIAL_DECK_SETUP_STEP_ID ]
379
379
const locationUpdate = `${ name } LocationUpdate`
380
- return {
381
- ...savedStepForms ,
382
- [ INITIAL_DECK_SETUP_STEP_ID ] : {
383
- ...prevInitialDeckSetupStep ,
384
- [ locationUpdate ] : {
385
- ...prevInitialDeckSetupStep [ locationUpdate ] ,
386
- [ id ] : location ,
387
- } ,
388
- } ,
389
- }
380
+ return mapValues (
381
+ savedStepForms ,
382
+ ( form : FormData ) : FormData => {
383
+ if ( form . stepType === 'manualIntervention' ) {
384
+ return {
385
+ ...form ,
386
+ [ INITIAL_DECK_SETUP_STEP_ID ] : {
387
+ ...prevInitialDeckSetupStep ,
388
+ [ locationUpdate ] : {
389
+ ...prevInitialDeckSetupStep [ locationUpdate ] ,
390
+ [ id ] : location ,
391
+ } ,
392
+ } ,
393
+ }
394
+ } else if (
395
+ form . dropTip_location == null &&
396
+ ( name === 'trashBin' || name === 'wasteChute' )
397
+ ) {
398
+ return {
399
+ ...form ,
400
+ ...handleFormChange (
401
+ {
402
+ dropTip_location : id ,
403
+ } ,
404
+ form ,
405
+ _getPipetteEntitiesRootState ( rootState ) ,
406
+ _getLabwareEntitiesRootState ( rootState )
407
+ ) ,
408
+ }
409
+ }
410
+ return form
411
+ }
412
+ )
390
413
}
391
414
case 'DELETE_DECK_FIXTURE' : {
392
415
const { id } = action . payload
@@ -396,13 +419,41 @@ export const savedStepForms = (
396
419
return mapValues (
397
420
savedStepForms ,
398
421
( form : FormData ) : FormData => {
399
- const updatedLocation = omit ( form [ locationUpdate ] || { } , id )
422
+ if ( form . stepType === 'manualIntervention' ) {
423
+ const updatedLocation = omit ( form [ locationUpdate ] || { } , id )
400
424
401
- return {
402
- ...form ,
403
- [ locationUpdate ] :
404
- Object . keys ( updatedLocation ) . length > 0 ? updatedLocation : { } ,
425
+ return {
426
+ ...form ,
427
+ [ locationUpdate ] :
428
+ Object . keys ( updatedLocation ) . length > 0 ? updatedLocation : { } ,
429
+ }
430
+ } else if ( id . includes ( form . dropTip_location as string ) ) {
431
+ return {
432
+ ...form ,
433
+ ...handleFormChange (
434
+ {
435
+ dropTip_location : null ,
436
+ } ,
437
+ form ,
438
+ _getPipetteEntitiesRootState ( rootState ) ,
439
+ _getLabwareEntitiesRootState ( rootState )
440
+ ) ,
441
+ }
442
+ } else if ( id . includes ( form . newLocation as string ) ) {
443
+ return {
444
+ ...form ,
445
+ ...handleFormChange (
446
+ {
447
+ newLocation : null ,
448
+ } ,
449
+ form ,
450
+ _getPipetteEntitiesRootState ( rootState ) ,
451
+ _getLabwareEntitiesRootState ( rootState )
452
+ ) ,
453
+ }
405
454
}
455
+
456
+ return form
406
457
}
407
458
)
408
459
}
@@ -668,7 +719,6 @@ export const savedStepForms = (
668
719
return { ...savedForm , ...deleteLabwareUpdate }
669
720
} )
670
721
}
671
-
672
722
case 'DELETE_PIPETTES' : {
673
723
// remove references to pipettes that have been deleted
674
724
const deletedPipetteIds = action . payload
0 commit comments