From 8b96c31cab5e55704c243e642ebadcb907868e31 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Tue, 3 Dec 2024 11:07:22 +0700 Subject: [PATCH 1/5] prevent going back to participant page when categorizing --- src/pages/iou/request/step/IOURequestStepConfirmation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/iou/request/step/IOURequestStepConfirmation.tsx b/src/pages/iou/request/step/IOURequestStepConfirmation.tsx index cb5b4d626715..f61545e28662 100644 --- a/src/pages/iou/request/step/IOURequestStepConfirmation.tsx +++ b/src/pages/iou/request/step/IOURequestStepConfirmation.tsx @@ -176,7 +176,7 @@ function IOURequestStepConfirmation({ const navigateBack = useCallback(() => { // If the action is categorize and there's no policies other than personal one, we simply call goBack(), i.e: dismiss the whole flow together // We don't need to subscribe to policy_ collection as we only need to check on the latest collection value - if (action === CONST.IOU.ACTION.CATEGORIZE && PolicyUtils.hasNoPolicyOtherThanPersonalType()) { + if (action === CONST.IOU.ACTION.CATEGORIZE) { Navigation.goBack(); return; } From e7746a51bd644e8c51812b06a1c2c6ce191ac324 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Tue, 3 Dec 2024 11:40:41 +0700 Subject: [PATCH 2/5] fix sucess message is not center-aligned --- src/pages/workspace/upgrade/UpgradeConfirmation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/upgrade/UpgradeConfirmation.tsx b/src/pages/workspace/upgrade/UpgradeConfirmation.tsx index c983f27a4813..1e8609531972 100644 --- a/src/pages/workspace/upgrade/UpgradeConfirmation.tsx +++ b/src/pages/workspace/upgrade/UpgradeConfirmation.tsx @@ -22,7 +22,7 @@ function UpgradeConfirmation({policyName, onConfirmUpgrade, isCategorizing}: Pro heading={translate('workspace.upgrade.completed.headline')} description={ isCategorizing ? ( - {translate('workspace.upgrade.completed.categorizeMessage')} + translate('workspace.upgrade.completed.categorizeMessage') ) : ( <> {translate('workspace.upgrade.completed.successMessage', {policyName})}{' '} From e22c3769e77bc01c6f73189381fdf32bfa0becd9 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Tue, 3 Dec 2024 11:43:30 +0700 Subject: [PATCH 3/5] fix lint --- src/pages/iou/request/step/IOURequestStepConfirmation.tsx | 1 - src/pages/workspace/upgrade/UpgradeConfirmation.tsx | 1 - 2 files changed, 2 deletions(-) diff --git a/src/pages/iou/request/step/IOURequestStepConfirmation.tsx b/src/pages/iou/request/step/IOURequestStepConfirmation.tsx index f61545e28662..223ebb6079de 100644 --- a/src/pages/iou/request/step/IOURequestStepConfirmation.tsx +++ b/src/pages/iou/request/step/IOURequestStepConfirmation.tsx @@ -23,7 +23,6 @@ import * as IOUUtils from '@libs/IOUUtils'; import Log from '@libs/Log'; import Navigation from '@libs/Navigation/Navigation'; import * as OptionsListUtils from '@libs/OptionsListUtils'; -import * as PolicyUtils from '@libs/PolicyUtils'; import * as ReportUtils from '@libs/ReportUtils'; import playSound, {SOUNDS} from '@libs/Sound'; import * as TransactionUtils from '@libs/TransactionUtils'; diff --git a/src/pages/workspace/upgrade/UpgradeConfirmation.tsx b/src/pages/workspace/upgrade/UpgradeConfirmation.tsx index 1e8609531972..9824b2919d65 100644 --- a/src/pages/workspace/upgrade/UpgradeConfirmation.tsx +++ b/src/pages/workspace/upgrade/UpgradeConfirmation.tsx @@ -1,6 +1,5 @@ import React from 'react'; import ConfirmationPage from '@components/ConfirmationPage'; -import Text from '@components/Text'; import TextLink from '@components/TextLink'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; From c7deacc41ec81d2428fb4f8d714335208aafb5f3 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Mon, 9 Dec 2024 16:53:58 +0700 Subject: [PATCH 4/5] go back to category page the first time --- src/pages/iou/request/step/IOURequestStepCategory.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/iou/request/step/IOURequestStepCategory.tsx b/src/pages/iou/request/step/IOURequestStepCategory.tsx index 6f81d6ea3443..1e6421744847 100644 --- a/src/pages/iou/request/step/IOURequestStepCategory.tsx +++ b/src/pages/iou/request/step/IOURequestStepCategory.tsx @@ -127,8 +127,8 @@ function IOURequestStepCategory({ IOU.setMoneyRequestCategory(transactionID, updatedCategory); - if (action === CONST.IOU.ACTION.CATEGORIZE) { - Navigation.closeAndNavigate(ROUTES.MONEY_REQUEST_STEP_CONFIRMATION.getRoute(action, iouType, transactionID, report?.reportID ?? '-1')); + if (action === CONST.IOU.ACTION.CATEGORIZE && !backTo) { + Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_CONFIRMATION.getRoute(action, iouType, transactionID, report?.reportID ?? '-1')); return; } From 1f9d80d765ba56b40214279926e0263a130d10ce Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Tue, 10 Dec 2024 00:41:36 +0700 Subject: [PATCH 5/5] implement navigation flow --- src/components/MoneyRequestConfirmationListFooter.tsx | 7 ++++++- src/pages/iou/request/step/IOURequestStepCategory.tsx | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/MoneyRequestConfirmationListFooter.tsx b/src/components/MoneyRequestConfirmationListFooter.tsx index 01756e11aadf..340be8a6c3e1 100644 --- a/src/components/MoneyRequestConfirmationListFooter.tsx +++ b/src/components/MoneyRequestConfirmationListFooter.tsx @@ -429,7 +429,12 @@ function MoneyRequestConfirmationListFooter({ title={iouCategory} description={translate('common.category')} numberOfLinesTitle={2} - onPress={() => Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_CATEGORY.getRoute(action, iouType, transactionID, reportID, Navigation.getActiveRoute(), reportActionID))} + onPress={() => + Navigation.navigate( + ROUTES.MONEY_REQUEST_STEP_CATEGORY.getRoute(action, iouType, transactionID, reportID, Navigation.getActiveRoute(), reportActionID), + CONST.NAVIGATION.ACTION_TYPE.PUSH, + ) + } style={[styles.moneyRequestMenuItem]} titleStyle={styles.flex1} disabled={didConfirm} diff --git a/src/pages/iou/request/step/IOURequestStepCategory.tsx b/src/pages/iou/request/step/IOURequestStepCategory.tsx index 1e6421744847..1365a555d197 100644 --- a/src/pages/iou/request/step/IOURequestStepCategory.tsx +++ b/src/pages/iou/request/step/IOURequestStepCategory.tsx @@ -127,7 +127,7 @@ function IOURequestStepCategory({ IOU.setMoneyRequestCategory(transactionID, updatedCategory); - if (action === CONST.IOU.ACTION.CATEGORIZE && !backTo) { + if (action === CONST.IOU.ACTION.CATEGORIZE) { Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_CONFIRMATION.getRoute(action, iouType, transactionID, report?.reportID ?? '-1')); return; }