diff --git a/app/src/assets/localization/en/quick_transfer.json b/app/src/assets/localization/en/quick_transfer.json index d80586cba53..0cb31912964 100644 --- a/app/src/assets/localization/en/quick_transfer.json +++ b/app/src/assets/localization/en/quick_transfer.json @@ -96,7 +96,7 @@ "pipette_path": "Pipette path", "pipette_path_multi_aspirate": "Multi-aspirate", "pipette_path_multi_dispense": "Multi-dispense", - "pipette_path_multi_dispense_volume_blowout": "Multi-dispense, {{volume}} disposal volume, blowout into {{blowOutLocation}}", + "pipette_path_multi_dispense_volume_blowout": "Multi-dispense, {{volume}} disposal volume, blowout {{blowOutLocation}}", "pipette_path_single": "Single transfers", "pre_wet_tip": "Pre-wet tip", "quick_transfer": "Quick transfer", diff --git a/app/src/organisms/OnDeviceDisplay/RunningProtocol/ConfirmCancelRunModal.tsx b/app/src/organisms/OnDeviceDisplay/RunningProtocol/ConfirmCancelRunModal.tsx index e740e1aa53a..ce132df4970 100644 --- a/app/src/organisms/OnDeviceDisplay/RunningProtocol/ConfirmCancelRunModal.tsx +++ b/app/src/organisms/OnDeviceDisplay/RunningProtocol/ConfirmCancelRunModal.tsx @@ -56,16 +56,8 @@ export function ConfirmCancelRunModal({ isLoading: isDismissing, } = useDismissCurrentRunMutation({ onSettled: () => { - if (isQuickTransfer && protocolId != null) { + if (isQuickTransfer) { deleteRun(runId) - navigate(`/quick-transfer/${protocolId}`) - } else if (isQuickTransfer) { - deleteRun(runId) - navigate('/quick-transfer') - } else if (protocolId != null) { - navigate(`/protocols/${protocolId}`) - } else { - navigate('/protocols') } }, }) @@ -97,6 +89,15 @@ export function ConfirmCancelRunModal({ trackProtocolRunEvent({ name: ANALYTICS_PROTOCOL_RUN_ACTION.CANCEL }) if (!isActiveRun) { dismissCurrentRun(runId) + if (isQuickTransfer && protocolId != null) { + navigate(`/quick-transfer/${protocolId}`) + } else if (isQuickTransfer) { + navigate('/quick-transfer') + } else if (protocolId != null) { + navigate(`/protocols/${protocolId}`) + } else { + navigate('/protocols') + } } } }, [runStatus]) diff --git a/app/src/organisms/OnDeviceDisplay/RunningProtocol/__tests__/ConfirmCancelRunModal.test.tsx b/app/src/organisms/OnDeviceDisplay/RunningProtocol/__tests__/ConfirmCancelRunModal.test.tsx index 56651d3e44d..93c57b39128 100644 --- a/app/src/organisms/OnDeviceDisplay/RunningProtocol/__tests__/ConfirmCancelRunModal.test.tsx +++ b/app/src/organisms/OnDeviceDisplay/RunningProtocol/__tests__/ConfirmCancelRunModal.test.tsx @@ -148,6 +148,21 @@ describe('ConfirmCancelRunModal', () => { expect(mockDismissCurrentRun).toHaveBeenCalled() expect(mockTrackProtocolRunEvent).toHaveBeenCalled() + expect(mockNavigate).toHaveBeenCalledWith('/protocols') + }) + + it('when quick transfer run is stopped, the run is dismissed and the modal closes if the run is not yet active', () => { + props = { + ...props, + isActiveRun: false, + isQuickTransfer: true, + } + when(useRunStatus).calledWith(RUN_ID).thenReturn(RUN_STATUS_STOPPED) + render(props) + + expect(mockDismissCurrentRun).toHaveBeenCalled() + expect(mockTrackProtocolRunEvent).toHaveBeenCalled() + expect(mockNavigate).toHaveBeenCalledWith('/quick-transfer') }) it('when run is stopped, the run is not dismissed if the run is active', () => { diff --git a/app/src/organisms/QuickTransferFlow/QuickTransferAdvancedSettings/BlowOut.tsx b/app/src/organisms/QuickTransferFlow/QuickTransferAdvancedSettings/BlowOut.tsx index 5b7362b243d..236fa86c462 100644 --- a/app/src/organisms/QuickTransferFlow/QuickTransferAdvancedSettings/BlowOut.tsx +++ b/app/src/organisms/QuickTransferFlow/QuickTransferAdvancedSettings/BlowOut.tsx @@ -1,4 +1,5 @@ import * as React from 'react' +import isEqual from 'lodash/isEqual' import { useTranslation } from 'react-i18next' import { createPortal } from 'react-dom' import { @@ -197,7 +198,10 @@ export function BlowOut(props: BlowOutProps): JSX.Element { {blowOutLocationItems.map(blowOutLocationItem => ( { setBlowOutLocation( blowOutLocationItem.location as BlowOutLocation diff --git a/app/src/organisms/QuickTransferFlow/QuickTransferAdvancedSettings/PipettePath.tsx b/app/src/organisms/QuickTransferFlow/QuickTransferAdvancedSettings/PipettePath.tsx index ef07f3dc2bb..a192af4cb6b 100644 --- a/app/src/organisms/QuickTransferFlow/QuickTransferAdvancedSettings/PipettePath.tsx +++ b/app/src/organisms/QuickTransferFlow/QuickTransferAdvancedSettings/PipettePath.tsx @@ -1,4 +1,5 @@ import * as React from 'react' +import isEqual from 'lodash/isEqual' import { useTranslation } from 'react-i18next' import { createPortal } from 'react-dom' import { @@ -218,7 +219,10 @@ export function PipettePath(props: PipettePathProps): JSX.Element { {blowOutLocationItems.map(option => ( { setBlowOutLocation(option.location) }}