diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index fcea05473007..1ebadef1e6f0 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -808,6 +808,39 @@ function getMemberChangeMessageFragment(reportAction: OnyxEntry): }; } +function isOldDotReportAction(action: ReportAction): boolean { + return [ + CONST.REPORT.ACTIONS.TYPE.CHANGEFIELD, + CONST.REPORT.ACTIONS.TYPE.CHANGEPOLICY, + CONST.REPORT.ACTIONS.TYPE.CHANGETYPE, + CONST.REPORT.ACTIONS.TYPE.DELEGATESUBMIT, + CONST.REPORT.ACTIONS.TYPE.DELETEDACCOUNT, + CONST.REPORT.ACTIONS.TYPE.DONATION, + CONST.REPORT.ACTIONS.TYPE.EXPORTEDTOCSV, + CONST.REPORT.ACTIONS.TYPE.EXPORTEDTOINTEGRATION, + CONST.REPORT.ACTIONS.TYPE.EXPORTEDTOQUICKBOOKS, + CONST.REPORT.ACTIONS.TYPE.FORWARDED, + CONST.REPORT.ACTIONS.TYPE.INTEGRATIONSMESSAGE, + CONST.REPORT.ACTIONS.TYPE.MANAGERATTACHRECEIPT, + CONST.REPORT.ACTIONS.TYPE.MANAGERDETACHRECEIPT, + CONST.REPORT.ACTIONS.TYPE.MARKEDREIMBURSED, + CONST.REPORT.ACTIONS.TYPE.MARKREIMBURSEDFROMINTEGRATION, + CONST.REPORT.ACTIONS.TYPE.OUTDATEDBANKACCOUNT, + CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTACHBOUNCE, + CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTACHCANCELLED, + CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTACCOUNTCHANGED, + CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTDELAYED, + CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTREQUESTED, + CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTSETUP, + CONST.REPORT.ACTIONS.TYPE.SELECTEDFORRANDOMAUDIT, + CONST.REPORT.ACTIONS.TYPE.SHARE, + CONST.REPORT.ACTIONS.TYPE.STRIPEPAID, + CONST.REPORT.ACTIONS.TYPE.TAKECONTROL, + CONST.REPORT.ACTIONS.TYPE.UNAPPROVED, + CONST.REPORT.ACTIONS.TYPE.UNSHARE, + ].some((oldDotActionName) => oldDotActionName === action.actionName); +} + /** * Helper method to format message of OldDot Actions. * For now, we just concat all of the text elements of the message to create the full message. @@ -977,6 +1010,7 @@ export { getFirstVisibleReportActionID, isMemberChangeAction, getMemberChangeMessageFragment, + isOldDotReportAction, getMessageOfOldDotReportAction, getMemberChangeMessagePlainText, isReimbursementDeQueuedAction, diff --git a/src/pages/home/report/ReportActionItem.tsx b/src/pages/home/report/ReportActionItem.tsx index d0a9a2a5f40e..519e7ffed88f 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -517,38 +517,7 @@ function ReportActionItem({ children = ; } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE) { children = ; - } else if ( - [ - CONST.REPORT.ACTIONS.TYPE.CHANGEFIELD, - CONST.REPORT.ACTIONS.TYPE.CHANGEPOLICY, - CONST.REPORT.ACTIONS.TYPE.CHANGETYPE, - CONST.REPORT.ACTIONS.TYPE.DELEGATESUBMIT, - CONST.REPORT.ACTIONS.TYPE.DELETEDACCOUNT, - CONST.REPORT.ACTIONS.TYPE.DONATION, - CONST.REPORT.ACTIONS.TYPE.EXPORTEDTOCSV, - CONST.REPORT.ACTIONS.TYPE.EXPORTEDTOINTEGRATION, - CONST.REPORT.ACTIONS.TYPE.EXPORTEDTOQUICKBOOKS, - CONST.REPORT.ACTIONS.TYPE.FORWARDED, - CONST.REPORT.ACTIONS.TYPE.INTEGRATIONSMESSAGE, - CONST.REPORT.ACTIONS.TYPE.MANAGERATTACHRECEIPT, - CONST.REPORT.ACTIONS.TYPE.MANAGERDETACHRECEIPT, - CONST.REPORT.ACTIONS.TYPE.MARKEDREIMBURSED, - CONST.REPORT.ACTIONS.TYPE.MARKREIMBURSEDFROMINTEGRATION, - CONST.REPORT.ACTIONS.TYPE.OUTDATEDBANKACCOUNT, - CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTACHBOUNCE, - CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTACHCANCELLED, - CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTACCOUNTCHANGED, - CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTDELAYED, - CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTREQUESTED, - CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTSETUP, - CONST.REPORT.ACTIONS.TYPE.SELECTEDFORRANDOMAUDIT, - CONST.REPORT.ACTIONS.TYPE.SHARE, - CONST.REPORT.ACTIONS.TYPE.STRIPEPAID, - CONST.REPORT.ACTIONS.TYPE.TAKECONTROL, - CONST.REPORT.ACTIONS.TYPE.UNAPPROVED, - CONST.REPORT.ACTIONS.TYPE.UNSHARE, - ].find((oldDotActionName) => oldDotActionName === action.actionName) - ) { + } else if (ReportActionsUtils.isOldDotReportAction(action)) { // This handles all historical actions from OldDot that we just want to display the message text children = ; } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.HOLD) {