From 75656213396603f69e7d93ddc569cedb4ac71181 Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Mon, 5 Feb 2024 20:29:51 +0530 Subject: [PATCH 1/9] Remove MoneyRequestParticipantsPage.js and copy any changes since Nov 27 into IOURequestStepParticipants.js. Signed-off-by: Krishna Gupta --- .../AppNavigator/ModalStackNavigators.tsx | 1 - src/libs/Navigation/linkingConfig/config.ts | 1 - src/libs/Navigation/types.ts | 4 - .../MoneyRequestParticipantsPage.js | 174 ------------------ 4 files changed, 180 deletions(-) delete mode 100644 src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsPage.js diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx index 4606f867c3fc..a19ffb184cf1 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx @@ -95,7 +95,6 @@ const MoneyRequestModalStackNavigator = createModalStackNavigator require('../../../pages/iou/request/step/IOURequestStepWaypoint').default as React.ComponentType, [SCREENS.MONEY_REQUEST.ROOT]: () => require('../../../pages/iou/MoneyRequestSelectorPage').default as React.ComponentType, [SCREENS.MONEY_REQUEST.AMOUNT]: () => require('../../../pages/iou/steps/NewRequestAmountPage').default as React.ComponentType, - [SCREENS.MONEY_REQUEST.PARTICIPANTS]: () => require('../../../pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsPage').default as React.ComponentType, [SCREENS.MONEY_REQUEST.CONFIRMATION]: () => require('../../../pages/iou/steps/MoneyRequestConfirmPage').default as React.ComponentType, [SCREENS.MONEY_REQUEST.CURRENCY]: () => require('../../../pages/iou/IOUCurrencySelection').default as React.ComponentType, [SCREENS.MONEY_REQUEST.DATE]: () => require('../../../pages/iou/MoneyRequestDatePage').default as React.ComponentType, diff --git a/src/libs/Navigation/linkingConfig/config.ts b/src/libs/Navigation/linkingConfig/config.ts index f1c9c316fe93..2bae3ec1f73f 100644 --- a/src/libs/Navigation/linkingConfig/config.ts +++ b/src/libs/Navigation/linkingConfig/config.ts @@ -400,7 +400,6 @@ const config: LinkingOptions['config'] = { [SCREENS.MONEY_REQUEST.AMOUNT]: ROUTES.MONEY_REQUEST_AMOUNT.route, [SCREENS.MONEY_REQUEST.STEP_TAX_AMOUNT]: ROUTES.MONEY_REQUEST_STEP_TAX_AMOUNT.route, [SCREENS.MONEY_REQUEST.STEP_TAX_RATE]: ROUTES.MONEY_REQUEST_STEP_TAX_RATE.route, - [SCREENS.MONEY_REQUEST.PARTICIPANTS]: ROUTES.MONEY_REQUEST_PARTICIPANTS.route, [SCREENS.MONEY_REQUEST.CONFIRMATION]: ROUTES.MONEY_REQUEST_CONFIRMATION.route, [SCREENS.MONEY_REQUEST.DATE]: ROUTES.MONEY_REQUEST_DATE.route, [SCREENS.MONEY_REQUEST.CURRENCY]: ROUTES.MONEY_REQUEST_CURRENCY.route, diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 3c4cf17853f1..c1b31cc3a864 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -195,10 +195,6 @@ type RoomInviteNavigatorParamList = { type MoneyRequestNavigatorParamList = { [SCREENS.MONEY_REQUEST.ROOT]: undefined; [SCREENS.MONEY_REQUEST.AMOUNT]: undefined; - [SCREENS.MONEY_REQUEST.PARTICIPANTS]: { - iouType: string; - reportID: string; - }; [SCREENS.MONEY_REQUEST.CONFIRMATION]: { iouType: string; reportID: string; diff --git a/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsPage.js b/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsPage.js deleted file mode 100644 index 216154be9cd4..000000000000 --- a/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsPage.js +++ /dev/null @@ -1,174 +0,0 @@ -import _ from 'lodash'; -import lodashGet from 'lodash/get'; -import lodashSize from 'lodash/size'; -import PropTypes from 'prop-types'; -import React, {useCallback, useEffect, useMemo, useRef} from 'react'; -import {View} from 'react-native'; -import {withOnyx} from 'react-native-onyx'; -import HeaderWithBackButton from '@components/HeaderWithBackButton'; -import ScreenWrapper from '@components/ScreenWrapper'; -import transactionPropTypes from '@components/transactionPropTypes'; -import useInitialValue from '@hooks/useInitialValue'; -import useLocalize from '@hooks/useLocalize'; -import useThemeStyles from '@hooks/useThemeStyles'; -import compose from '@libs/compose'; -import * as DeviceCapabilities from '@libs/DeviceCapabilities'; -import * as MoneyRequestUtils from '@libs/MoneyRequestUtils'; -import Navigation from '@libs/Navigation/Navigation'; -import * as TransactionUtils from '@libs/TransactionUtils'; -import {iouDefaultProps, iouPropTypes} from '@pages/iou/propTypes'; -import * as IOU from '@userActions/IOU'; -import CONST from '@src/CONST'; -import ONYXKEYS from '@src/ONYXKEYS'; -import ROUTES from '@src/ROUTES'; -import MoneyRequestParticipantsSelector from './MoneyRequestParticipantsSelector'; - -const propTypes = { - /** React Navigation route */ - route: PropTypes.shape({ - /** Params from the route */ - params: PropTypes.shape({ - /** The type of IOU report, i.e. bill, request, send */ - iouType: PropTypes.string, - - /** The report ID of the IOU */ - reportID: PropTypes.string, - }), - }).isRequired, - - /** Holds data related to Money Request view state, rather than the underlying Money Request data. */ - iou: iouPropTypes, - - /** The current tab we have navigated to in the request modal. String that corresponds to the request type. */ - selectedTab: PropTypes.oneOf(_.values(CONST.TAB_REQUEST)), - - /** Transaction that stores the distance request data */ - transaction: transactionPropTypes, -}; - -const defaultProps = { - iou: iouDefaultProps, - transaction: {}, - selectedTab: undefined, -}; - -function MoneyRequestParticipantsPage({iou, selectedTab, route, transaction}) { - const styles = useThemeStyles(); - const {translate} = useLocalize(); - const prevMoneyRequestId = useRef(iou.id); - const iouType = useInitialValue(() => lodashGet(route, 'params.iouType', '')); - const reportID = useInitialValue(() => lodashGet(route, 'params.reportID', '')); - const isDistanceRequest = MoneyRequestUtils.isDistanceRequest(iouType, selectedTab); - const isSendRequest = iouType === CONST.IOU.TYPE.SEND; - const isScanRequest = MoneyRequestUtils.isScanRequest(selectedTab); - const isSplitRequest = iou.id === CONST.IOU.TYPE.SPLIT; - const waypoints = lodashGet(transaction, 'comment.waypoints', {}); - const validatedWaypoints = TransactionUtils.getValidWaypoints(waypoints); - const isInvalidWaypoint = lodashSize(validatedWaypoints) < 2; - const headerTitle = useMemo(() => { - if (isDistanceRequest) { - return translate('common.distance'); - } - - if (isSendRequest) { - return translate('common.send'); - } - - if (isScanRequest) { - return translate('tabSelector.scan'); - } - - if (iou.isSplitRequest) { - return translate('iou.split'); - } - - return translate('tabSelector.manual'); - }, [iou, isDistanceRequest, translate, isScanRequest, isSendRequest]); - - const navigateToConfirmationStep = (moneyRequestType) => { - IOU.setMoneyRequestId(moneyRequestType); - IOU.resetMoneyRequestCategory(); - IOU.resetMoneyRequestTag(); - Navigation.navigate(ROUTES.MONEY_REQUEST_CONFIRMATION.getRoute(moneyRequestType, reportID)); - }; - - const navigateBack = useCallback((forceFallback = false) => { - Navigation.goBack(ROUTES.MONEY_REQUEST.getRoute(iouType, reportID), forceFallback); - // eslint-disable-next-line react-hooks/exhaustive-deps -- no deps as we use only initial values - }, []); - - useEffect(() => { - const isInvalidDistanceRequest = !isDistanceRequest || isInvalidWaypoint; - - // ID in Onyx could change by initiating a new request in a separate browser tab or completing a request - if (prevMoneyRequestId.current !== iou.id) { - // The ID is cleared on completing a request. In that case, we will do nothing - if (iou.id && isInvalidDistanceRequest && !isSplitRequest) { - navigateBack(true); - } - return; - } - - // Reset the money request Onyx if the ID in Onyx does not match the ID from params - const moneyRequestId = `${iouType}${reportID}`; - const shouldReset = iou.id !== moneyRequestId && !_.isEmpty(reportID); - if (shouldReset) { - IOU.resetMoneyRequestInfo(moneyRequestId); - } - if (isInvalidDistanceRequest && ((iou.amount === 0 && !iou.receiptPath) || shouldReset)) { - navigateBack(true); - } - - return () => { - prevMoneyRequestId.current = iou.id; - }; - }, [iou.amount, iou.id, iou.receiptPath, isDistanceRequest, isSplitRequest, iouType, reportID, navigateBack, isInvalidWaypoint]); - - return ( - - {({safeAreaPaddingBottomStyle}) => ( - - - navigateToConfirmationStep(iouType)} - navigateToSplit={() => navigateToConfirmationStep(CONST.IOU.TYPE.SPLIT)} - safeAreaPaddingBottomStyle={safeAreaPaddingBottomStyle} - iouType={iouType} - isDistanceRequest={isDistanceRequest} - isScanRequest={isScanRequest} - /> - - )} - - ); -} - -MoneyRequestParticipantsPage.displayName = 'MoneyRequestParticipantsPage'; -MoneyRequestParticipantsPage.propTypes = propTypes; -MoneyRequestParticipantsPage.defaultProps = defaultProps; - -export default compose( - withOnyx({ - iou: { - key: ONYXKEYS.IOU, - }, - selectedTab: { - key: `${ONYXKEYS.COLLECTION.SELECTED_TAB}${CONST.TAB.RECEIPT_TAB_ID}`, - }, - }), - // eslint-disable-next-line rulesdir/no-multiple-onyx-in-file - withOnyx({ - transaction: { - key: ({iou}) => `${ONYXKEYS.COLLECTION.TRANSACTION}${lodashGet(iou, 'transactionID', 0)}`, - }, - }), -)(MoneyRequestParticipantsPage); From db861f619867edcfad892e05d4c48507223097d1 Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Tue, 6 Feb 2024 12:08:45 +0530 Subject: [PATCH 2/9] remove MoneyRequestParticipantsPage.js. Signed-off-by: Krishna Gupta --- .../MoneyRequestParticipantsPage.js | 173 ------------------ 1 file changed, 173 deletions(-) delete mode 100644 src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsPage.js diff --git a/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsPage.js b/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsPage.js deleted file mode 100644 index ea57d88579ae..000000000000 --- a/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsPage.js +++ /dev/null @@ -1,173 +0,0 @@ -import _ from 'lodash'; -import lodashGet from 'lodash/get'; -import lodashSize from 'lodash/size'; -import PropTypes from 'prop-types'; -import React, {useCallback, useEffect, useMemo, useRef} from 'react'; -import {View} from 'react-native'; -import {withOnyx} from 'react-native-onyx'; -import HeaderWithBackButton from '@components/HeaderWithBackButton'; -import ScreenWrapper from '@components/ScreenWrapper'; -import transactionPropTypes from '@components/transactionPropTypes'; -import useInitialValue from '@hooks/useInitialValue'; -import useLocalize from '@hooks/useLocalize'; -import useThemeStyles from '@hooks/useThemeStyles'; -import compose from '@libs/compose'; -import * as DeviceCapabilities from '@libs/DeviceCapabilities'; -import * as MoneyRequestUtils from '@libs/MoneyRequestUtils'; -import Navigation from '@libs/Navigation/Navigation'; -import * as TransactionUtils from '@libs/TransactionUtils'; -import {iouDefaultProps, iouPropTypes} from '@pages/iou/propTypes'; -import * as IOU from '@userActions/IOU'; -import CONST from '@src/CONST'; -import ONYXKEYS from '@src/ONYXKEYS'; -import ROUTES from '@src/ROUTES'; -import MoneyRequestParticipantsSelector from './MoneyRequestParticipantsSelector'; - -const propTypes = { - /** React Navigation route */ - route: PropTypes.shape({ - /** Params from the route */ - params: PropTypes.shape({ - /** The type of IOU report, i.e. bill, request, send */ - iouType: PropTypes.string, - - /** The report ID of the IOU */ - reportID: PropTypes.string, - }), - }).isRequired, - - /** Holds data related to Money Request view state, rather than the underlying Money Request data. */ - iou: iouPropTypes, - - /** The current tab we have navigated to in the request modal. String that corresponds to the request type. */ - selectedTab: PropTypes.oneOf(_.values(CONST.TAB_REQUEST)), - - /** Transaction that stores the distance request data */ - transaction: transactionPropTypes, -}; - -const defaultProps = { - iou: iouDefaultProps, - transaction: {}, - selectedTab: undefined, -}; - -function MoneyRequestParticipantsPage({iou, selectedTab, route, transaction}) { - const styles = useThemeStyles(); - const {translate} = useLocalize(); - const prevMoneyRequestId = useRef(iou.id); - const iouType = useInitialValue(() => lodashGet(route, 'params.iouType', '')); - const reportID = useInitialValue(() => lodashGet(route, 'params.reportID', '')); - const isDistanceRequest = MoneyRequestUtils.isDistanceRequest(iouType, selectedTab); - const isSendRequest = iouType === CONST.IOU.TYPE.SEND; - const isScanRequest = MoneyRequestUtils.isScanRequest(selectedTab); - const isSplitRequest = iou.id === CONST.IOU.TYPE.SPLIT; - const waypoints = lodashGet(transaction, 'comment.waypoints', {}); - const validatedWaypoints = TransactionUtils.getValidWaypoints(waypoints); - const isInvalidWaypoint = lodashSize(validatedWaypoints) < 2; - const headerTitle = useMemo(() => { - if (isDistanceRequest) { - return translate('common.distance'); - } - - if (isSendRequest) { - return translate('common.send'); - } - - if (isScanRequest) { - return translate('tabSelector.scan'); - } - - if (iou.isSplitRequest) { - return translate('iou.split'); - } - - return translate('tabSelector.manual'); - }, [iou, isDistanceRequest, translate, isScanRequest, isSendRequest]); - - const navigateToConfirmationStep = (moneyRequestType) => { - IOU.setMoneyRequestId(moneyRequestType); - IOU.resetMoneyRequestCategory(); - Navigation.navigate(ROUTES.MONEY_REQUEST_CONFIRMATION.getRoute(moneyRequestType, reportID)); - }; - - const navigateBack = useCallback((forceFallback = false) => { - Navigation.goBack(ROUTES.MONEY_REQUEST.getRoute(iouType, reportID), forceFallback); - // eslint-disable-next-line react-hooks/exhaustive-deps -- no deps as we use only initial values - }, []); - - useEffect(() => { - const isInvalidDistanceRequest = !isDistanceRequest || isInvalidWaypoint; - - // ID in Onyx could change by initiating a new request in a separate browser tab or completing a request - if (prevMoneyRequestId.current !== iou.id) { - // The ID is cleared on completing a request. In that case, we will do nothing - if (iou.id && isInvalidDistanceRequest && !isSplitRequest) { - navigateBack(true); - } - return; - } - - // Reset the money request Onyx if the ID in Onyx does not match the ID from params - const moneyRequestId = `${iouType}${reportID}`; - const shouldReset = iou.id !== moneyRequestId && !_.isEmpty(reportID); - if (shouldReset) { - IOU.resetMoneyRequestInfo(moneyRequestId); - } - if (isInvalidDistanceRequest && ((iou.amount === 0 && !iou.receiptPath) || shouldReset)) { - navigateBack(true); - } - - return () => { - prevMoneyRequestId.current = iou.id; - }; - }, [iou.amount, iou.id, iou.receiptPath, isDistanceRequest, isSplitRequest, iouType, reportID, navigateBack, isInvalidWaypoint]); - - return ( - - {({safeAreaPaddingBottomStyle}) => ( - - - navigateToConfirmationStep(iouType)} - navigateToSplit={() => navigateToConfirmationStep(CONST.IOU.TYPE.SPLIT)} - safeAreaPaddingBottomStyle={safeAreaPaddingBottomStyle} - iouType={iouType} - isDistanceRequest={isDistanceRequest} - isScanRequest={isScanRequest} - /> - - )} - - ); -} - -MoneyRequestParticipantsPage.displayName = 'MoneyRequestParticipantsPage'; -MoneyRequestParticipantsPage.propTypes = propTypes; -MoneyRequestParticipantsPage.defaultProps = defaultProps; - -export default compose( - withOnyx({ - iou: { - key: ONYXKEYS.IOU, - }, - selectedTab: { - key: `${ONYXKEYS.COLLECTION.SELECTED_TAB}${CONST.TAB.RECEIPT_TAB_ID}`, - }, - }), - // eslint-disable-next-line rulesdir/no-multiple-onyx-in-file - withOnyx({ - transaction: { - key: ({iou}) => `${ONYXKEYS.COLLECTION.TRANSACTION}${lodashGet(iou, 'transactionID', 0)}`, - }, - }), -)(MoneyRequestParticipantsPage); From c112ca3c34c240a9f1afe4f69467f20610e2d6a3 Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Wed, 27 Mar 2024 20:51:59 +0530 Subject: [PATCH 3/9] remove MoneyRequestParticipantsPage.js. Signed-off-by: Krishna Gupta --- .../MoneyRequstParticipantsPage/MoneyRequestParticipantsPage.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsPage.js diff --git a/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsPage.js b/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsPage.js deleted file mode 100644 index e69de29bb2d1..000000000000 From 33196ae4a73f078f9f3074f3b08a7b256081f049 Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Wed, 27 Mar 2024 21:32:06 +0530 Subject: [PATCH 4/9] minor import update. Signed-off-by: Krishna Gupta --- src/pages/iou/request/step/IOURequestStepParticipants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/iou/request/step/IOURequestStepParticipants.js b/src/pages/iou/request/step/IOURequestStepParticipants.js index 5ca465d8fb78..5b65a281a2f5 100644 --- a/src/pages/iou/request/step/IOURequestStepParticipants.js +++ b/src/pages/iou/request/step/IOURequestStepParticipants.js @@ -1,7 +1,7 @@ import {useNavigation} from '@react-navigation/native'; +import _ from 'lodash'; import lodashGet from 'lodash/get'; import React, {useCallback, useEffect, useMemo, useRef} from 'react'; -import _ from 'underscore'; import transactionPropTypes from '@components/transactionPropTypes'; import useLocalize from '@hooks/useLocalize'; import compose from '@libs/compose'; From da62d52007a7adf7ccf7cfe232a272eee955484b Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Mon, 1 Apr 2024 09:04:06 +0530 Subject: [PATCH 5/9] remove ModalStackNavigators file. Signed-off-by: Krishna Gupta --- src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx deleted file mode 100644 index e69de29bb2d1..000000000000 From 6d606568df619d19c149aca65ead7cfa6fe53fc3 Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Mon, 1 Apr 2024 09:05:52 +0530 Subject: [PATCH 6/9] remove all instances of SCREENS.MONEY_REQUEST.PARTICIPANTS. Signed-off-by: Krishna Gupta --- .../Navigation/AppNavigator/ModalStackNavigators/index.tsx | 1 - src/libs/Navigation/types.ts | 4 ---- 2 files changed, 5 deletions(-) diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx index 6583097ac9b8..01ae75903ff2 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx @@ -87,7 +87,6 @@ const MoneyRequestModalStackNavigator = createModalStackNavigator require('../../../../pages/iou/request/step/IOURequestStepTag').default as React.ComponentType, [SCREENS.MONEY_REQUEST.STEP_WAYPOINT]: () => require('../../../../pages/iou/request/step/IOURequestStepWaypoint').default as React.ComponentType, [SCREENS.MONEY_REQUEST.AMOUNT]: () => require('../../../../pages/iou/steps/NewRequestAmountPage').default as React.ComponentType, - [SCREENS.MONEY_REQUEST.PARTICIPANTS]: () => require('../../../../pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsPage').default as React.ComponentType, [SCREENS.MONEY_REQUEST.CONFIRMATION]: () => require('../../../../pages/iou/steps/MoneyRequestConfirmPage').default as React.ComponentType, [SCREENS.MONEY_REQUEST.CURRENCY]: () => require('../../../../pages/iou/IOUCurrencySelection').default as React.ComponentType, [SCREENS.MONEY_REQUEST.HOLD]: () => require('../../../../pages/iou/HoldReasonPage').default as React.ComponentType, diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 69686790ac78..84917cfdeb17 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -341,10 +341,6 @@ type MoneyRequestNavigatorParamList = { reportID: string; currency: string; }; - [SCREENS.MONEY_REQUEST.PARTICIPANTS]: { - iouType: string; - reportID: string; - }; [SCREENS.MONEY_REQUEST.CONFIRMATION]: { iouType: string; reportID: string; From ab1542f6d37f1668f12c3076ca8793198c634b05 Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Mon, 1 Apr 2024 09:20:59 +0530 Subject: [PATCH 7/9] remove redundant code. Signed-off-by: Krishna Gupta --- src/ROUTES.ts | 4 ---- src/SCREENS.ts | 1 - src/libs/actions/IOU.ts | 4 ++-- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/ROUTES.ts b/src/ROUTES.ts index 7b28a2672ba6..b19325cd9ca5 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -281,10 +281,6 @@ const ROUTES = { route: ':iouType/new/amount/:reportID?', getRoute: (iouType: string, reportID = '') => `${iouType}/new/amount/${reportID}` as const, }, - MONEY_REQUEST_PARTICIPANTS: { - route: ':iouType/new/participants/:reportID?', - getRoute: (iouType: string, reportID = '') => `${iouType}/new/participants/${reportID}` as const, - }, MONEY_REQUEST_CONFIRMATION: { route: ':iouType/new/confirmation/:reportID?', getRoute: (iouType: string, reportID = '') => `${iouType}/new/confirmation/${reportID}` as const, diff --git a/src/SCREENS.ts b/src/SCREENS.ts index f5891b042e49..5a56f8496587 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -150,7 +150,6 @@ const SCREENS = { STEP_TAX_AMOUNT: 'Money_Request_Step_Tax_Amount', STEP_TAX_RATE: 'Money_Request_Step_Tax_Rate', AMOUNT: 'Money_Request_Amount', - PARTICIPANTS: 'Money_Request_Participants', CONFIRMATION: 'Money_Request_Confirmation', CURRENCY: 'Money_Request_Currency', WAYPOINT: 'Money_Request_Waypoint', diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 8582e9e3f3de..e6d27d6570ff 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -5080,9 +5080,9 @@ function navigateToNextPage(iou: OnyxEntry, iouType: string, repo setMoneyRequestParticipants(participants); } Navigation.navigate(ROUTES.MONEY_REQUEST_CONFIRMATION.getRoute(iouType, report.reportID)); - return; + // return; } - Navigation.navigate(ROUTES.MONEY_REQUEST_PARTICIPANTS.getRoute(iouType)); + // Navigation.navigate(ROUTES.MONEY_REQUEST_PARTICIPANTS.getRoute(iouType)); } /** From c8ca8645593763137ded3a5068f72b76a174b040 Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Thu, 4 Apr 2024 12:26:45 +0530 Subject: [PATCH 8/9] add type for SCREENS.MONEY_REQUEST.STEP_PARTICIPANTS. Signed-off-by: Krishna Gupta --- src/libs/Navigation/types.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index a83c0831797a..96e169ae0924 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -343,6 +343,12 @@ type MoneyRequestNavigatorParamList = { reportID: string; backTo: string; }; + [SCREENS.MONEY_REQUEST.STEP_PARTICIPANTS]: { + iouType: string; + transactionID: string; + reportID: string; + backTo: string; + }; [SCREENS.MONEY_REQUEST.STEP_CONFIRMATION]: { action: ValueOf; iouType: string; From 2836636881d5eb984537b14abdf46da6643139ea Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Thu, 11 Apr 2024 17:04:12 +0530 Subject: [PATCH 9/9] fix: types for SCREENS.MONEY_REQUEST.STEP_PARTICIPANTS. Signed-off-by: Krishna Gupta --- src/libs/Navigation/types.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index bb0800ffcdc6..40326db78502 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -357,7 +357,7 @@ type MoneyRequestNavigatorParamList = { backTo: string; }; [SCREENS.MONEY_REQUEST.STEP_PARTICIPANTS]: { - iouType: string; + iouType: ValueOf; transactionID: string; reportID: string; backTo: string; @@ -443,11 +443,6 @@ type MoneyRequestNavigatorParamList = { iouType: string; reportID: string; }; - [SCREENS.MONEY_REQUEST.STEP_PARTICIPANTS]: { - iouType: ValueOf; - transactionID: string; - reportID: string; - }; [SCREENS.MONEY_REQUEST.STEP_CONFIRMATION]: { action: ValueOf; iouType: ValueOf;