From 865cb40b425b6320d0f776ff913d1566c89b6ac8 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 18 May 2023 16:33:38 -0600 Subject: [PATCH 1/8] add avatar substript to reportPreview --- src/pages/home/report/ReportActionsList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionsList.js b/src/pages/home/report/ReportActionsList.js index dad2d29e5c5..a2dff7c72fa 100644 --- a/src/pages/home/report/ReportActionsList.js +++ b/src/pages/home/report/ReportActionsList.js @@ -126,7 +126,7 @@ const ReportActionsList = (props) => { action={reportAction} displayAsGroup={ReportActionsUtils.isConsecutiveActionMadeByPreviousActor(sortedReportActions, index)} shouldDisplayNewMarker={shouldDisplayNewMarker} - shouldShowSubscriptAvatar={ReportUtils.isPolicyExpenseChat(report) && reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.IOU} + shouldShowSubscriptAvatar={ReportUtils.isPolicyExpenseChat(report) && _.contains([CONST.REPORT.ACTIONS.TYPE.IOU, CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW], reportAction.actionName)} isMostRecentIOUReportAction={reportAction.reportActionID === mostRecentIOUReportActionID} hasOutstandingIOU={hasOutstandingIOU} index={index} From 72cca4741c5829b51ac4a141e5940843f10ef61c Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 18 May 2023 16:35:54 -0600 Subject: [PATCH 2/8] rm top margin, use muted color --- src/components/ReportActionItem/ReportPreview.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ReportActionItem/ReportPreview.js b/src/components/ReportActionItem/ReportPreview.js index 814a38dba5b..c948f5d8c71 100644 --- a/src/components/ReportActionItem/ReportPreview.js +++ b/src/components/ReportActionItem/ReportPreview.js @@ -99,7 +99,7 @@ const ReportPreview = (props) => { const managerName = ReportUtils.isPolicyExpenseChat(props.chatReport) ? ReportUtils.getPolicyName(props.chatReport) : ReportUtils.getDisplayNameForParticipant(managerEmail, true); const isCurrentUserManager = managerEmail === lodashGet(props.session, 'email', null); return ( - + {_.map(props.action.message, (index) => ( { > {props.iouReport.hasOutstandingIOU ? ( - {props.translate('iou.payerOwesAmount', {payer: managerName, amount: reportAmount})} + {props.translate('iou.payerOwesAmount', {payer: managerName, amount: reportAmount})} ) : ( {props.translate('iou.payerSettled', {amount: reportAmount})} From 3ff94ec46292aa67f3784d82ca96eca891128145 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 18 May 2023 16:54:00 -0600 Subject: [PATCH 3/8] fix style --- src/components/ReportActionItem/ReportPreview.js | 4 +++- src/pages/home/report/ReportActionsList.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/ReportActionItem/ReportPreview.js b/src/components/ReportActionItem/ReportPreview.js index c948f5d8c71..c0f14fb3a48 100644 --- a/src/components/ReportActionItem/ReportPreview.js +++ b/src/components/ReportActionItem/ReportPreview.js @@ -114,7 +114,9 @@ const ReportPreview = (props) => { > {props.iouReport.hasOutstandingIOU ? ( - {props.translate('iou.payerOwesAmount', {payer: managerName, amount: reportAmount})} + + {props.translate('iou.payerOwesAmount', {payer: managerName, amount: reportAmount})} + ) : ( {props.translate('iou.payerSettled', {amount: reportAmount})} diff --git a/src/pages/home/report/ReportActionsList.js b/src/pages/home/report/ReportActionsList.js index a2dff7c72fa..b2f41903c80 100644 --- a/src/pages/home/report/ReportActionsList.js +++ b/src/pages/home/report/ReportActionsList.js @@ -126,7 +126,9 @@ const ReportActionsList = (props) => { action={reportAction} displayAsGroup={ReportActionsUtils.isConsecutiveActionMadeByPreviousActor(sortedReportActions, index)} shouldDisplayNewMarker={shouldDisplayNewMarker} - shouldShowSubscriptAvatar={ReportUtils.isPolicyExpenseChat(report) && _.contains([CONST.REPORT.ACTIONS.TYPE.IOU, CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW], reportAction.actionName)} + shouldShowSubscriptAvatar={ + ReportUtils.isPolicyExpenseChat(report) && _.contains([CONST.REPORT.ACTIONS.TYPE.IOU, CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW], reportAction.actionName) + } isMostRecentIOUReportAction={reportAction.reportActionID === mostRecentIOUReportActionID} hasOutstandingIOU={hasOutstandingIOU} index={index} From c39dba8d8e746a6bdab445d80655d43e647a30fa Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 18 May 2023 17:05:38 -0600 Subject: [PATCH 4/8] use workspace avatar in expense report actions --- src/pages/home/report/ReportActionsList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionsList.js b/src/pages/home/report/ReportActionsList.js index b2f41903c80..d7d9de1a68e 100644 --- a/src/pages/home/report/ReportActionsList.js +++ b/src/pages/home/report/ReportActionsList.js @@ -127,7 +127,7 @@ const ReportActionsList = (props) => { displayAsGroup={ReportActionsUtils.isConsecutiveActionMadeByPreviousActor(sortedReportActions, index)} shouldDisplayNewMarker={shouldDisplayNewMarker} shouldShowSubscriptAvatar={ - ReportUtils.isPolicyExpenseChat(report) && _.contains([CONST.REPORT.ACTIONS.TYPE.IOU, CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW], reportAction.actionName) + (ReportUtils.isPolicyExpenseChat(report) || ReportUtils.isExpenseReport(report)) && _.contains([CONST.REPORT.ACTIONS.TYPE.IOU, CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW], reportAction.actionName) } isMostRecentIOUReportAction={reportAction.reportActionID === mostRecentIOUReportActionID} hasOutstandingIOU={hasOutstandingIOU} From 60a72913ba22c0dc439667c35e7b0e5f9ad9051c Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 18 May 2023 17:19:09 -0600 Subject: [PATCH 5/8] fix style --- src/pages/home/report/ReportActionsList.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionsList.js b/src/pages/home/report/ReportActionsList.js index d7d9de1a68e..c9eedf8dbff 100644 --- a/src/pages/home/report/ReportActionsList.js +++ b/src/pages/home/report/ReportActionsList.js @@ -127,7 +127,8 @@ const ReportActionsList = (props) => { displayAsGroup={ReportActionsUtils.isConsecutiveActionMadeByPreviousActor(sortedReportActions, index)} shouldDisplayNewMarker={shouldDisplayNewMarker} shouldShowSubscriptAvatar={ - (ReportUtils.isPolicyExpenseChat(report) || ReportUtils.isExpenseReport(report)) && _.contains([CONST.REPORT.ACTIONS.TYPE.IOU, CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW], reportAction.actionName) + (ReportUtils.isPolicyExpenseChat(report) || ReportUtils.isExpenseReport(report)) && + _.contains([CONST.REPORT.ACTIONS.TYPE.IOU, CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW], reportAction.actionName) } isMostRecentIOUReportAction={reportAction.reportActionID === mostRecentIOUReportActionID} hasOutstandingIOU={hasOutstandingIOU} From dd471b338135622c6c5d1d470b632f180e8a24f7 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Fri, 19 May 2023 08:24:31 -0600 Subject: [PATCH 6/8] mute settled message --- src/components/ReportActionItem/ReportPreview.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ReportActionItem/ReportPreview.js b/src/components/ReportActionItem/ReportPreview.js index c0f14fb3a48..81290217255 100644 --- a/src/components/ReportActionItem/ReportPreview.js +++ b/src/components/ReportActionItem/ReportPreview.js @@ -119,7 +119,7 @@ const ReportPreview = (props) => { ) : ( - {props.translate('iou.payerSettled', {amount: reportAmount})} + {props.translate('iou.payerSettled', {amount: reportAmount})} {!props.iouReport.hasOutstandingIOU && ( Date: Fri, 19 May 2023 08:51:27 -0600 Subject: [PATCH 7/8] fix style --- src/components/ReportActionItem/ReportPreview.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/ReportActionItem/ReportPreview.js b/src/components/ReportActionItem/ReportPreview.js index cb54fc0ee11..9758c6ab61d 100644 --- a/src/components/ReportActionItem/ReportPreview.js +++ b/src/components/ReportActionItem/ReportPreview.js @@ -119,7 +119,9 @@ const ReportPreview = (props) => { ) : ( - {lodashGet(message, 'html', props.translate('iou.payerSettled', {amount: reportAmount}))} + + {lodashGet(message, 'html', props.translate('iou.payerSettled', {amount: reportAmount}))} + {!props.iouReport.hasOutstandingIOU && ( Date: Fri, 19 May 2023 10:09:38 -0600 Subject: [PATCH 8/8] update pay message in iou/expense report view --- src/pages/home/report/ReportActionItem.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index e0749f69844..a770bc96157 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -187,13 +187,16 @@ class ReportActionItem extends Component { renderItemContent(hovered = false) { let children; const originalMessage = lodashGet(this.props.action, 'originalMessage', {}); + + // IOUDetails only exists when we are sending money + const isSendingMoney = originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.PAY && _.has(originalMessage, 'IOUDetails'); + // Show the IOUPreview for when request was created, bill was split or money was sent if ( this.props.action.actionName === CONST.REPORT.ACTIONS.TYPE.IOU && originalMessage && - (originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.CREATE || - originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.SPLIT || - (originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.PAY && _.has(originalMessage, 'IOUDetails'))) + // For the pay flow, we only want to show MoneyRequestAction when sending money. When paying, we display a regular system message + (originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.CREATE || originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.SPLIT || isSendingMoney) ) { // There is no single iouReport for bill splits, so only 1:1 requests require an iouReportID const iouReportID = originalMessage.IOUReportID ? originalMessage.IOUReportID.toString() : '0'; @@ -256,7 +259,9 @@ class ReportActionItem extends Component { action={this.props.action} style={[ !this.props.displayAsGroup && isAttachment ? styles.mt2 : undefined, - _.contains(_.values(CONST.REPORT.ACTIONS.TYPE.POLICYCHANGELOG), this.props.action.actionName) ? styles.colorMuted : undefined, + _.contains([..._.values(CONST.REPORT.ACTIONS.TYPE.POLICYCHANGELOG), CONST.REPORT.ACTIONS.TYPE.IOU], this.props.action.actionName) + ? styles.colorMuted + : undefined, ]} /> ) : (