diff --git a/src/CONST.ts b/src/CONST.ts index f263307d37b88..e89748ddaae62 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1411,7 +1411,7 @@ const CONST = { ACTION: { EDIT: 'edit', CREATE: 'create', - MOVE: 'move', + REQUEST: 'request', CATEGORIZE: 'categorize', SHARE: 'share', }, @@ -1436,7 +1436,6 @@ const CONST = { DELETE: 'delete', APPROVE: 'approve', TRACK: 'track', - MOVE: 'move', }, AMOUNT_MAX_LENGTH: 10, RECEIPT_STATE: { diff --git a/src/libs/IOUUtils.ts b/src/libs/IOUUtils.ts index 6a2051db0ed0a..63930ffd71318 100644 --- a/src/libs/IOUUtils.ts +++ b/src/libs/IOUUtils.ts @@ -9,7 +9,7 @@ import Navigation from './Navigation/Navigation'; import * as TransactionUtils from './TransactionUtils'; function navigateToStartMoneyRequestStep(requestType: IOURequestType, iouType: IOUType, transactionID: string, reportID: string, iouAction?: IOUAction): void { - if (iouAction === CONST.IOU.ACTION.CATEGORIZE || iouAction === CONST.IOU.ACTION.MOVE) { + if (iouAction === CONST.IOU.ACTION.CATEGORIZE || iouAction === CONST.IOU.ACTION.REQUEST) { Navigation.goBack(); return; } @@ -129,7 +129,7 @@ function insertTagIntoTransactionTagsString(transactionTags: string, tag: string } function isMovingTransactionFromTrackExpense(action?: IOUAction) { - if (action === CONST.IOU.ACTION.MOVE || action === CONST.IOU.ACTION.SHARE || action === CONST.IOU.ACTION.CATEGORIZE) { + if (action === CONST.IOU.ACTION.REQUEST || action === CONST.IOU.ACTION.SHARE || action === CONST.IOU.ACTION.CATEGORIZE) { return true; } diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 806832013a4d7..da33b64982b42 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -2489,6 +2489,7 @@ const getConvertTrackedExpenseInformation = ( linkedTrackedExpenseReportAction: OnyxTypes.ReportAction, linkedTrackedExpenseReportID: string, transactionThreadReportID: string, + resolution: IOUAction, ) => { const optimisticData: OnyxUpdate[] = []; const successData: OnyxUpdate[] = []; @@ -2540,7 +2541,7 @@ const getConvertTrackedExpenseInformation = ( value: { [actionableWhisperReportActionID]: { originalMessage: { - resolution: CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.NOTHING, + resolution, }, }, }, @@ -2596,6 +2597,7 @@ function convertTrackedExpenseToRequest( linkedTrackedExpenseReportAction, linkedTrackedExpenseReportID, transactionThreadReportID, + CONST.IOU.ACTION.REQUEST, ); optimisticData?.push(...moveTransactionOptimisticData); @@ -2662,6 +2664,7 @@ function categorizeTrackedExpense( linkedTrackedExpenseReportAction, linkedTrackedExpenseReportID, transactionThreadReportID, + CONST.IOU.ACTION.CATEGORIZE, ); optimisticData?.push(...moveTransactionOptimisticData); @@ -2731,6 +2734,7 @@ function shareTrackedExpense( linkedTrackedExpenseReportAction, linkedTrackedExpenseReportID, transactionThreadReportID, + CONST.IOU.ACTION.SHARE, ); optimisticData?.push(...moveTransactionOptimisticData); @@ -2834,7 +2838,7 @@ function requestMoney( const activeReportID = isMoneyRequestReport ? report?.reportID : chatReport.reportID; switch (action) { - case CONST.IOU.ACTION.MOVE: { + case CONST.IOU.ACTION.REQUEST: { if (!linkedTrackedExpenseReportAction || !actionableWhisperReportActionID || !linkedTrackedExpenseReportID) { return; } diff --git a/src/pages/home/report/ReportActionItem.tsx b/src/pages/home/report/ReportActionItem.tsx index 4b87ca6e7eea7..0740cb40859d3 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -393,7 +393,7 @@ function ReportActionItem({ text: 'actionableMentionTrackExpense.submit', key: `${action.reportActionID}-actionableMentionTrackExpense-submit`, onPress: () => { - ReportUtils.createDraftTransactionAndNavigateToParticipantSelector(transactionID, report.reportID, CONST.IOU.ACTION.MOVE, action.reportActionID); + ReportUtils.createDraftTransactionAndNavigateToParticipantSelector(transactionID, report.reportID, CONST.IOU.ACTION.REQUEST, action.reportActionID); }, isMediumSized: true, }, diff --git a/src/pages/iou/request/MoneyTemporaryForRefactorRequestParticipantsSelector.js b/src/pages/iou/request/MoneyTemporaryForRefactorRequestParticipantsSelector.js index 95cb043122d44..3f25265065550 100644 --- a/src/pages/iou/request/MoneyTemporaryForRefactorRequestParticipantsSelector.js +++ b/src/pages/iou/request/MoneyTemporaryForRefactorRequestParticipantsSelector.js @@ -109,7 +109,7 @@ function MoneyTemporaryForRefactorRequestParticipantsSelector({participants, onF // If we are using this component in the "Submit expense" flow then we pass the includeOwnedWorkspaceChats argument so that the current user // sees the option to submit an expense from their admin on their own Workspace Chat. - iouType === CONST.IOU.TYPE.REQUEST && action !== CONST.IOU.ACTION.MOVE, + iouType === CONST.IOU.TYPE.REQUEST && action !== CONST.IOU.ACTION.REQUEST, (canUseP2PDistanceRequests || iouRequestType !== CONST.IOU.REQUEST_TYPE.DISTANCE) && ![CONST.IOU.ACTION.CATEGORIZE, CONST.IOU.ACTION.SHARE].includes(action), false, @@ -267,7 +267,7 @@ function MoneyTemporaryForRefactorRequestParticipantsSelector({participants, onF (canUseP2PDistanceRequests || iouRequestType !== CONST.IOU.REQUEST_TYPE.DISTANCE) && iouType !== CONST.IOU.TYPE.SEND && iouType !== CONST.IOU.TYPE.TRACK_EXPENSE && - ![CONST.IOU.ACTION.SHARE, CONST.IOU.ACTION.MOVE, CONST.IOU.ACTION.CATEGORIZE].includes(action); + ![CONST.IOU.ACTION.SHARE, CONST.IOU.ACTION.REQUEST, CONST.IOU.ACTION.CATEGORIZE].includes(action); const handleConfirmSelection = useCallback( (keyEvent, option) => { diff --git a/src/pages/iou/request/step/IOURequestStepConfirmation.tsx b/src/pages/iou/request/step/IOURequestStepConfirmation.tsx index 1d84bff8747b7..bfeb8a4911994 100644 --- a/src/pages/iou/request/step/IOURequestStepConfirmation.tsx +++ b/src/pages/iou/request/step/IOURequestStepConfirmation.tsx @@ -77,7 +77,7 @@ function IOURequestStepConfirmation({ const transactionTaxAmount = transaction?.taxAmount; const isSharingTrackExpense = action === CONST.IOU.ACTION.SHARE; const isCategorizingTrackExpense = action === CONST.IOU.ACTION.CATEGORIZE; - const isRequestingFromTrackExpense = action === CONST.IOU.ACTION.MOVE; + const isRequestingFromTrackExpense = action === CONST.IOU.ACTION.REQUEST; const requestType = TransactionUtils.getRequestType(transaction); diff --git a/src/pages/iou/request/step/IOURequestStepParticipants.tsx b/src/pages/iou/request/step/IOURequestStepParticipants.tsx index ff4c715223c10..7ad8ac21b2002 100644 --- a/src/pages/iou/request/step/IOURequestStepParticipants.tsx +++ b/src/pages/iou/request/step/IOURequestStepParticipants.tsx @@ -48,7 +48,7 @@ function IOURequestStepParticipants({ if (action === CONST.IOU.ACTION.CATEGORIZE) { return translate('iou.categorize'); } - if (action === CONST.IOU.ACTION.MOVE) { + if (action === CONST.IOU.ACTION.REQUEST) { return translate('iou.submitExpense'); } if (action === CONST.IOU.ACTION.SHARE) {