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 05-29-2024][$250] Group chat - "Make member" icon is the same as "Make admin" #41509

Closed
lanitochka17 opened this issue May 2, 2024 · 21 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented May 2, 2024

No description provided.

@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 2, 2024
Copy link

melvin-bot bot commented May 2, 2024

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

@lanitochka17
Copy link
Author

@lschurr 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

@lanitochka17
Copy link
Author

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

@cretadn22
Copy link
Contributor

cretadn22 commented May 2, 2024

Proposal

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

What is the root cause of that problem?

if (isAtleastOneAdminSelected) {
options.push({
text: translate('workspace.people.makeMember'),
value: CONST.POLICY.MEMBERS_BULK_ACTION_TYPES.MAKE_MEMBER,
icon: Expensicons.MakeAdmin,
onSelected: () => changeUserRole(CONST.REPORT.ROLE.MEMBER),
});
}

We used wrong icon in ReportParticipantsPage

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

Update to icon: Expensicons.User,

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@ShridharGoel
Copy link
Contributor

ShridharGoel commented May 2, 2024

Proposal

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

Group chat - "Make member" icon is the same as "Make admin".

What is the root cause of that problem?

A wrong icon is used:

options.push({
text: translate('workspace.people.makeMember'),
value: CONST.POLICY.MEMBERS_BULK_ACTION_TYPES.MAKE_MEMBER,
icon: Expensicons.MakeAdmin,
onSelected: () => changeUserRole(CONST.REPORT.ROLE.MEMBER),
});

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

Use Expensicons.User when isAtleastOneAdminSelected is true.

if (isAtleastOneAdminSelected) {
    options.push({
        text: translate('workspace.people.makeMember'),
        value: CONST.POLICY.MEMBERS_BULK_ACTION_TYPES.MAKE_MEMBER,
        icon: Expensicons.User,
        onSelected: () => changeUserRole(CONST.REPORT.ROLE.MEMBER),
    });
}

Also, this logic is duplicated in ReportParticipantsPage and WorkspaceMembersPage. We should move it to a common utils method.

const getRoleChangeOption = (option, changeUserRole) => {
    if (option === CONST.POLICY.MEMBERS_BULK_ACTION_TYPES.MAKE_MEMBER) {
        return {
            text: translate('workspace.people.makeMember'),
            value: CONST.POLICY.MEMBERS_BULK_ACTION_TYPES.MAKE_MEMBER,
            icon: Expensicons.User,
            onSelected: () => changeUserRole(CONST.REPORT.ROLE.MEMBER),
        }
    } else if (option === CONST.POLICY.MEMBERS_BULK_ACTION_TYPES.MAKE_ADMIN) {
        return {
            text: translate('workspace.people.makeAdmin'),
            value: CONST.POLICY.MEMBERS_BULK_ACTION_TYPES.MAKE_ADMIN,
            icon: Expensicons.MakeAdmin,
            onSelected: () => changeUserRole(CONST.REPORT.ROLE.ADMIN),
        }
    }
}

Then, use this at both the places.

We can also add common logic for remove members option, isAtleastOneAdminSelected and isAtleastOneMemberSelected.

@lschurr lschurr added the External Added to denote the issue can be worked on by a contributor label May 2, 2024
@melvin-bot melvin-bot bot changed the title Group chat - "Make member" icon is the same as "Make admin" [$250] Group chat - "Make member" icon is the same as "Make admin" May 2, 2024
Copy link

melvin-bot bot commented May 2, 2024

Job added to Upwork: https://www.upwork.com/jobs/~016c4bdd4a97ecd36a

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

melvin-bot bot commented May 2, 2024

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

@ishpaul777
Copy link
Contributor

Thanks for proposals @ShridharGoel @cretadn22!

@ShridharGoel the only thing differentiate your proposal from @cretadn22 is a minor refactor suggestion, unrelated to the bug which i dont find enough to discard the first proposal.

So Proposal from @cretadn22 LGTM!

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented May 4, 2024

Triggered auto assignment to @dangrous, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@ShridharGoel
Copy link
Contributor

@ishpaul777 Don't you think the issue wouldn't have happened in the first place if a common method was being used? This refactor can help prevent such issues when more changes happen later.

@ShridharGoel
Copy link
Contributor

The almost same code was using correct icon at one place and incorrect at another.

@ishpaul777
Copy link
Contributor

ishpaul777 commented May 4, 2024

@ishpaul777 Don't you think the issue wouldn't have happened in the first place if a common method was being used? This refactor can help prevent such issues when more changes happen later.

This will be very niche use for a util i dont think it really worth it to have a utility for such a small usecase having it in same component improves code readability IMO, that being said i'll let assigned engineer make final call on assignment.

@cretadn22
Copy link
Contributor

@ishpaul777 Is this waiting for me to create PR? Or what pending here?

@melvin-bot melvin-bot bot added the Overdue label May 7, 2024
@dangrous
Copy link
Contributor

dangrous commented May 7, 2024

Yeah I think let's go with the simpler (first) solution for now. I totally understand where you're coming from, @ShridharGoel, but I agree that for readability it makes sense to stick with the format we already have. Maybe if we have more roles in the future we can rethink, but for the two we have now (and this bug) I'll assign @cretadn22!

@melvin-bot melvin-bot bot removed Help Wanted Apply this label when an issue is open to proposals by contributors Overdue labels May 7, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels May 7, 2024
@cretadn22
Copy link
Contributor

@ishpaul777 @dangrous I created the PR #41776

@trjExpensify
Copy link
Contributor

Group chat is in #vip-split, moving.

@dangrous
Copy link
Contributor

Looks like the automation didn't fire but this hit prod 5/22 - so should be paid 5/29

@lschurr lschurr changed the title [$250] Group chat - "Make member" icon is the same as "Make admin" [Hold for payment 05-29-2024][$250] Group chat - "Make member" icon is the same as "Make admin" May 28, 2024
@lschurr
Copy link
Contributor

lschurr commented May 28, 2024

Payment summary:

  • Contributor: @cretadn22 $250 (offer sent in Upwork)
  • Contributor+: @ishpaul777 $250 (offer sent in Upwork)

@lschurr
Copy link
Contributor

lschurr commented May 28, 2024

Great! Offer sent in Upwork.

@cretadn22
Copy link
Contributor

@lschurr Accepted your offer. Thanks 🙏

@lschurr
Copy link
Contributor

lschurr commented May 29, 2024

Payments have been sent in Upwork. All set to close this one out.

@lschurr lschurr closed this as completed May 29, 2024
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. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

7 participants