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

[$250] Workspace - "Remove members" and "Make admin" options are present for owner #46620

Closed
3 of 6 tasks
m-natarajan opened this issue Jul 31, 2024 · 34 comments
Closed
3 of 6 tasks
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 External Added to denote the issue can be worked on by a contributor

Comments

@m-natarajan
Copy link

m-natarajan commented Jul 31, 2024

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


Issue found when validating #45732
Version Number: 9.0.15-4
Reproducible in staging?: y
Reproducible in production?: unable to check new feature
Issue reported by: applause internal team

Action Performed:

  1. Launch New Expensify app.
  2. Go to workspace settings > Members.
  3. Long press on the owner.
  4. Tap Select.
  5. Tap on the dropdown.

Expected Result:

Owner should not be able to be selected (production behavior).

Actual Result:

Owner can be selected and there are "Remove members" and "Make members" options which are not applicable to the owner.

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0110a7f901ae8b6a28
  • Upwork Job ID: 1818787780851878074
  • Last Price Increase: 2024-07-31
  • Automatic offers:
    • neonbhai | Contributor | 103438189
Issue OwnerCurrent Issue Owner: @getusha
@m-natarajan m-natarajan added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. DeployBlocker Indicates it should block deploying the API labels Jul 31, 2024
Copy link

melvin-bot bot commented Jul 31, 2024

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

Copy link

melvin-bot bot commented Jul 31, 2024

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

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Jul 31, 2024
Copy link
Contributor

👋 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.

@m-natarajan
Copy link
Author

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

@cead22 cead22 added Daily KSv2 External Added to denote the issue can be worked on by a contributor and removed Hourly KSv2 DeployBlocker Indicates it should block deploying the API DeployBlockerCash This issue or pull request should block deployment labels Jul 31, 2024
@melvin-bot melvin-bot bot changed the title Workspace - "Remove members" and "Make admin" options are present for owner [$250] Workspace - "Remove members" and "Make admin" options are present for owner Jul 31, 2024
Copy link

melvin-bot bot commented Jul 31, 2024

Job added to Upwork: https://www.upwork.com/jobs/~0110a7f901ae8b6a28

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 31, 2024
Copy link

melvin-bot bot commented Jul 31, 2024

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

@neonbhai
Copy link
Contributor

neonbhai commented Jul 31, 2024

Proposal

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

Workspace - "Remove members" and "Make admin" options are present for owner

What is the root cause of that problem?

We allow the select modal to be present for options which have selection disabled. This results in user being able to select rows for which selection has been disabled

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

We should use isDisabled and isCheckBoxDisabled properties here when checking selection mode should be triggered:

