-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix: fix validation for split bill #40868
fix: fix validation for split bill #40868
Conversation
What is your ETA for the review here? @Ollyws |
Will review now. |
setMerchantError(true); | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without the early return the report will submit even with the merchant error:
Screen.Recording.2024-04-24.at.21.27.02.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed!
@@ -322,19 +320,10 @@ function MoneyRequestConfirmationList({ | |||
const isMerchantEmpty = !iouMerchant || iouMerchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT; | |||
const isMerchantRequired = isPolicyExpenseChat && !isScanRequest && shouldShowMerchant; | |||
|
|||
const isCategoryRequired = canUseViolations && !!policy?.requiresCategory; | |||
const shouldDisplayMerchantError = | |||
(isMerchantRequired || (isEditingSplitBill && isScanRequest)) && (shouldDisplayFieldError || formError === 'iou.error.invalidMerchant') && isMerchantEmpty; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little confused about the (isEditingSplitBill && isScanRequest)
condition here, I can't see any instance in which it is true due to isScanRequest
always being false, but if isScanRequest
was true we would be seeing the merchant error in places where the merchant isn't required.
Maybe I'm missing something but could you clarify this for me? Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ollyws ok, you're right - removing this from the condition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks but now we are getting a field required error on a non-workspace split:
Screen.Recording.2024-04-25.at.15.39.13.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ollyws fixed
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid_Native_01.movAndroid_Native_02.movAndroid: mWeb ChromeAndroid_Chrome_01.movAndroid_Chrome_02.moviOS: NativeiOS_Native_01.moviOS_Native_02.moviOS: mWeb SafariiOS_Safari_01.moviOS_Safari_02.movMacOS: Chrome / SafariMacOS_Chrome_01.movMacOS_Chrome_02.movMacOS: DesktopMacOS_Desktop_01.movMacOS_Desktop_02.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/robertjchen in version: 1.4.67-0 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.4.67-7 🚀
|
1 similar comment
🚀 Deployed to production by https://github.com/francoisl in version: 1.4.67-7 🚀
|
Details
Fixed Issues
$ #40756
$ #40749
PROPOSAL:
Tests
Merchant Error
Amount Error
Offline tests
n/a
QA Steps
Merchant Error
Amount Error
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
having problems with building the project on android now
Android: mWeb Chrome
Screen.Recording.2024-04-24.at.13.30.18.mp4
Screen.Recording.2024-04-24.at.13.30.41.mp4
iOS: Native
Screen.Recording.2024-04-24.at.13.36.25.mp4
Screen.Recording.2024-04-24.at.13.36.45.mp4
iOS: mWeb Safari
Screen.Recording.2024-04-24.at.13.39.31.mp4
Screen.Recording.2024-04-24.at.13.40.27.mp4
MacOS: Chrome / Safari
Screen.Recording.2024-04-24.at.13.25.40.mp4
Screen.Recording.2024-04-24.at.13.27.24.mp4
MacOS: Desktop
Screen.Recording.2024-04-24.at.13.34.20.mp4