Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Update merchant to be empty and with validation #32486

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
142c1fa
merchant update
waterim Dec 4, 2023
58f34d4
fix
waterim Dec 6, 2023
7fcc36e
fix lint
waterim Dec 6, 2023
3a81ea4
remove require for smart scan
waterim Dec 7, 2023
c583248
update ('none') display
waterim Dec 12, 2023
f696242
lint fix
waterim Dec 12, 2023
619f929
updates
waterim Dec 14, 2023
9238cb7
Merge remote-tracking branch 'upstream/main' into feat-32222-Make-Mer…
waterim Dec 14, 2023
d0d04ba
Merge remote-tracking branch 'upstream/main' into feat-32222-Make-Mer…
waterim Dec 15, 2023
6670e7b
Merge remote-tracking branch 'upstream/main' into feat-32222-Make-Mer…
waterim Dec 18, 2023
525fc01
updated new stepper
waterim Dec 18, 2023
3464def
Merge remote-tracking branch 'upstream/main' into feat-32222-Make-Mer…
waterim Dec 18, 2023
3ba6f55
Merge remote-tracking branch 'upstream/main' into feat-32222-Make-Mer…
waterim Dec 20, 2023
638b48d
Merge remote-tracking branch 'upstream/main' into feat-32222-Make-Mer…
waterim Dec 21, 2023
b04dc7e
change default merchant value in tests
waterim Dec 21, 2023
7df8393
updated errors
waterim Dec 22, 2023
3c58a05
fix: resolve conflicts
koko57 Dec 27, 2023
3905c89
fix: minor fix
koko57 Dec 27, 2023
add1bde
Merge branch 'main' into feat-32222-Make-Merchant-field-required-for-…
koko57 Dec 28, 2023
9860e01
fix: validate merchant field on submit
koko57 Dec 28, 2023
c62fa9d
Merge branch 'main' into feat-32222-Make-Merchant-field-required-for-…
koko57 Dec 29, 2023
513b612
fix: do not show merchant on scan request
koko57 Dec 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/components/MoneyRequestConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +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.iouMerchant;

useEffect(() => {
if (shouldDisplayFieldError && props.hasSmartScanFailed) {
setFormError('iou.receiptScanningFailed');
Expand Down Expand Up @@ -496,7 +498,7 @@ function MoneyRequestConfirmationList(props) {
}

const shouldShowSettlementButton = props.iouType === CONST.IOU.TYPE.SEND;
const shouldDisableButton = selectedParticipants.length === 0;
const shouldDisableButton = selectedParticipants.length === 0 || isIOUMerchantPresent;

const button = shouldShowSettlementButton ? (
<SettlementButton
Expand Down Expand Up @@ -547,6 +549,7 @@ function MoneyRequestConfirmationList(props) {
props.iouCurrencyCode,
props.policyID,
selectedParticipants.length,
isIOUMerchantPresent,
confirm,
splitOrRequestOptions,
formError,
Expand Down Expand Up @@ -690,7 +693,7 @@ function MoneyRequestConfirmationList(props) {
disabled={didConfirm}
interactive={!props.isReadOnly}
brickRoadIndicator={shouldDisplayFieldError && TransactionUtils.isMerchantMissing(transaction) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : ''}
error={shouldDisplayFieldError && TransactionUtils.isMerchantMissing(transaction) ? translate('common.error.enterMerchant') : ''}
error={isIOUMerchantPresent || (shouldDisplayFieldError && TransactionUtils.isMerchantMissing(transaction)) ? translate('common.error.enterMerchant') : ''}
/>
)}
{shouldShowCategories && (
Expand Down
2 changes: 1 addition & 1 deletion src/libs/actions/IOU.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function resetMoneyRequestInfo(id = '') {
currency: lodashGet(currentUserPersonalDetails, 'localCurrencyCode', CONST.CURRENCY.USD),
comment: '',
participants: [],
merchant: CONST.TRANSACTION.DEFAULT_MERCHANT,
merchant: '',
waterim marked this conversation as resolved.
Show resolved Hide resolved
category: '',
tag: '',
created,
Expand Down
Loading