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

[HOLD for payment 2024-03-14] [HOLD for payment 2024-03-13] Workspace - "Free" user is able to see "Admin Role" when WS is made as "Default" #37779

Closed
2 of 6 tasks
kbecciv opened this issue Mar 5, 2024 · 29 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering

Comments

@kbecciv
Copy link

kbecciv commented Mar 5, 2024

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: v1.4.47-2
Reproducible in staging?: y
Reproducible in production?: new feature
Issue found when executing PR: #37199
Issue reported by: Applause - Internal Team

Action Performed:

  1. Access staging.new.expensify.com
  2. Sign into a valid account
  3. Go to WS settings > Tap on a FREE workspace that is set to "Default" in OD site.
  4. Go to members > Select a couple of member and access the drop down menu in the top right

Expected Result:

User does NOT expect to see "Make admin" option, as per the PR, seems this should be limited to "Collect Workspace"

Actual Result:

"Make admin" option is shown for a FREE 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

Add any screenshot/video evidence

Bug6403169_1709663276853.Free_WS_shows_admin_option_.mp4

View all open jobs on GitHub

@kbecciv kbecciv added the DeployBlockerCash This issue or pull request should block deployment label Mar 5, 2024
Copy link
Contributor

github-actions bot commented Mar 5, 2024

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

Copy link

melvin-bot bot commented Mar 5, 2024

Triggered auto assignment to @stitesExpensify (Engineering), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

@kbecciv
Copy link
Author

kbecciv commented Mar 5, 2024

We think that this bug might be related to #wave6-collect-submitters
CC @greg-schroeder

@nexarvo
Copy link
Contributor

nexarvo commented Mar 5, 2024

Proposal

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

"Free" user is able to see "Admin Role" when WS is made as "Default"

What is the root cause of that problem?

There is not condition to hide "make admin" button if the workspace is free.

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

We need to add a condition to check if the workspace plan is free then we will not show the "make admin" button

if (selectedEmployees.find((employee) => policyMembers?.[employee]?.role === CONST.POLICY.ROLE.USER)) {
options.push({
text: translate('workspace.people.makeAdmin'),
value: CONST.POLICY.MEMBERS_BULK_ACTION_TYPES.MAKE_ADMIN,
icon: Expensicons.MakeAdmin,
onSelected: () => changeUserRole(CONST.POLICY.ROLE.ADMIN),
});
}

The if condition will become:

+ if (selectedEmployees.find((employee) => policyMembers?.[employee]?.role === CONST.POLICY.ROLE.USER) && policy?.type !== CONST.POLICY.TYPE.FREE)
- if (selectedEmployees.find((employee) => policyMembers?.[employee]?.role === CONST.POLICY.ROLE.USER))

What alternative solutions did you explore? (Optional)

Result

Before After
Screenshot 2024-03-06 at 12 27 07 AM Screenshot 2024-03-06 at 12 22 14 AM
Screenshot 2024-03-06 at 12 22 35 AM

@allgandalf
Copy link
Contributor

allgandalf commented Mar 5, 2024

Proposal

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

"Free" user is able to see "Admin Role" when WS is made as "Default"

What is the root cause of that problem?

We push the admin option for any type of workspace

if (selectedEmployees.find((employee) => policyMembers?.[employee]?.role === CONST.POLICY.ROLE.USER)) {
options.push({
text: translate('workspace.people.makeAdmin'),
value: CONST.POLICY.MEMBERS_BULK_ACTION_TYPES.MAKE_ADMIN,
icon: Expensicons.MakeAdmin,
onSelected: () => changeUserRole(CONST.POLICY.ROLE.ADMIN),
});
}

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

Limit the admin option to only collect workspace as per the bug description.

We can update the if condition as follows:

if (policy?.type === CONST.POLICY.TYPE.TEAM && selectedEmployees.find((employee) => policyMembers?.[employee]?.role === CONST.POLICY.ROLE.USER)) { 

What alternative solutions did you explore? (Optional)

If we want to apply this for both paid policy types i.e. TEAM as well as CORPORATE, then we can use isPaidGroupPolicy as well from PolicyUtils.

@Tony-MK
Copy link
Contributor

Tony-MK commented Mar 5, 2024

Hi @usman-ghani564 and @GandalfGwaihir, I believe both of your proposals are the same but, have considered using the PolicyUtils.isPaidGroupPolicy function.

@allgandalf
Copy link
Contributor

User does NOT expect to see "Make admin" option, as per the PR, seems this should be limited to "Collect Workspace"

Thanks for bringing this up @Tony-MK , the bug description says that this should be limited to collect workspace but your suggestions are also solid if we want it for CORPORATE policy type as well, I will update this in my alternative solution :)

@luacmartins luacmartins added the Bug Something is broken. Auto assigns a BugZero manager. label Mar 6, 2024
Copy link

melvin-bot bot commented Mar 6, 2024

