Skip to content

Commit

Permalink
Merge pull request #35348 from Expensify/revert-34947-fix/34615
Browse files Browse the repository at this point in the history
[CP Staging] Revert "Remove MoneyRequestConfirmPage"
  • Loading branch information
NikkiWines authored Jan 30, 2024
2 parents 480ae8d + 94b8046 commit 4bef3da
Show file tree
Hide file tree
Showing 7 changed files with 496 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ const ROUTES = {
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,
},
MONEY_REQUEST_DATE: {
route: ':iouType/new/date/:reportID?',
getRoute: (iouType: string, reportID = '') => `${iouType}/new/date/${reportID}` as const,
Expand Down
1 change: 1 addition & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ const SCREENS = {
ROOT: 'Money_Request',
AMOUNT: 'Money_Request_Amount',
PARTICIPANTS: 'Money_Request_Participants',
CONFIRMATION: 'Money_Request_Confirmation',
CURRENCY: 'Money_Request_Currency',
DATE: 'Money_Request_Date',
DESCRIPTION: 'Money_Request_Description',
Expand Down
1 change: 1 addition & 0 deletions src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const MoneyRequestModalStackNavigator = createModalStackNavigator<MoneyRequestNa
[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,
[SCREENS.MONEY_REQUEST.DESCRIPTION]: () => require('../../../pages/iou/MoneyRequestDescriptionPage').default as React.ComponentType,
Expand Down
1 change: 1 addition & 0 deletions src/libs/Navigation/linkingConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ const linkingConfig: LinkingOptions<RootStackParamList> = {
[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,
[SCREENS.MONEY_REQUEST.DESCRIPTION]: ROUTES.MONEY_REQUEST_DESCRIPTION.route,
Expand Down
4 changes: 4 additions & 0 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ type MoneyRequestNavigatorParamList = {
iouType: string;
reportID: string;
};
[SCREENS.MONEY_REQUEST.CONFIRMATION]: {
iouType: string;
reportID: string;
};
[SCREENS.MONEY_REQUEST.CURRENCY]: {
iouType: string;
reportID: string;
Expand Down
14 changes: 12 additions & 2 deletions src/pages/iou/request/step/IOURequestStepConfirmation.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import categoryPropTypes from '@components/categoryPropTypes';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import * as Expensicons from '@components/Icon/Expensicons';
import MoneyRequestConfirmationList from '@components/MoneyTemporaryForRefactorRequestConfirmationList';
import {usePersonalDetails} from '@components/OnyxProvider';
import ScreenWrapper from '@components/ScreenWrapper';
import tagPropTypes from '@components/tagPropTypes';
import transactionPropTypes from '@components/transactionPropTypes';
Expand All @@ -24,6 +23,7 @@ import Navigation from '@libs/Navigation/Navigation';
import * as OptionsListUtils from '@libs/OptionsListUtils';
import * as ReportUtils from '@libs/ReportUtils';
import * as TransactionUtils from '@libs/TransactionUtils';
import personalDetailsPropType from '@pages/personalDetailsPropType';
import reportPropTypes from '@pages/reportPropTypes';
import {policyPropTypes} from '@pages/workspace/withPolicy';
import * as IOU from '@userActions/IOU';
Expand All @@ -43,6 +43,9 @@ const propTypes = {
/** The personal details of the current user */
...withCurrentUserPersonalDetailsPropTypes,

/** Personal details of all users */
personalDetails: personalDetailsPropType,

/** The policy of the report */
...policyPropTypes,

Expand All @@ -59,6 +62,7 @@ const propTypes = {
transaction: transactionPropTypes,
};
const defaultProps = {
personalDetails: {},
policy: {},
policyCategories: {},
policyTags: {},
Expand All @@ -68,6 +72,7 @@ const defaultProps = {
};
function IOURequestStepConfirmation({
currentUserPersonalDetails,
personalDetails,
policy,
policyTags,
policyCategories,
Expand All @@ -81,7 +86,6 @@ function IOURequestStepConfirmation({
const {translate} = useLocalize();
const {windowWidth} = useWindowDimensions();
const {isOffline} = useNetwork();
const personalDetails = usePersonalDetails() || CONST.EMPTY_OBJECT;
const [receiptFile, setReceiptFile] = useState();
const receiptFilename = lodashGet(transaction, 'filename');
const receiptPath = lodashGet(transaction, 'receipt.source');
Expand Down Expand Up @@ -381,6 +385,12 @@ export default compose(
withCurrentUserPersonalDetails,
withWritableReportOrNotFound,
withFullTransactionOrNotFound,
withOnyx({
personalDetails: {
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
},
}),
// eslint-disable-next-line rulesdir/no-multiple-onyx-in-file
withOnyx({
policy: {
key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY}${report ? report.policyID : '0'}`,
Expand Down
Loading

0 comments on commit 4bef3da

Please sign in to comment.