-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
32 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -267,7 +267,8 @@ function MoneyRequestConfirmationList(props) { | |
return (props.hasSmartScanFailed && TransactionUtils.hasMissingSmartscanFields(transaction)) || (didConfirmSplit && TransactionUtils.areRequiredFieldsEmpty(transaction)); | ||
}, [props.isEditingSplitBill, props.hasSmartScanFailed, transaction, didConfirmSplit]); | ||
|
||
const isIOUMerchantPresent = props.isPolicyExpenseChat && !props.isScanRequest && !props.iouMerchant; | ||
const isMerchantEmpty = !props.iouMerchant || props.iouMerchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT || props.iouMerchant === CONST.TRANSACTION.DEFAULT_MERCHANT; | ||
const shouldDisplayMerchantError = props.isPolicyExpenseChat && !props.isScanRequest && isMerchantEmpty; | ||
|
||
useEffect(() => { | ||
if (shouldDisplayFieldError && props.hasSmartScanFailed) { | ||
|
@@ -498,7 +499,7 @@ function MoneyRequestConfirmationList(props) { | |
} | ||
|
||
const shouldShowSettlementButton = props.iouType === CONST.IOU.TYPE.SEND; | ||
const shouldDisableButton = selectedParticipants.length === 0 || isIOUMerchantPresent; | ||
const shouldDisableButton = selectedParticipants.length === 0 || shouldDisplayMerchantError; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mountiny
Contributor
|
||
|
||
const button = shouldShowSettlementButton ? ( | ||
<SettlementButton | ||
|
@@ -549,7 +550,7 @@ function MoneyRequestConfirmationList(props) { | |
props.iouCurrencyCode, | ||
props.policyID, | ||
selectedParticipants.length, | ||
isIOUMerchantPresent, | ||
shouldDisplayMerchantError, | ||
confirm, | ||
splitOrRequestOptions, | ||
formError, | ||
|
@@ -679,7 +680,7 @@ function MoneyRequestConfirmationList(props) { | |
{shouldShowMerchant && ( | ||
<MenuItemWithTopDescription | ||
shouldShowRightIcon={!props.isReadOnly} | ||
title={props.iouMerchant} | ||
title={isMerchantEmpty ? '' : props.iouMerchant} | ||
description={translate('common.merchant')} | ||
style={[styles.moneyRequestMenuItem]} | ||
titleStyle={styles.flex1} | ||
|
@@ -693,7 +694,7 @@ function MoneyRequestConfirmationList(props) { | |
disabled={didConfirm} | ||
interactive={!props.isReadOnly} | ||
brickRoadIndicator={shouldDisplayFieldError && TransactionUtils.isMerchantMissing(transaction) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : ''} | ||
error={isIOUMerchantPresent || (shouldDisplayFieldError && TransactionUtils.isMerchantMissing(transaction)) ? translate('common.error.enterMerchant') : ''} | ||
error={shouldDisplayMerchantError || (shouldDisplayFieldError && TransactionUtils.isMerchantMissing(transaction)) ? translate('common.error.enterMerchant') : ''} | ||
/> | ||
)} | ||
{shouldShowCategories && ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@waterim @mountiny coming from the issue #38130, just wanted to confirm why we added shouldDisplayMerchantError before accepting any proposal,
why we added the
shouldDisplayMerchantError
to theshouldDisableButton
?shouldDisableButton
value determine the form button should the disable or not, IMO we should not be disable or block user from press the button in this case.