[CP Staging] Change report: Display create report option only to owner and policy admin - #80453
Conversation
|
@DylanDylann 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] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-01-26.at.15.38.45.movAndroid: mWeb ChromeScreen.Recording.2026-01-26.at.15.40.24.moviOS: HybridAppScreen.Recording.2026-01-26.at.15.40.13.moviOS: mWeb SafariScreen.Recording.2026-01-26.at.15.38.04.movMacOS: Chrome / SafariScreen.Recording.2026-01-26.at.15.33.23.mov |
|
@s77rt The change looks good to me. The "Create report" option is now hidden, but non-admin approvers can still access the edit report page through the report field. I noticed that non-admin approvers also can not move an expense to another report. Should we disable that field in the non-admin approver as well to block access fully to the edit report page? Screen.Recording.2026-01-26.at.15.26.12.mov |
|
This is the current view from 3 accounts: non-admin approver, admin, employee Screen.Recording.2026-01-26.at.15.33.23.mov |
I think they can but probably only to reports that they can see/access |
I've tested many cases: report's employee, report's approver,... and couldn't see any outstanding reports in the list. But to make sure that we need to check the logic in the codebase |
|
Anyway, It doens't block this PR, we can move forward. |
| () => resolvedReportOwnerAccountID === currentUserPersonalDetails.accountID || isSelectedReportUnreported, | ||
| [resolvedReportOwnerAccountID, currentUserPersonalDetails.accountID, isSelectedReportUnreported], | ||
| ); | ||
| const isAdmin = useMemo(() => isPolicyAdmin(reportPolicy), [reportPolicy]); |
There was a problem hiding this comment.
NAB: this component is compiled by React Compiler so manual memoization is unnecessary
[CP Staging] Change report: Display create report option only to owner and policy admin (cherry picked from commit 240faf6) (cherry-picked to staging by roryabraham)
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Cherry-picked to staging by https://github.com/roryabraham in version: 9.3.8-2 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.3.8-3 🚀
|
|
🚀 Cherry-picked to staging by https://github.com/roryabraham in version: 9.3.9-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.3.9-2 🚀
|
Explanation of Change
Display create report option only to owner and policy admin
Fixed Issues
$ #80400
PROPOSAL:
Tests
Precondittion:
Create reportoptionOffline tests
Same as Tests
QA Steps
Same as Tests
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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari