Skip to content
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

[Simple AA in NewDot] No option to leave workspace as non owner admin #43508

Open
6 tasks done
m-natarajan opened this issue Jun 11, 2024 · 56 comments
Open
6 tasks done
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Hot Pick Ready for an engineer to pick up and run with Internal Requires API changes or must be handled by Expensify staff Monthly KSv2

Comments

@m-natarajan
Copy link

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.4.81-8
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @Beamanator
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1718092341741619

Action Performed:

  1. Create policy in NewDot
  2. Invite another user as admin
  3. Log in as that admin
  4. Open workspace members page & try to leave the workspace
    Expected Result:

Expected Result:

There's no way for you to leave a workspace, as an admin & not the owner

Actual Result:

There should be a way for a non-owner workspace admin to leave a workspace.

Workaround:

unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Screen.Recording.2024-06-11.at.10.50.01.AM.mov

Snip - (60) New Expensify - Google Chrome

View all open jobs on GitHub

@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 11, 2024
Copy link

melvin-bot bot commented Jun 11, 2024

Triggered auto assignment to @johncschuster (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@truph01
Copy link
Contributor

truph01 commented Jun 12, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

  • There should be a way for a non-owner workspace admin to leave a workspace.

What is the root cause of that problem?

What changes do you think we should make in order to solve the problem?

  • We can display the Button having the title "Leave" and when pressing on it, call Policy.leaveWorkspace(policyID ?? ''). This button is only displayed if current user is admin and not a owner. To do that, we can update logic:
  • ) : (
    <Button
    text={translate('workspace.people.removeMemberButtonTitle')}
    onPress={askForConfirmationToRemove}
    medium
    isDisabled={isSelectedMemberOwner || isSelectedMemberCurrentUser}
    icon={Expensicons.RemoveMembers}
    iconStyles={StyleUtils.getTransformScaleStyle(0.8)}
    style={styles.mv5}
    />
    )}

    to:
) : isCurrentUserAdmin && !isCurrentUserOwner ? (
                            <Button
                                text={'Leave'}
                                onPress={() => Policy.leaveWorkspace(policyID)}
                                medium
                                icon={Expensicons.RemoveMembers}
                                iconStyles={StyleUtils.getTransformScaleStyle(0.8)}
                                style={styles.mv5}
                            />
                        ) : (
                            <Button
                                text={translate('workspace.people.removeMemberButtonTitle')}
                                onPress={askForConfirmationToRemove}
                                medium
                                isDisabled={isSelectedMemberOwner || isSelectedMemberCurrentUser}
                                icon={Expensicons.RemoveMembers}
                                iconStyles={StyleUtils.getTransformScaleStyle(0.8)}
                                style={styles.mv5}
                            />
                        )}
  • We should add "Leave" option to this logic:
    const getMenuItem = useCallback(

    if current user is admin but not owner as well.
  • Then BE need to fix the LeavePolicy API so that non owner admin can leave workspace.

What alternative solutions did you explore? (Optional)

  • With the member of the workspace who is not admin or owner, we also need to display "Leave" option which allows them to leave workspace as well because we already displayed "Leave" option in WorkspaceListPage if user is not admin and owner:
    if (!(isAdmin || isOwner)) {
    threeDotsMenuItems.push({
    icon: Expensicons.ChatBubbles,
    text: translate('common.leave'),
    onSelected: Session.checkIfActionIsAllowed(() => Policy.leaveWorkspace(item.policyID ?? '')),
    });
    }

@devguest07
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

Admin is not able to remove himself from a workspace.

What is the root cause of that problem?

On the WorkspaceMemberDetailsPage, the "Remove from workspace" button is disabled when the selected member is the same user.

isDisabled={isSelectedMemberOwner || isSelectedMemberCurrentUser}

What changes do you think we should make in order to solve the problem?

As requested in this issue, we should not disable the "Remove from workspace" button for the user.

We can remove the isSelectedMemberCurrentUser check.

isDisabled={isSelectedMemberOwner || isSelectedMemberCurrentUser}

We can modify the isSelectedMemberCurrentUser check to ensure the user is an admin. If the selected member is the same user and he is an admin isCurrentUserAdmin, we should not disable the "Remove from workspace" button.

What alternative solutions did you explore?

@Beamanator
Copy link
Contributor

FYI we haven't added the Help Wanted label yet b/c we're still designing out exactly how we want this to work, so I wouldn't recommend adding proposals yet 😅

@melvin-bot melvin-bot bot added the Overdue label Jun 14, 2024
@johncschuster
Copy link
Contributor

Thanks for the update, @Beamanator. In that case, should this be Daily?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jun 14, 2024
@johncschuster
Copy link
Contributor

@Beamanator, did the discussion land on this?

@melvin-bot melvin-bot bot removed the Overdue label Jun 18, 2024
@Beamanator
Copy link
Contributor

Fair, maybe weekly is better 😅 I have been OOO yesterday and most of last friday so i have some stuff to catch up on, but the latest should be in the linked slack thread! I can try to look at this today soonish as well :D

@johncschuster
Copy link
Contributor

Discussion is still ongoing in Slack (looks like we're close to a path forward).

Setting this to Weekly for now.

@johncschuster
Copy link
Contributor

I think this fits under #wave-collect. @trjExpensify, would you agree?

@trjExpensify
Copy link
Contributor

Did we conclude on this? #43508 (comment)

Seems like it would be something we put in #wave-control and track with that to solve allowing anyone that's not the owner to freely leave a workspace.

Copy link

melvin-bot bot commented Jun 25, 2024

@johncschuster this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added the Overdue label Jul 2, 2024
@johncschuster
Copy link
Contributor

johncschuster commented Jul 2, 2024

Did we conclude on this? #43508 (comment)

I think we did! @Beamanator, as far as I can tell, this comment is the path forward, right? If so, can you give us a summary?

@melvin-bot melvin-bot bot removed the Overdue label Jul 2, 2024
@Beamanator
Copy link
Contributor

Nice, ya i think so!

So for the External part of this issue, it looks like basically just want to:

  1. Give non-owner admins the ability to Leave workspaces
  2. The "Leave" button should be in the 3-dot menu

Now the possibly interesting thing is: Once we implement this being possible, if a non-owner admin in a Control workspace see a warning about themselves being replaced with the Owner, in every member's policy chain? I kinda assume not, we'll just do that automatically?

@melvin-bot melvin-bot bot added the Overdue label Jul 11, 2024
@johncschuster
Copy link
Contributor

@trjExpensify ^^

Given we've come to a conclusion, how about we switch this back to Daily and throw on Help Wanted?

@melvin-bot melvin-bot bot removed the Overdue label Oct 8, 2024
@trjExpensify
Copy link
Contributor

@Beamanator @garrettmknight where is this one on the remaining list of items for the simple AA in NewDot project out of curiosity?

@Beamanator
Copy link
Contributor

It's on the list, but a bit lower priority AFAIK - I am very happy to jump into this once I'm done with my current issues

@melvin-bot melvin-bot bot added the Overdue label Oct 17, 2024
@johncschuster
Copy link
Contributor

Bumping for Melvin while we wait for this to get picked up 🙏

@melvin-bot melvin-bot bot removed the Overdue label Oct 17, 2024
@dylanexpensify dylanexpensify moved this from Release 2: Summer 2024 (Aug) to Release 3: Fall 2024 (Nov) in [#whatsnext] #expense Oct 18, 2024
@melvin-bot melvin-bot bot added the Overdue label Oct 28, 2024
@johncschuster
Copy link
Contributor

Bumping for Melv. This hasn't jumped in priority yet

@melvin-bot melvin-bot bot removed the Overdue label Oct 28, 2024
@melvin-bot melvin-bot bot added the Overdue label Nov 11, 2024
@johncschuster
Copy link
Contributor

Still lower priority

@melvin-bot melvin-bot bot removed the Overdue label Nov 11, 2024
@melvin-bot melvin-bot bot added the Overdue label Nov 20, 2024
@johncschuster
Copy link
Contributor

@garrettmknight can I get a sense check from you? Has the priority changed for this one?

@melvin-bot melvin-bot bot removed the Overdue label Nov 20, 2024
@garrettmknight
Copy link
Contributor

I still think this is low priority, but worth keeping open. If you want you can drop off the issue.

@johncschuster
Copy link
Contributor

Thanks! I'm happy to stay on as the BZ 👍 Just wanted to get a sense check so I could apply the right level of urgency. I'll keep it bumping!

@johncschuster
Copy link
Contributor

Giving this a Melvbump since I'll be OOO tomorrow and Friday. Not overdue

@johncschuster
Copy link
Contributor

Happy Monday! I'm back with another Melvinbump.

@johncschuster
Copy link
Contributor

Bumping for Melv 👍

@johncschuster
Copy link
Contributor

Bumping again to keep Melv at bay

@johncschuster
Copy link
Contributor

I'm OOO starting Monday, December 23, and will be returning Monday, January 6. I'll keep this bumping then!

@melvin-bot melvin-bot bot added the Overdue label Dec 30, 2024
@johncschuster
Copy link
Contributor

Hello everyone! I'm back from break! 👋

@melvin-bot melvin-bot bot removed the Overdue label Jan 6, 2025
@johncschuster
Copy link
Contributor

Okay, it looks like I'm the only assignee at the moment, and this issue is still low priority. I'm going to downgrade the label to Monthly for now and keep it bumping so it doesn't get eroded.

We'll increase the priority again when the time is right 👍

@johncschuster johncschuster added Monthly KSv2 and removed Weekly KSv2 labels Jan 13, 2025
@quinthar
Copy link
Contributor

Can we expand this to allow anyone to leave (except the owner), including both admins and members? More info here:

https://expensify.slack.com/archives/C06ML6X0W9L/p1737402644808479?thread_ts=1737153983.772019&cid=C06ML6X0W9L

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Hot Pick Ready for an engineer to pick up and run with Internal Requires API changes or must be handled by Expensify staff Monthly KSv2
Projects
Status: Bugs and Follow Up Issues
Development

No branches or pull requests

8 participants