Bring auditor role to NewDot#47561
Conversation
48e7c53 to
f08c970
Compare
|
Working example: Screen.Recording.2024-08-22.at.14.24.26.mp4 |
|
@ishpaul777 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: NativeAndroid: mWeb ChromeScreen.Recording.2024-09-07.at.12.21.48.AM.moviOS: NativeScreen.Recording.2024-09-07.at.1.16.47.AM.movScreen.Recording.2024-09-07.at.1.15.40.AM.moviOS: mWeb SafariScreen.Recording.2024-09-07.at.1.23.04.AM.movScreen.Recording.2024-09-07.at.1.24.41.AM.movMacOS: Chrome / SafariScreen.Recording.2024-09-07.at.12.00.36.AM.movMacOS: DesktopScreen.Recording.2024-09-07.at.1.31.49.AM.mov |
|
I've just remembered that we should wait for Auditor icon and also the Spanish translation confirmation |
|
It's now ready! |
|
Looks good to me, though minor nit, I think we should make Also, @JmillsExpensify @shawnborton, do you think we should add a badge for Assuming this was discussed in the past, but just wanted to check. Currently there's no way to separate a auditor and a member from a list. |
|
Totally agree with you @dubielzyk-expensify. But when reading the docs I noticed this note:
Here's the slack thread: |
|
I thought that list talk about the members list from somewhere like a chat room etc: Not the actual Workspace Editor Member list which is what I screenshotted above. Totally accepting if I'm just confused haha. I'll let @JmillsExpensify and @shawnborton weigh in :) |
You're right 🥲 . |
100% agree, least common option by far.
Also agree that the auditors in the members table in the workspace settings should get an |
|
Sorry I can't seem to reproduce 🤦 |
|
I'll see if I can get it to work on local - maybe it was a temporary backend thing that's now fixed? And the translations were confirmed, so I think we're basically good here. I'll take one last look shortly and then merge! |
dangrous
left a comment
There was a problem hiding this comment.
one issue, otherwise looks good!
| /** | ||
| * Checks if the user has auditor permission in the provided report | ||
| */ | ||
| function isAuditor(report: OnyxEntry<Report>): boolean { |
There was a problem hiding this comment.
Okay so I think this is slightly wrong - I think we should check for isPolicyAuditor first and THEN check report permissions afterwards. Otherwise the following test steps seem to occur:
- Create a workspace
- Add two members, then make one an admin and one an auditor
- Assign a task to each of them in the
#adminschat - Log in as the auditor
- The auditor will be able to edit both tasks.
I looked at Onyx and the auditor's report permissions for the task assigned to the admin is read, write, share. I'm honestly not sure why that is, but it seems like if we checked isPolicyAuditor first then we wouldn't get to that point.
What do you think? Would this cause any issues I'm not aware of?
There was a problem hiding this comment.
Follow up - let me know how you were testing it before if it was seeming to work then? Maybe I did something wrong - or maybe there's a flow (maybe the change role isn't working or something?) that we need to adjust
There was a problem hiding this comment.
Thanks let me take a look
There was a problem hiding this comment.
Yes, that's pretty weird that on the admin assigned task, when I viewed it as an auditor the permissions are read, write, share which makes isAuditor return false. Meanwhile it should be empty (as I checked/ tested before 😂).
Switch the PolicyUtils.isPolicyAuditor(policy); to the top will make it works because we will use the role to check it. Nevermind, let me update the code.
Thanks for testing it! 💯
dangrous
left a comment
There was a problem hiding this comment.
Okay this looks great! @ishpaul777 can you give it one last quick round of tests, now that we have the updated logic for isAuditor?
|
On it 🙇 |
|
Looks good! Verified Auditor can not edit the task assigned to other user. Thanks for catching what i missed @dangrous 🙏 Screen.Recording.2024-09-13.at.11.35.32.PM.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/dangrous in version: 9.0.35-0 🚀
|
|
🚀 Deployed to production by https://github.com/grgia in version: 9.0.35-7 🚀
|
|
hey @ishpaul777 are you still able to reproduce #47561 (comment) ? I can't get it to happen anymore. If so, can you let me know what steps I need to follow? Here's what I'm doing:
Thanks! |
|
bumping this ^ when you have time, @ishpaul777 - thank you! |
|
Sorry i missed ping earlier, will retest in few minutes |
|
I am sorry took me longer than expected, I tested and i could not reproduce as well Screen.Recording.2024-09-24.at.2.32.02.AM.mov |
|
While implementing support for |
| */ | ||
| function isAllowedToComment(report: OnyxEntry<Report>): boolean { | ||
| if (isAuditor(report)) { | ||
| return true; |
|
When the Auditor role was added, the validation was not added to the This was fixed here: #89935 |



Details
https://docs.google.com/document/d/1Okva7PJJwmOEFPbsD74pWUzB2R8EzOqnz4EKjcLnTJQ
Fixed Issues
$ #47695
PROPOSAL: N/A
Tests
Auditorrole.Auditorrole.Viewbutton beside Expense request.Offline tests
Same as Tests.
QA Steps
Same as Tests.
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
Android: mWeb Chrome
Screen.Recording.2024-08-22.at.16.19.15.mov
Screen.Recording.2024-08-22.at.15.29.59.mov
iOS: Native
Screen.Recording.2024-08-22.at.15.29.59.mov
iOS: mWeb Safari
Screen.Recording.2024-08-22.at.15.39.34.mov
MacOS: Chrome / Safari
Screen.Recording.2024-08-22.at.14.24.26.mp4
MacOS: Desktop
Screen.Recording.2024-08-22.at.14.30.21.mov