From f13e1e532cec6d906a165a5927b60e3bdf63917a Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Fri, 31 May 2024 11:36:25 +0700 Subject: [PATCH 1/2] Display send money action as paid system message in combine report --- src/libs/ReportActionsUtils.ts | 6 +++--- src/pages/home/report/ReportActionItem.tsx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 1b2b03e7e2c4..ccd38fec19ce 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -320,13 +320,13 @@ function getCombinedReportActions(reportActions: ReportAction[], transactionThre const report = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]; const isSelfDM = report?.chatType === CONST.REPORT.CHAT_TYPE.SELF_DM; - // Filter out request and send money request actions because we don't want to show any preview actions for one transaction reports + // Filter out request actions because we don't want to show any preview actions for one transaction reports const filteredReportActions = [...reportActions, ...filteredTransactionThreadReportActions].filter((action) => { const actionType = (action as OriginalMessageIOU).originalMessage?.type ?? ''; if (isSelfDM) { - return actionType !== CONST.IOU.REPORT_ACTION_TYPE.CREATE && !isSentMoneyReportAction(action); + return actionType !== CONST.IOU.REPORT_ACTION_TYPE.CREATE; } - return actionType !== CONST.IOU.REPORT_ACTION_TYPE.CREATE && actionType !== CONST.IOU.REPORT_ACTION_TYPE.TRACK && !isSentMoneyReportAction(action); + return actionType !== CONST.IOU.REPORT_ACTION_TYPE.CREATE && actionType !== CONST.IOU.REPORT_ACTION_TYPE.TRACK; }); return getSortedReportActions(filteredReportActions, true); diff --git a/src/pages/home/report/ReportActionItem.tsx b/src/pages/home/report/ReportActionItem.tsx index 4b248bf14131..58db81a22f1e 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -512,11 +512,11 @@ function ReportActionItem({ if ( isIOUReport(action) && action.originalMessage && - // For the pay flow, we only want to show MoneyRequestAction when sending money. When paying, we display a regular system message + // For the pay flow, we only want to show MoneyRequestAction when sending money and we're not in the combine report. Otherwise, we display a regular system message (action.originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.CREATE || action.originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.SPLIT || action.originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.TRACK || - isSendingMoney) + (isSendingMoney && !transactionThreadReport?.reportID)) ) { // There is no single iouReport for bill splits, so only 1:1 requests require an iouReportID const iouReportID = action.originalMessage.IOUReportID ? action.originalMessage.IOUReportID.toString() : '0'; From e73fb372346be1cdc6ae7cf352eb2dd92328e8cc Mon Sep 17 00:00:00 2001 From: nkdengineer <161821005+nkdengineer@users.noreply.github.com> Date: Tue, 4 Jun 2024 12:27:05 +0700 Subject: [PATCH 2/2] Update src/libs/ReportActionsUtils.ts Co-authored-by: ahmedGaber93 <41129870+ahmedGaber93@users.noreply.github.com> --- src/libs/ReportActionsUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index ccd38fec19ce..e84ab61d69cc 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -320,7 +320,7 @@ function getCombinedReportActions(reportActions: ReportAction[], transactionThre const report = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]; const isSelfDM = report?.chatType === CONST.REPORT.CHAT_TYPE.SELF_DM; - // Filter out request actions because we don't want to show any preview actions for one transaction reports + // Filter out request money actions because we don't want to show any preview actions for one transaction reports const filteredReportActions = [...reportActions, ...filteredTransactionThreadReportActions].filter((action) => { const actionType = (action as OriginalMessageIOU).originalMessage?.type ?? ''; if (isSelfDM) {