From 0a0f59208d333a4831cf1267cc3b81dc958f3bf2 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Wed, 29 Nov 2023 15:45:29 +0700 Subject: [PATCH 1/7] Allow split bill for hidden user --- src/pages/iou/steps/MoneyRequestConfirmPage.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/iou/steps/MoneyRequestConfirmPage.js b/src/pages/iou/steps/MoneyRequestConfirmPage.js index a69abeb94089..61d5459ea664 100644 --- a/src/pages/iou/steps/MoneyRequestConfirmPage.js +++ b/src/pages/iou/steps/MoneyRequestConfirmPage.js @@ -77,7 +77,6 @@ function MoneyRequestConfirmPage(props) { const isPolicyExpenseChat = lodashGet(participant, 'isPolicyExpenseChat', false); return isPolicyExpenseChat ? OptionsListUtils.getPolicyExpenseReportOption(participant) : OptionsListUtils.getParticipantsOption(participant, props.personalDetails); }) - .filter((participant) => !!participant.login || !!participant.text) .value(), [props.iou.participants, props.personalDetails], ); From cd5fa9c0c65fa25e4fb100346e535bfbb2933bdc Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Wed, 29 Nov 2023 20:40:30 +0700 Subject: [PATCH 2/7] remove un-use function --- src/pages/iou/steps/MoneyRequestConfirmPage.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/pages/iou/steps/MoneyRequestConfirmPage.js b/src/pages/iou/steps/MoneyRequestConfirmPage.js index 61d5459ea664..d4ab907d1fa5 100644 --- a/src/pages/iou/steps/MoneyRequestConfirmPage.js +++ b/src/pages/iou/steps/MoneyRequestConfirmPage.js @@ -72,12 +72,10 @@ function MoneyRequestConfirmPage(props) { const [receiptFile, setReceiptFile] = useState(); const participants = useMemo( () => - _.chain(props.iou.participants) - .map((participant) => { - const isPolicyExpenseChat = lodashGet(participant, 'isPolicyExpenseChat', false); - return isPolicyExpenseChat ? OptionsListUtils.getPolicyExpenseReportOption(participant) : OptionsListUtils.getParticipantsOption(participant, props.personalDetails); - }) - .value(), + _.map(props.iou.participants, (participant) => { + const isPolicyExpenseChat = lodashGet(participant, 'isPolicyExpenseChat', false); + return isPolicyExpenseChat ? OptionsListUtils.getPolicyExpenseReportOption(participant) : OptionsListUtils.getParticipantsOption(participant, props.personalDetails); + }), [props.iou.participants, props.personalDetails], ); const isPolicyExpenseChat = useMemo(() => ReportUtils.isPolicyExpenseChat(ReportUtils.getRootParentReport(props.report)), [props.report]); From f109a3c30c7d57e8a1df23f8a52e6af669c23d82 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Wed, 29 Nov 2023 22:34:52 +0700 Subject: [PATCH 3/7] update hidden for native --- src/libs/OptionsListUtils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index c616587c3983..1a7913da13ca 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -1453,6 +1453,7 @@ function getIOUConfirmationOptionsFromPayeePersonalDetail(personalDetail, amount function getIOUConfirmationOptionsFromParticipants(participants, amountText) { return _.map(participants, (participant) => ({ ...participant, + text: participant.text || Localize.translateLocal('common.hidden'), descriptiveText: amountText, })); } From 2aafb7ae2019e750b3927fd460ad6c0d933144fd Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Thu, 30 Nov 2023 18:48:46 +0700 Subject: [PATCH 4/7] add hidden for display name native component --- src/components/DisplayNames/index.native.tsx | 4 +++- src/libs/OptionsListUtils.js | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/DisplayNames/index.native.tsx b/src/components/DisplayNames/index.native.tsx index 8d1d3d2866ed..8f1fef37a6ba 100644 --- a/src/components/DisplayNames/index.native.tsx +++ b/src/components/DisplayNames/index.native.tsx @@ -1,16 +1,18 @@ import React from 'react'; import Text from '@components/Text'; +import useLocalize from '@hooks/useLocalize'; import DisplayNamesProps from './types'; // As we don't have to show tooltips of the Native platform so we simply render the full display names list. function DisplayNames({accessibilityLabel, fullTitle, textStyles = [], numberOfLines = 1}: DisplayNamesProps) { + const {translate} = useLocalize(); return ( - {fullTitle} + {fullTitle || translate('common.hidden')} ); } diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 1a7913da13ca..c616587c3983 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -1453,7 +1453,6 @@ function getIOUConfirmationOptionsFromPayeePersonalDetail(personalDetail, amount function getIOUConfirmationOptionsFromParticipants(participants, amountText) { return _.map(participants, (participant) => ({ ...participant, - text: participant.text || Localize.translateLocal('common.hidden'), descriptiveText: amountText, })); } From bab320ba37efd6ea2fd514496c410ebaa2ab3353 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Thu, 30 Nov 2023 19:24:04 +0700 Subject: [PATCH 5/7] add title for display name web component --- src/components/DisplayNames/index.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/DisplayNames/index.tsx b/src/components/DisplayNames/index.tsx index f5714fcbfb8b..2715111d1149 100644 --- a/src/components/DisplayNames/index.tsx +++ b/src/components/DisplayNames/index.tsx @@ -1,15 +1,19 @@ import React from 'react'; +import useLocalize from '@hooks/useLocalize'; import DisplayNamesWithoutTooltip from './DisplayNamesWithoutTooltip'; import DisplayNamesWithToolTip from './DisplayNamesWithTooltip'; import DisplayNamesProps from './types'; function DisplayNames({fullTitle, tooltipEnabled, textStyles, numberOfLines, shouldUseFullTitle, displayNamesWithTooltips}: DisplayNamesProps) { + const {translate} = useLocalize(); + const title = fullTitle || translate('common.hidden'); + if (!tooltipEnabled) { return ( ); } @@ -17,7 +21,7 @@ function DisplayNames({fullTitle, tooltipEnabled, textStyles, numberOfLines, sho return ( Date: Thu, 30 Nov 2023 19:29:33 +0700 Subject: [PATCH 6/7] fix lint --- src/components/DisplayNames/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DisplayNames/index.tsx b/src/components/DisplayNames/index.tsx index 2715111d1149..7ff1081937d5 100644 --- a/src/components/DisplayNames/index.tsx +++ b/src/components/DisplayNames/index.tsx @@ -7,7 +7,7 @@ import DisplayNamesProps from './types'; function DisplayNames({fullTitle, tooltipEnabled, textStyles, numberOfLines, shouldUseFullTitle, displayNamesWithTooltips}: DisplayNamesProps) { const {translate} = useLocalize(); const title = fullTitle || translate('common.hidden'); - + if (!tooltipEnabled) { return ( Date: Fri, 1 Dec 2023 01:11:47 +0700 Subject: [PATCH 7/7] fix lint --- src/pages/iou/steps/MoneyRequestConfirmPage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/iou/steps/MoneyRequestConfirmPage.js b/src/pages/iou/steps/MoneyRequestConfirmPage.js index 891f8cf70881..29257d9201fa 100644 --- a/src/pages/iou/steps/MoneyRequestConfirmPage.js +++ b/src/pages/iou/steps/MoneyRequestConfirmPage.js @@ -72,9 +72,9 @@ function MoneyRequestConfirmPage(props) { () => _.map(props.iou.participants, (participant) => { const isPolicyExpenseChat = lodashGet(participant, 'isPolicyExpenseChat', false); - return isPolicyExpenseChat ? OptionsListUtils.getPolicyExpenseReportOption(participant) : OptionsListUtils.getParticipantsOption(participant, props.personalDetails); + return isPolicyExpenseChat ? OptionsListUtils.getPolicyExpenseReportOption(participant) : OptionsListUtils.getParticipantsOption(participant, personalDetails); }), - [props.iou.participants, props.personalDetails], + [props.iou.participants, personalDetails], ); const isPolicyExpenseChat = useMemo(() => ReportUtils.isPolicyExpenseChat(ReportUtils.getRootParentReport(props.report)), [props.report]); const isManualRequestDM = props.selectedTab === CONST.TAB.MANUAL && iouType === CONST.IOU.TYPE.REQUEST;