From 604993f9efcf4c570ff7742da9109323facd89e2 Mon Sep 17 00:00:00 2001 From: Sarah Breen Date: Wed, 7 Aug 2024 15:54:02 -0400 Subject: [PATCH] fix(app): Quick transfer copy and logic fixes (#15923) Fix RQA-2918, RQA-2917, RQA-2907 --- .../QuickTransferAdvancedSettings/BlowOut.tsx | 4 ++-- .../QuickTransferAdvancedSettings/Delay.tsx | 13 ++++++++++++- .../QuickTransferAdvancedSettings/Mix.tsx | 13 ++++++++++++- .../QuickTransferAdvancedSettings/TouchTip.tsx | 2 +- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/app/src/organisms/QuickTransferFlow/QuickTransferAdvancedSettings/BlowOut.tsx b/app/src/organisms/QuickTransferFlow/QuickTransferAdvancedSettings/BlowOut.tsx index a2d536459c0..abab3a9ae34 100644 --- a/app/src/organisms/QuickTransferFlow/QuickTransferAdvancedSettings/BlowOut.tsx +++ b/app/src/organisms/QuickTransferFlow/QuickTransferAdvancedSettings/BlowOut.tsx @@ -61,13 +61,13 @@ export const useBlowOutLocationOptions = ( }> = [] if (transferType !== 'distribute') { blowOutLocationItems.push({ - location: 'source_well', + location: 'dest_well', description: t('blow_out_source_well'), }) } if (transferType !== 'consolidate') { blowOutLocationItems.push({ - location: 'dest_well', + location: 'source_well', description: t('blow_out_destination_well'), }) } diff --git a/app/src/organisms/QuickTransferFlow/QuickTransferAdvancedSettings/Delay.tsx b/app/src/organisms/QuickTransferFlow/QuickTransferAdvancedSettings/Delay.tsx index 4b8414addbb..e6e8a5c707b 100644 --- a/app/src/organisms/QuickTransferFlow/QuickTransferAdvancedSettings/Delay.tsx +++ b/app/src/organisms/QuickTransferFlow/QuickTransferAdvancedSettings/Delay.tsx @@ -138,9 +138,19 @@ export function Delay(props: DelayProps): JSX.Element { }) : null + // allow a maximum of 10 digits for delay duration + const durationRange = { min: 1, max: 9999999999 } + const durationError = + delayDuration != null && + (delayDuration < durationRange.min || delayDuration > durationRange.max) + ? t(`value_out_of_range`, { + min: durationRange.min, + max: durationRange.max, + }) + : null let buttonIsDisabled = false if (currentStep === 2) { - buttonIsDisabled = delayDuration == null + buttonIsDisabled = delayDuration == null || durationError != null } else if (currentStep === 3) { buttonIsDisabled = positionError != null || position == null } @@ -199,6 +209,7 @@ export function Delay(props: DelayProps): JSX.Element { diff --git a/app/src/organisms/QuickTransferFlow/QuickTransferAdvancedSettings/Mix.tsx b/app/src/organisms/QuickTransferFlow/QuickTransferAdvancedSettings/Mix.tsx index 46727cb1228..91c75103d6e 100644 --- a/app/src/organisms/QuickTransferFlow/QuickTransferAdvancedSettings/Mix.tsx +++ b/app/src/organisms/QuickTransferFlow/QuickTransferAdvancedSettings/Mix.tsx @@ -118,11 +118,21 @@ export function Mix(props: MixProps): JSX.Element { }) : null + const repititionRange = { min: 1, max: 999 } + const repititionError = + mixReps != null && + (mixReps < repititionRange.min || mixReps > repititionRange.max) + ? t(`value_out_of_range`, { + min: repititionRange.min, + max: repititionRange.max, + }) + : null + let buttonIsDisabled = false if (currentStep === 2) { buttonIsDisabled = mixVolume == null || volumeError != null } else if (currentStep === 3) { - buttonIsDisabled = mixReps == null + buttonIsDisabled = mixReps == null || repititionError != null } return createPortal( @@ -219,6 +229,7 @@ export function Mix(props: MixProps): JSX.Element { diff --git a/app/src/organisms/QuickTransferFlow/QuickTransferAdvancedSettings/TouchTip.tsx b/app/src/organisms/QuickTransferFlow/QuickTransferAdvancedSettings/TouchTip.tsx index 5791ac2813c..180f88311af 100644 --- a/app/src/organisms/QuickTransferFlow/QuickTransferAdvancedSettings/TouchTip.tsx +++ b/app/src/organisms/QuickTransferFlow/QuickTransferAdvancedSettings/TouchTip.tsx @@ -183,7 +183,7 @@ export function TouchTip(props: TouchTipProps): JSX.Element {