-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Bring auditor role to NewDot #47561
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 |
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.
Minor changes, and a question - but this is looking great!
So for this, what needs to be sent that isn't being sent right now? Is OpenApp / ReconnectApp not sending the expense reports, or sending them in the wrong format? Something else? |
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.
This looks good to me! I think we can probably go ahead and merge, and handle those missing reports afterwards, what do you think?
Agreed 🚀 |
Okay conflicts, sorry! And then I pinged the team to review/confirm those translations you posted @hungvu193. Other than those two issues, I think we're good! As for that backend issue, can you help me diagnose what needs to be sent from the backend that isn't? We can go ahead and merge this but would love to get that sorted in the meantime. |
I'll help diagnose this once i am back tomorrow, OOO today if @hungvu193 can get to this first feel free to... 🙇 |
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! |
still able to reproduce, it appears that transaction does not exist locally Screen.Recording.2024-09-12.at.10.11.45.PM.movand these coditions here return to be true Lines 1368 to 1370 in cfe3d36
specifically this Lines 1361 to 1363 in cfe3d36
|
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
#admins
chat - 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks let me take a look
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.
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! 💯
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.
Updated!
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.
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 |
Details
https://docs.google.com/document/d/1Okva7PJJwmOEFPbsD74pWUzB2R8EzOqnz4EKjcLnTJQ
Fixed Issues
$ #47695
PROPOSAL: N/A
Tests
Auditor
role.Auditor
role.View
button beside Expense request.Offline tests
Same as Tests.
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 methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.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
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