From 62e087b9eca0d8608f01b3a0cecb1aea8d06ff4d Mon Sep 17 00:00:00 2001 From: VH Date: Wed, 25 Oct 2023 05:54:20 +0700 Subject: [PATCH 01/10] Always show confirmation button --- .../MoneyRequestParticipantsSelector.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js b/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js index 7e88ebe7db48..bc6e5f02ff5e 100755 --- a/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js +++ b/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js @@ -248,7 +248,6 @@ function MoneyRequestParticipantsSelector({ // This is getting properly fixed in https://github.com/Expensify/App/issues/27508, but as a stop-gap to prevent // the app from crashing on native when you try to do this, we'll going to hide the button if you have a workspace and other participants const hasPolicyExpenseChatParticipant = _.some(participants, (participant) => participant.isPolicyExpenseChat); - const shouldShowConfirmButton = !(participants.length > 1 && hasPolicyExpenseChatParticipant); const isAllowedToSplit = !isDistanceRequest && iouType !== CONST.IOU.TYPE.SEND; return ( @@ -266,7 +265,6 @@ function MoneyRequestParticipantsSelector({ ref={forwardedRef} headerMessage={headerMessage} boldStyle - shouldShowConfirmButton={shouldShowConfirmButton && isAllowedToSplit} confirmButtonText={translate('iou.addToSplit')} onConfirmSelection={navigateToSplit} textInputLabel={translate('optionsSelector.nameEmailOrPhoneNumber')} @@ -274,6 +272,7 @@ function MoneyRequestParticipantsSelector({ shouldShowOptions={isOptionsDataReady} shouldPreventDefaultFocusOnSelectRow={!Browser.isMobile()} shouldDelayFocus + footerContent /> ); From 40b36e0a15029bab343047d0c5e0a0752ead876e Mon Sep 17 00:00:00 2001 From: VH Date: Wed, 25 Oct 2023 06:23:18 +0700 Subject: [PATCH 02/10] Display warning message when split bill with multiple participants including a workspace --- .../MoneyRequestParticipantsSelector.js | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js b/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js index bc6e5f02ff5e..62548fb2854c 100755 --- a/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js +++ b/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js @@ -16,6 +16,8 @@ import CONST from '../../../../CONST'; import personalDetailsPropType from '../../../personalDetailsPropType'; import reportPropTypes from '../../../reportPropTypes'; import refPropTypes from '../../../../components/refPropTypes'; +import Button from '../../../../components/Button'; +import FormHelpMessage from '../../../../components/FormHelpMessage'; const propTypes = { /** Beta features list */ @@ -248,8 +250,27 @@ function MoneyRequestParticipantsSelector({ // This is getting properly fixed in https://github.com/Expensify/App/issues/27508, but as a stop-gap to prevent // the app from crashing on native when you try to do this, we'll going to hide the button if you have a workspace and other participants const hasPolicyExpenseChatParticipant = _.some(participants, (participant) => participant.isPolicyExpenseChat); + const shouldShowErrorMessage = participants.length > 1 && hasPolicyExpenseChatParticipant; const isAllowedToSplit = !isDistanceRequest && iouType !== CONST.IOU.TYPE.SEND; + const footerContent = + {shouldShowErrorMessage && ( + + )} +