Triggered auto assignment to @stephanieelliott (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@luacmartins luacmartins self-assigned this Mar 6, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Mar 6, 2024
@nexarvo
Copy link
Contributor

nexarvo commented Mar 6, 2024

@luacmartins PR for this issue is ready for review #37808

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Mar 6, 2024
@melvin-bot melvin-bot bot changed the title Workspace - "Free" user is able to see "Admin Role" when WS is made as "Default" [HOLD for payment 2024-03-13] Workspace - "Free" user is able to see "Admin Role" when WS is made as "Default" Mar 6, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 6, 2024
Copy link

melvin-bot bot commented Mar 6, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Mar 6, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.47-10 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-03-13. 🎊

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

  • @usman-ghani564 requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Mar 6, 2024

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:

  • [@luacmartins / @stitesExpensify] The PR that introduced the bug has been identified. Link to the PR:
  • [@luacmartins / @stitesExpensify] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@luacmartins / @stitesExpensify] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@usman-ghani564] Determine if we should create a regression test for this bug.
  • [@usman-ghani564] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@stephanieelliott] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@roryabraham roryabraham removed the DeployBlockerCash This issue or pull request should block deployment label Mar 6, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Mar 7, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-03-13] Workspace - "Free" user is able to see "Admin Role" when WS is made as "Default" [HOLD for payment 2024-03-14] [HOLD for payment 2024-03-13] Workspace - "Free" user is able to see "Admin Role" when WS is made as "Default" Mar 7, 2024
Copy link

melvin-bot bot commented Mar 7, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.48-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-03-14. 🎊

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

  • @usman-ghani564 requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Mar 7, 2024

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:

  • [@luacmartins / @stitesExpensify] The PR that introduced the bug has been identified. Link to the PR:
  • [@luacmartins / @stitesExpensify] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@luacmartins / @stitesExpensify] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@usman-ghani564] Determine if we should create a regression test for this bug.
  • [@usman-ghani564] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@stephanieelliott] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Mar 13, 2024
@stephanieelliott
Copy link
Contributor

stephanieelliott commented Mar 14, 2024

I'm confused -- was there no C+ on this issue? it looks like multiple people reviewed the PR however none are assigned here. I'll assume the C+ role was covered internally since this was a deploy blocker but LMK if there is a C+ that needs to be paid here.

Summarizing payment on this issue:

  • Contributor: @usman-ghani564 $500 PAID via Upwork
  • Contributor+: (N/A, internal @luacmartins )

Upwork job is here: https://www.upwork.com/jobs/~01e675ca37df68cdf5

@stephanieelliott
Copy link
Contributor

Also a reminder to complete the BZ checklist @luacmartins @usman-ghani564

@nexarvo
Copy link
Contributor

nexarvo commented Mar 14, 2024

@stephanieelliott Please find my Upwork profile here: https://www.upwork.com/freelancers/~01b5c4ee99eace8e60

Copy link

melvin-bot bot commented Mar 14, 2024

Payment Summary

Upwork Job

BugZero Checklist (@stephanieelliott)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@nexarvo
Copy link
Contributor

nexarvo commented Mar 14, 2024

  • Determine if we should create a regression test for this bug. Yes
  • If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

Regression Test Proposal

  1. Sign into a valid account
  2. Go to WS settings
  3. Tap on a FREE workspace that is set to "Default" in OD site.
  4. Go to members
  5. Select a couple of member and access the drop down menu in the top right
  6. Validate you don't see "make admin" and "make member" buttons in the drop down menu.

Do we agree 👍 or 👎

@luacmartins
Copy link
Contributor

We'll add regression tests when this feature is fully implemented. No need to add those now.

@melvin-bot melvin-bot bot added the Overdue label Mar 18, 2024
Copy link

melvin-bot bot commented Mar 18, 2024

@luacmartins, @stephanieelliott, @stitesExpensify, @usman-ghani564 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@stephanieelliott
Copy link
Contributor

Sent the offer to you in Upwork @usman-ghani564!

@melvin-bot melvin-bot bot removed the Overdue label Mar 19, 2024
@nexarvo
Copy link
Contributor

nexarvo commented Mar 19, 2024

Accepted @stephanieelliott

@stephanieelliott
Copy link
Contributor

Thanks! All paid per the payment summary here.

@ishpaul777
Copy link
Contributor

Hey @stephanieelliott @luacmartins I reviewed the PR here #37808 Can we reopen for payment please 🙇‍♂️

@luacmartins luacmartins reopened this Apr 2, 2024
@stephanieelliott
Copy link
Contributor

Oop, thanks @ishpaul777, i was confused about who reviewed this one. Sent the offer to you in Upwork. please accept when you get a chance!

https://www.upwork.com/jobs/~01cae713fcc9593bd0

@ishpaul777
Copy link
Contributor

Thanks! I have accepted the offer

@stephanieelliott
Copy link
Contributor

All paid! New payment summary, updated from #37779 (comment):

Contributor: @usman-ghani564 $500 PAID via Upwork (Upwork job https://www.upwork.com/jobs/~01e675ca37df68cdf5)
Contributor+: @ishpaul777 $500 PAID via Upwork (Upwork job https://www.upwork.com/jobs/~01cae713fcc9593bd0

@ishpaul777
Copy link
Contributor

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering
Projects
None yet
Development

No branches or pull requests

9 participants