const handleLongPressRow = (item: TItem) => {
if (!turnOnSelectionModeOnLongPress || !isSmallScreenWidth) {

if (!turnOnSelectionModeOnLongPress || !isSmallScreenWidth || item?.isDisabled || item?.isCheckBoxDisabled) {
    return;
}

This will also fix the issue in WorkspaceTaxesPage and ReportParticipantsPage which have the same issue present.

@daledah
Copy link
Contributor

daledah commented Aug 1, 2024

Proposal

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

Owner can be selected and there are "Remove members" and "Make members" options which are not applicable to the owner.

What is the root cause of that problem?

We always call onLongPressRow?.(item) without checking whether that option can be selected or not:

onLongPress={() => {
onLongPressRow?.(item);
}}

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

We should use:

                onLongPress={isDisabled || item.isDisabledCheckbox ? undefined : () => onLongPressRow?.(item)}

What alternative solutions did you explore? (Optional)

We can update the condition:

if (!turnOnSelectionModeOnLongPress || !isSmallScreenWidth) {

to:

        if (!turnOnSelectionModeOnLongPress || !isSmallScreenWidth || item?.isDisabled || item.isSelected || item?.isDisabledCheckbox) {

@Tony-MK
Copy link
Contributor

Tony-MK commented Aug 1, 2024

Proposal

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

Workspace - "Remove members" and "Make admin" options are present for owner

What is the root cause of that problem?

The problem is that the WorkspaceMembersPage does not disabled the policy owner option.

Hence, the policy owner option can always be selected and the "Remove members" and "Make admin" options are present for the owner.

isDisabled:
!!details.isOptimisticPersonalDetail ||
(isPolicyAdmin && (policyEmployee.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || !isEmptyObject(policyEmployee.errors))),

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

We should disable the owner option being able to be selected by adding the following condition, accountID === policy?.ownerAccountID, to check if the account owns the policy for isDisabled.

The full condition will look like this.

isDisabled:
    accountID === policy?.ownerAccountID
    !!details.isOptimisticPersonalDetail || 
    (isPolicyAdmin && (policyEmployee.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || !isEmptyObject(policyEmployee.errors))), 
....

@getusha
Copy link
Contributor

getusha commented Aug 6, 2024

@neonbhai why do we need item?.isDisabled in the condition?

@getusha
Copy link
Contributor

getusha commented Aug 6, 2024

@neonbhai's proposal looks good to me, seems like a very straightforward issue. and we don't want to fully disable it.
🎀 👀 🎀 C+ Reviewed!

Copy link

melvin-bot bot commented Aug 6, 2024

Current assignee @cead22 is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Aug 12, 2024
@bfitzexpensify
Copy link
Contributor

How is this one going @neonbhai?

@neonbhai
Copy link
Contributor

PR is ready for review!

cc: @getusha

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Sep 5, 2024
Copy link

melvin-bot bot commented Sep 5, 2024

This issue has not been updated in over 15 days. @cead22, @bfitzexpensify, @neonbhai, @getusha eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@getusha
Copy link
Contributor

getusha commented Sep 10, 2024

Seems like automation failed on this one. @cead22 could you please check? thanks!

@cead22 cead22 added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Monthly KSv2 Reviewing Has a PR in review labels Sep 11, 2024
@cead22
Copy link
Contributor

cead22 commented Sep 11, 2024

@bfitzexpensify can you handle payment for this issue please? Automation failed here, but I think @neonbhai should be paid via https://www.upwork.com/jobs/~0110a7f901ae8b6a28, and I'm not sure about @getusha after a brief look at the code

Below is the bug zero checklist for reference, in case we need to complete it. Let me know if I tagged the wrong people on some of the items.

Thanks

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:

  • [@getusha] The PR that introduced the bug has been identified. Link to the PR:
  • [@getusha] 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:
  • [@getusha] 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:
  • [@getusha] Determine if we should create a regression test for this bug.
  • [@getusha] 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.
  • [@bfitzexpensify] 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 Sep 17, 2024
Copy link

melvin-bot bot commented Sep 20, 2024

@cead22, @bfitzexpensify, @neonbhai, @getusha Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Sep 20, 2024
@cead22
Copy link
Contributor

cead22 commented Sep 23, 2024

Bump @neonbhai @bfitzexpensify

@melvin-bot melvin-bot bot removed the Overdue label Sep 23, 2024
@bfitzexpensify
Copy link
Contributor

Back from OOO, handling this now

Payment summary:

@neonbhai to be paid $250 for contributor work - offer sent via Upwork
@getusha to be paid $250 for C+ work - via manual request

@getusha can you complete the checklist in #46620 (comment)? Thanks!

Copy link

melvin-bot bot commented Sep 27, 2024

@cead22, @bfitzexpensify, @neonbhai, @getusha Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Sep 27, 2024
@getusha getusha mentioned this issue Sep 29, 2024
50 tasks
@getusha
Copy link
Contributor

getusha commented Sep 29, 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:

[@getusha] The PR that introduced the bug has been identified. Link to the PR: #46096
[@getusha] 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: #46096 (comment)
[@getusha] 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: N/a
[@getusha] Determine if we should create a regression test for this bug. No. IMO it's not related to an important flow and isn't impactful
[@getusha] 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.

@melvin-bot melvin-bot bot removed the Overdue label Sep 29, 2024
@bfitzexpensify
Copy link
Contributor

Thanks! Let's close this out

@garrettmknight
Copy link
Contributor

$250 approved for @getusha

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 External Added to denote the issue can be worked on by a contributor
Projects
No open projects
Status: Done
Development

No branches or pull requests

8 participants