From 3afa0ceb1aa9fec9e038543c3943caf03a3abb2f Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Tue, 21 Nov 2023 13:02:41 +0700 Subject: [PATCH 1/3] show merchant for split bill --- src/components/ReportActionItem/MoneyRequestPreview.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/ReportActionItem/MoneyRequestPreview.js b/src/components/ReportActionItem/MoneyRequestPreview.js index 07aba132be0e..16489d6b6b87 100644 --- a/src/components/ReportActionItem/MoneyRequestPreview.js +++ b/src/components/ReportActionItem/MoneyRequestPreview.js @@ -170,8 +170,7 @@ function MoneyRequestPreview(props) { const isDeleted = lodashGet(props.action, 'pendingAction', null) === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE; // Show the merchant for IOUs and expenses only if they are custom or not related to scanning smartscan - const shouldShowMerchant = - !_.isEmpty(requestMerchant) && !props.isBillSplit && requestMerchant !== CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT && requestMerchant !== CONST.TRANSACTION.DEFAULT_MERCHANT; + const shouldShowMerchant = !_.isEmpty(requestMerchant) && requestMerchant !== CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT && requestMerchant !== CONST.TRANSACTION.DEFAULT_MERCHANT; const shouldShowDescription = !_.isEmpty(description) && !shouldShowMerchant && !isScanning; const receiptImages = hasReceipt ? [ReceiptUtils.getThumbnailAndImageURIs(props.transaction)] : []; @@ -322,7 +321,7 @@ function MoneyRequestPreview(props) { )} - {shouldShowMerchant && ( + {shouldShowMerchant && !props.isBillSplit && ( {hasPendingWaypoints ? requestMerchant.replace(CONST.REGEX.FIRST_SPACE, props.translate('common.tbd')) : requestMerchant} @@ -334,7 +333,7 @@ function MoneyRequestPreview(props) { {!isCurrentUserManager && props.shouldShowPendingConversionMessage && ( {props.translate('iou.pendingConversionMessage')} )} - {shouldShowDescription && {description}} + {shouldShowDescription || (shouldShowMerchant && props.isBillSplit && {requestMerchant || description})} {props.isBillSplit && !_.isEmpty(participantAccountIDs) && requestAmount > 0 && ( From f5db4be3e79b78414bba4cd179f4ba05e930ddf8 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Wed, 22 Nov 2023 16:56:57 +0700 Subject: [PATCH 2/3] update to show description --- src/components/ReportActionItem/MoneyRequestPreview.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ReportActionItem/MoneyRequestPreview.js b/src/components/ReportActionItem/MoneyRequestPreview.js index 16489d6b6b87..991978f7c421 100644 --- a/src/components/ReportActionItem/MoneyRequestPreview.js +++ b/src/components/ReportActionItem/MoneyRequestPreview.js @@ -333,7 +333,7 @@ function MoneyRequestPreview(props) { {!isCurrentUserManager && props.shouldShowPendingConversionMessage && ( {props.translate('iou.pendingConversionMessage')} )} - {shouldShowDescription || (shouldShowMerchant && props.isBillSplit && {requestMerchant || description})} + {(shouldShowDescription || (shouldShowMerchant && props.isBillSplit)) && {shouldShowDescription ? description : requestMerchant}} {props.isBillSplit && !_.isEmpty(participantAccountIDs) && requestAmount > 0 && ( From 290e06175a7af9152f7ed8c9d8cacb0c84b5f02b Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Tue, 28 Nov 2023 17:20:12 +0700 Subject: [PATCH 3/3] fix lint --- src/components/ReportActionItem/MoneyRequestPreview.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/ReportActionItem/MoneyRequestPreview.js b/src/components/ReportActionItem/MoneyRequestPreview.js index 03d34654cd1b..652fb5a84e76 100644 --- a/src/components/ReportActionItem/MoneyRequestPreview.js +++ b/src/components/ReportActionItem/MoneyRequestPreview.js @@ -333,7 +333,9 @@ function MoneyRequestPreview(props) { {!isCurrentUserManager && props.shouldShowPendingConversionMessage && ( {props.translate('iou.pendingConversionMessage')} )} - {(shouldShowDescription || (shouldShowMerchant && props.isBillSplit)) && {shouldShowDescription ? description : requestMerchant}} + {(shouldShowDescription || (shouldShowMerchant && props.isBillSplit)) && ( + {shouldShowDescription ? description : requestMerchant} + )} {props.isBillSplit && !_.isEmpty(participantAccountIDs) && requestAmount > 0 && (