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][$500] Feature request: Unable to add multiple emails at once as members to a room #26242 #30874

Closed
1 of 6 tasks
mallenexpensify opened this issue Nov 3, 2023 · 48 comments
Assignees
Labels
External Added to denote the issue can be worked on by a contributor Monthly KSv2 NewFeature Something to build that is a new item.

Comments

@mallenexpensify
Copy link
Contributor

mallenexpensify commented Nov 3, 2023

Coming from the below, which should be very similar

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


Action Performed:

  1. Go to staging.new.expensify.com
  2. Log in with any account
  3. Add multiple emails at once as members to a room

Expected Result:

Allow for multiple emails addresses to be added at once via a comma-separated list when inviting new members to a room.

Actual Result:

Unable to add multiple emails at once as members to a workspace

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.95-5
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
Notes/Photos/Videos: Any additional supporting documentation

image (20)

Expensify/Expensify Issue URL:
Issue reported by: @mallenexpensify
Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1692837155454539

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~017b2a4652d665e512
  • Upwork Job ID: 1699456983730249728
  • Last Price Increase: 2023-11-06
@mallenexpensify mallenexpensify added Daily KSv2 NewFeature Something to build that is a new item. labels Nov 3, 2023
@mallenexpensify mallenexpensify self-assigned this Nov 3, 2023
Copy link

melvin-bot bot commented Nov 3, 2023

Current assignee @mallenexpensify is eligible for the NewFeature assigner, not assigning anyone new.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Nov 3, 2023
@mallenexpensify
Copy link
Contributor Author

@Samueljh1 would you like to work on this since you worked on the other? If so, the job price is $500.

@mananjadhav
Copy link
Collaborator

@mallenexpensify in this gets worked upon, can I work as C+? Helped with the previous issue too.

@mallenexpensify
Copy link
Contributor Author

Yes, good 👀 Manan, I didn't think about the benefit of having the same C+ too

@Samueljh1
Copy link
Contributor

@Samueljh1 would you like to work on this since you worked on the other? If so, the job price is $500.

Yes, happy to work on this

@mallenexpensify mallenexpensify added the Bug Something is broken. Auto assigns a BugZero manager. label Nov 6, 2023
Copy link

melvin-bot bot commented Nov 6, 2023

Current assignee @mallenexpensify is eligible for the Bug assigner, not assigning anyone new.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Nov 6, 2023
Copy link

melvin-bot bot commented Nov 6, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@mallenexpensify mallenexpensify added Weekly KSv2 External Added to denote the issue can be worked on by a contributor labels Nov 6, 2023
@melvin-bot melvin-bot bot changed the title Feature request: Unable to add multiple emails at once as members to a room #26242 [$500] Feature request: Unable to add multiple emails at once as members to a room #26242 Nov 6, 2023
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 6, 2023
Copy link

melvin-bot bot commented Nov 6, 2023

Current assignee @mananjadhav is eligible for the External assigner, not assigning anyone new.

@melvin-bot melvin-bot bot removed the Weekly KSv2 label Nov 6, 2023
@mananjadhav
Copy link
Collaborator

@Samueljh1 Can you post a proposal so that we're aligned on the approach and the changes?

@Samueljh1
Copy link
Contributor

The code changes are basically the same.

Proposal

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

When adding new members to a room, we can only invite one at a time.

What is the root cause of that problem?

The handlers and code in RoomInvitePage.js only have logic that support inviting one member at a time (e.g., userToInvite is a single value, instead of an array).

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

Update single-user state variable userToInvite to an array, and update all handling logic to support multiple users (e.g., iterate through the invited emails when updating the list view instead of updating a single item). When handling updates to searchTerm, we can parse the string with the same parsing logic from WorkspaceInvitePage.

What alternative solutions did you explore? (Optional)

N/A.

@Samueljh1
Copy link
Contributor

Samueljh1 commented Nov 7, 2023

Screen.Recording.2023-11-08.at.00.26.37.mov

Any reason why this is happening? I am not able to open the invite page. I cannot work on the task until this is resolved. I hope this will be considered in the timing as well of the fix?

Thanks

@mallenexpensify
Copy link
Contributor Author

I have no idea @Samueljh1 , what platform and version are you on?

@Samueljh1
Copy link
Contributor

Samueljh1 commented Nov 8, 2023

I have no idea @Samueljh1 , what platform and version are you on?

