-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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: prevent requesting for amounts larger than the allowed maximum #28266
Conversation
Reviewer Checklist
Screenshots/VideosWebchrome-desktop-2023-09-28_18.29.39.mp4Mobile Web - Chromeandroid-chrome.mp4iOSios-native-2023-09-28_17.36.44.mp4Androidandroid-native.mp4 |
@akinwale When a distance request doesn't have a route, App/src/components/MoneyRequestConfirmationList.js Lines 215 to 216 in bf4db42
|
How should we handle this? The issue here is that the eventual calculated amount for the route may end up being higher than the limit. Do we want the user to be able to proceed anyway? |
@akinwale I actually have no idea how/when the route gets calculated for this flow 😄 Unless there's somewhere we could reapply the validation, I'd say we just let it pass through as the amount is unknown. |
Done. I also reduced the horizontal padding for the displayed error so that it's more in line with the edge of the button. |
@akinwale Great, thanks! Could you post an updated screenshot for mobile so we can get some design eyes on it? |
@jjcoffee Here's an updated screenshot showing the new position of the error message. |
Nice, that looks better. |
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.
Sorry, just had a quick retest and noticed that actually now any amount throws an error, in the manual request flow too. @akinwale
Oh, of course, makes sense since |
@akinwale The same was occurring for distance requests though. |
Looking into it. |
Ok, I see the problem. |
@jjcoffee Pushed a new commit. Tested ok now, both with large (> max) and small amounts for distance requests. Also added another condition to prevent double-validating manual requests. |
@akinwale Thanks for the quick fixes! I've retested and see no issues now. All yours @aldo-expensify! |
✋ 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/aldo-expensify in version: 1.3.76-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.76-6 🚀
|
🚀 Deployed to staging by https://github.com/aldo-expensify in version: 1.3.77-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.77-7 🚀
|
Details
Prevents a distance request from being completed if the amount is larger than the maximum allowed.
Fixed Issues
$ #27255
PROPOSAL: #27255 (comment)
Tests
Offline tests
N/A
QA Steps
Same as tests.
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
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)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)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
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android