Fix: Different error messages on invalid distance rate and inaccessible policy#77596
Conversation
|
@QichenZhu 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] |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
…or-message-invalid-distance-rate
Screen.Recording.2025-12-15.at.22.37.17.mov@QichenZhu Do we still hide "Unexpected error editing this expense. Please try again later." in this case? |
|
@huult we need to remove it because:
Also, not only the error, I think we should remove the greyed message too because it's misleading (note that the Distance field doesn't change). |
…or-message-invalid-distance-rate
|
@QichenZhu Thank you, this PR is ready. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppios-native-1.movios-native-2.moviOS: mWeb Safariios-web-1.movios-web-2.movMacOS: Chrome / Safarimac-web-1.movmac-web-2.mov |
…or-message-invalid-distance-rate
JmillsExpensify
left a comment
There was a problem hiding this comment.
Error messages look good.
…or-message-invalid-distance-rate
|
Updated the PR title to be more meaningful cc @huult |
|
✋ 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/MonilBhavsar in version: 9.2.86-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.2.86-4 🚀
|
| const canEditDistanceRate = | ||
| isEditable && | ||
| canEditFieldOfMoneyRequest(parentReportAction, CONST.EDIT_REQUEST_FIELD.DISTANCE_RATE, undefined, isChatReportArchived) && | ||
| isPolicyAccessible(policy, currentUserEmailParam); |
There was a problem hiding this comment.
#80499 was caused by this. More info in #80499 (comment)
Explanation of Change
Ensure the rate and distance fields are read-only when the policy is not accessible, preventing edits in invalid states.
Fixed Issues
$ #71564
PROPOSAL: #71564 (comment)
Tests
Same QA step
Offline tests
QA Steps
Bug 1:
Bug 2:
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)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.2025-12-16.at.09.50.36.mp4
Android: mWeb Chrome
Screen.Recording.2025-12-16.at.09.53.51.mp4
iOS: Native
Screen.Recording.2025-12-16.at.09.56.05.mp4
iOS: mWeb Safari
Screen.Recording.2025-12-16.at.10.03.53.mp4
MacOS: Chrome / Safari
Screen.Recording.2025-12-16.at.09.45.47.mp4