Skip to content

[HOLD for payment 2024-08-02] [$250] Workspace - "Remove member" modal show that the user is an approver when they are not approver #45510

Closed

Description

@lanitochka17

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.0.7-4
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Create a new workspace
  3. Go to workspace settings > Members
  4. Add some members
  5. Click on any member
  6. Click Remove from workspace

Expected Result:

"Remove member" modal will not show that the user is an approver if they are not an approver

Actual Result:

"Remove member" modal show that the user is an approver when they are not an approver

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

Add any screenshot/video evidence

Bug6543977_1721137169629.20240716_213707.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01b2f905d2ab7918d6
  • Upwork Job ID: 1813404779499632184
  • Last Price Increase: 2024-07-17
  • Automatic offers:
    • allgandalf | Reviewer | 103193071
Issue OwnerCurrent Issue Owner: @kadiealexander

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 16, 2024
  2. melvin-bot commented on Jul 16, 2024

    @melvin-bot

    Triggered auto assignment to @kadiealexander (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.

  3. lanitochka17 commented on Jul 16, 2024

    @lanitochka17
    Author

    @kadiealexander FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

  4. lanitochka17 commented on Jul 16, 2024

    @lanitochka17
    Author

    We think that this bug might be related to #wave-collect - Release 1

  5. etCoderDysto commented on Jul 16, 2024

    @etCoderDysto
    Contributor

    Proposal

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

    "Remove member" modal show that the user is an approver when they are not approver

    What is the root cause of that problem?

    When isApprover is false, we are not returning translate('workspace.people.removeMemberPrompt', {memberName: displayName});. Therefore, code execution continues to the next line of code and return translate('workspace.people.removeMembersWarningPrompt', {memberName: displayName, ownerName: policyOwnerDisplayName});

    if (!isApprover) {
    translate('workspace.people.removeMemberPrompt', {memberName: displayName});
    }
    return translate('workspace.people.removeMembersWarningPrompt', {memberName: displayName, ownerName: policyOwnerDisplayName});
    }, [accountID, policy, displayName, policyOwnerDisplayName, translate]);

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

    Add return statement before translate('workspace.people.removeMemberPrompt', {memberName: displayName});

    return translate('workspace.people.removeMemberPrompt', {memberName: displayName});

    Note: isApprover seems to be returning false for approver too. We can fix that too by adding || employeeLogin === policy?.approver below (LN 108)

    function isApprover(policy: OnyxEntry<Policy>, employeeAccountID: number) {
    const employeeLogin = allPersonalDetails?.[employeeAccountID]?.login;
    return Object.values(policy?.employeeList ?? {}).some(
    (employee) => employee?.submitsTo === employeeLogin || employee?.forwardsTo === employeeLogin || employee?.overLimitForwardsTo === employeeLogin,

    Doing that will fix similar issues on workspace member page too

    What alternative solutions did you explore? (Optional)

    Result:

    Screen.Recording.2024-07-16.at.10.26.11.at.night.mp4
  6. etCoderDysto commented on Jul 16, 2024

    @etCoderDysto
    Contributor

    Proposal Updated:

    • Added result
  7. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jul 17, 2024
  8. changed the title [-]Workspace - "Remove member" modal show that the user is an approver when they are not approver[/-] [+][$250] Workspace - "Remove member" modal show that the user is an approver when they are not approver[/+] on Jul 17, 2024
  9. melvin-bot commented on Jul 17, 2024

    @melvin-bot
  10. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 17, 2024
  11. melvin-bot commented on Jul 17, 2024

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @allgandalf (External)

  12. codeapexdev commented on Jul 17, 2024

    @codeapexdev

    Proposal

    Problem Statement
    "Remove member" modal should show that the user is an approver when they are not an approver but it is showing user is an approver even if they are not an approver.

    Problem
    In the confirm modal prompt, we are getting the false value in isApprover but it is not returned

    Screenshot 2024-07-17 at 3 25 02 PM

    Solution
    return translate('workspace.people.removeMemberPrompt', {memberName: displayName});

    Screenshot 2024-07-17 at 3 24 28 PM

    Contributor details
    Your Expensify account email: akashftg@gmail.com
    Upwork Profile Link: https://www.upwork.com/freelancers/~0114eee6cee79fee8e

  13. 26 remaining items

  14. melvin-bot commented on Jul 26, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.12-0 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2024-08-02. 🎊

    For reference, here are some details about the assignees on this issue:

  15. melvin-bot commented on Jul 26, 2024

    @melvin-bot

    BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  16. allgandalf commented on Jul 29, 2024

    @allgandalf
    Contributor

    Regression Test Proposal 1

    Precondition: Workspace member is an approver of the workspace.

    • As a admin, Go to workspace settings
    • Go to members
    • Click on the profile of a member who is approver and click on remove member

    Verify that you see the message : ${memberName} is an approver in this workspace. When you unshare this workspace with them, we’ll replace them in the approval workflow with the workspace owner, ${ownerName}

    Regression Test Proposal 2

    Precondition: Workspace member is not an approver of the workspace.

    • As a admin, Go to workspace settings
    • Go to members
    • Click on the profile of a member who is approver and click on remove member

    Verify that you see the message : Are you sure you want to remove ${memberName}?

    Do we agree 👍 or 👎

  17. francoisl commented on Jul 29, 2024

    @francoisl
    Contributor

    LGTM, opened internal issue to create a regression test.

  18. allgandalf commented on Aug 4, 2024

    @allgandalf
    Contributor

    Can this be paid out please :)

  19. kadiealexander commented on Aug 5, 2024

    @kadiealexander
    Contributor

    Payouts due:

    Upwork job is here.

  20. kadiealexander commented on Aug 5, 2024

    @kadiealexander
    Contributor

    @etCoderDysto I can't find you on Upwork, could you please apply to the Upwork job?

  21. kadiealexander commented on Aug 7, 2024

    @kadiealexander
    Contributor

    @etCoderDysto sent you an offer, thanks!

  22. etCoderDysto commented on Aug 7, 2024

    @etCoderDysto
    Contributor

    @kadiealexander I have accepted the offer. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions