Repository navigation
fix: fix validation for split bill - #40868
Conversation
|
What is your ETA for the review here? @Ollyws |
|
Will review now. |
| if ((isMerchantRequired && isMerchantEmpty) || (shouldDisplayFieldError && TransactionUtils.isMerchantMissing(transaction ?? null))) { | ||
| if (isMerchantRequired && (isMerchantEmpty || (shouldDisplayFieldError && TransactionUtils.isMerchantMissing(transaction ?? null)))) { | ||
| setMerchantError(true); | ||
| return; |
There was a problem hiding this comment.
Without the early return the report will submit even with the merchant error:
Screen.Recording.2024-04-24.at.21.27.02.mov
|
|
||
| const isCategoryRequired = canUseViolations && !!policy?.requiresCategory; | ||
| const shouldDisplayMerchantError = | ||
| (isMerchantRequired || (isEditingSplitBill && isScanRequest)) && (shouldDisplayFieldError || formError === 'iou.error.invalidMerchant') && isMerchantEmpty; |
There was a problem hiding this comment.
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.
@Ollyws ok, you're right - removing this from the condition
There was a problem hiding this comment.
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
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 |
robertjchen
left a comment
There was a problem hiding this comment.
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 Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel so the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.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