Fix user can submit 10-digit amount and gives an unexpected error#42426
Conversation
|
@ikevin127 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
| /** | ||
| * Calculate the length of the amount with leading zeroes | ||
| */ | ||
| function calculateAmountLength(amount: string, decimals: number): number { |
There was a problem hiding this comment.
@bernhardoj Got a type error here since you removed decimals but still passing 2 arguments down in the validateAmount function return.
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromeandroid-mweb.moviOS: Nativeios.moviOS: mWeb Safariios-mweb.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
|
✋ 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/marcochavezf in version: 1.4.77-0 🚀
|
[CP Staging] Revert "Merge pull request #42426 from bernhardoj/fix/42084-limi-amount-to-8-digit"
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.77-11 🚀
|
|
🚀 Deployed to staging by https://github.com/marcochavezf in version: 1.4.77-11 🚀
|
|
🚀 Deployed to staging by https://github.com/marcochavezf in version: 1.4.77-11 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.77-11 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.78-5 🚀
|
Details
When we select a currency without decimals, we can input up to 10 digit of amount which leads to a BE error. This PR fix it.
Fixed Issues
$ #42084
PROPOSAL: #42084 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso 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
Screen.Recording.2024-05-21.at.22.51.32.1.mov
Android: mWeb Chrome
Screen.Recording.2024-05-21.at.22.49.34.mov
iOS: Native
Screen.Recording.2024-05-21.at.22.52.23.1.mov
iOS: mWeb Safari
Screen.Recording.2024-05-21.at.22.55.05.mov
MacOS: Chrome / Safari
Screen.Recording.2024-05-21.at.22.40.12.mov
MacOS: Desktop
Screen.Recording.2024-05-21.at.22.41.23.mov