Chrome MacOS new.expensify.com. Same issue on iOS Safari.

@DylanDylann
Copy link
Contributor

DylanDylann commented Nov 8, 2023

Proposal

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

  • Feature request: Unable to add multiple emails at once as members to a room

What is the root cause of that problem?

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

  • If we still allow user to add multiple emails at once in room, we can apply the same logic as we did with WorkspaceInvitePage before, like below:
 useEffect(() => {
        let emails = _.compact(
            searchTerm
                .trim()
                .replace(/\s*,\s*/g, ',')
                .split(','),
        );

        if (emails.length === 0) {
            emails = [''];
        }

        const newUsersToInviteDict = {};
        const newPersonalDetailsDict = {};
        const newSelectedOptionsDict = {};

        _.each(emails, (email) => {
            const inviteOptions = OptionsListUtils.getMemberInviteOptions(props.personalDetails, props.betas, email, excludedUsers);

            // Update selectedOptions with the latest personalDetails and policyMembers information
            const detailsMap = {};
            _.each(inviteOptions.personalDetails, (detail) => (detailsMap[detail.login] = OptionsListUtils.formatMemberForList(detail)));

            const newSelectedOptions = [];
            _.each(selectedOptions, (option) => {
                newSelectedOptions.push(_.has(detailsMap, option.login) ? {...detailsMap[option.login], isSelected: true} : option);
            });

            const userToInvite = inviteOptions.userToInvite;

            // Only add the user to the invites list if it is valid
            if (userToInvite) {
                newUsersToInviteDict[userToInvite.accountID] = userToInvite;
            }

            // Add all personal details to the new dict
            _.each(inviteOptions.personalDetails, (details) => {
                newPersonalDetailsDict[details.accountID] = details;
            });

            // Add all selected options to the new dict
            _.each(newSelectedOptions, (option) => {
                newSelectedOptionsDict[option.accountID] = option;
            });
        });

        // Strip out dictionary keys and update arrays
        setUsersToInvite(_.values(newUsersToInviteDict));
        setPersonalDetails(_.values(newPersonalDetailsDict));
        setSelectedOptions(_.values(newSelectedOptionsDict));

        // eslint-disable-next-line react-hooks/exhaustive-deps -- we don't want to recalculate when selectedOptions change
    }, [props.personalDetails, props.policyMembers, props.betas, searchTerm, excludedUsers]);

What alternative solutions did you explore? (Optional)

  • NA

@mallenexpensify
Copy link
Contributor Author

Put on hold, removed reviewing label, left as a weekly

@mallenexpensify
Copy link
Contributor Author

No action the past week, we'll want to prioritize before too long

@melvin-bot melvin-bot bot added the Overdue label Feb 1, 2024
@mallenexpensify
Copy link
Contributor Author

Still held

@melvin-bot melvin-bot bot removed the Overdue label Feb 7, 2024
@melvin-bot melvin-bot bot added the Overdue label Feb 15, 2024
@mallenexpensify
Copy link
Contributor Author

on hold

@melvin-bot melvin-bot bot removed the Overdue label Feb 21, 2024
@melvin-bot melvin-bot bot added the Overdue label Feb 29, 2024
@mallenexpensify
Copy link
Contributor Author

Holding on a unified design proposal, bumping to monthly til we prioritize.

@melvin-bot melvin-bot bot removed the Overdue label Mar 4, 2024
@mallenexpensify mallenexpensify added Monthly KSv2 and removed Weekly KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Mar 4, 2024
@mallenexpensify
Copy link
Contributor Author

Added to #vip-vsb because it doesn't haven't to do with money.

@melvin-bot melvin-bot bot added the Overdue label Apr 29, 2024
@mallenexpensify
Copy link
Contributor Author

From the other similar issue

This is actively being redesigned with Groups so I'm going to close. We can reopen if it's still behaving unexpectedly once we update.

Temped to close but I'm going to wait one more 'overdue' round then I'll retest and see if it makes sense to keep open or close.

@melvin-bot melvin-bot bot removed the Overdue label May 1, 2024
@melvin-bot melvin-bot bot added the Overdue label Jun 3, 2024
@mallenexpensify
Copy link
Contributor Author

Closing, will reopen if/when needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External Added to denote the issue can be worked on by a contributor Monthly KSv2 NewFeature Something to build that is a new item.
Projects
No open projects
Archived in project
Development

No branches or pull requests

5 participants