-
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
[CP Staging] fix: workspace member is removable when he is the report owner #50870
Conversation
@eVoloshchak 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] |
@eVoloshchak Please check this as a regression from #48931. |
I can't login on Android, it always tells |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-10-17.at.2.26.21.AM.movAndroid: mWeb ChromeScreen.Recording.2024-10-17.at.2.25.07.AM.moviOS: NativeScreen.Recording.2024-10-17.at.2.27.04.AM.moviOS: mWeb SafariScreen.Recording.2024-10-17.at.2.28.11.AM.movMacOS: Chrome / SafariScreen.Recording.2024-10-17.at.2.22.19.AM.movScreen.Recording.2024-10-17.at.2.21.36.AM.movMacOS: DesktopScreen.Recording.2024-10-17.at.2.24.02.AM.mov |
*/ | ||
const isUserPolicyAdmin = (policy: OnyxInputOrEntry<Policy>, login?: string) => !!(policy && policy.employeeList && login && policy.employeeList[login]?.role === CONST.POLICY.ROLE.ADMIN); | ||
|
||
/** |
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.
Why are we introducing a new check here ?, we already have a util which checks this:
Lines 197 to 201 in 0b3569a
/** | |
* Checks if the current user is an admin of the policy. | |
*/ | |
const isPolicyAdmin = (policy: OnyxInputOrEntry<Policy>, currentUserLogin?: string): boolean => getPolicyRole(policy, currentUserLogin) === CONST.POLICY.ROLE.ADMIN; | |
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 will break the checklist check:
I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
Unless i am missing something there
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.
Ohh i get it now, the end user in this case, No worries, sorry for the confusion
@marcaaron is this expected that normal user can remove member from workspace ? the screenshot from @dominictb contains this screenshot |
@marcaaron in @dominictb screenshots, he has indicated that if a member opens up the participants page he would be able to remove another member in the chat, we block this action only when the current user is admin, is this expected? |
@allgandalf Can you list out the exact steps that lead to whatever you think the bug is? in the steps from the description it says from the perspective of the admin so I'm not sure what you mean by "if a member opens up the participants page he would be able to remove another member in the chat". |
Ohh actually @marcaaron nevermind, I read both the issues and got to know the context, by screenshots of @dominictb i got the feeling that the remove member option is visible to members too, but alright now thanks :) |
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.
LGTM!
fix: workspace member is removable when he is the report owner (cherry picked from commit d03e796) (CP triggered by marcaaron)
✋ 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/marcaaron in version: 9.0.49-2 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/marcaaron in version: 9.0.49-2 🚀
|
Details
Fixed Issues
$ #48931
$ #50771
PROPOSAL:
Tests
Remove from chat
button is disabledRemove from chat
button is disabledOffline tests
NA
QA Steps
See 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-10-16.at.17.59.38.mov
iOS: Native
Screen.Recording.2024-10-16.at.17.54.51.mov
iOS: mWeb Safari
Screen.Recording.2024-10-16.at.17.57.05.mov
MacOS: Chrome / Safari
MacOS: Desktop