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

Add autocomplete to add members to a group by name #30

Open
rorysaur opened this issue May 31, 2022 · 0 comments
Open

Add autocomplete to add members to a group by name #30

rorysaur opened this issue May 31, 2022 · 0 comments
Labels

Comments

@rorysaur
Copy link
Contributor

rorysaur commented May 31, 2022

The new "Groups" app is for defining groups and their members, for multiple future uses, such as forming the team that owns an Adventure, a team application to a block, or a group of people who host a Convo series, etc.

In the app right now, to create a group and add members to it, I need to enter each member's memberId, comma-separated; which means I need to go to the Explorer, find the member, copy their memberId, and paste it into the Groups form.

Instead, as a user on the Groups create/edit form, I would like to be able to:

  1. Start typing in a user (human)'s name, and have the input filter the matching humans and show me the options.
  2. When I select a human (by pressing enter or clicking), display their name in a tag below the input.
  3. I can select more humans and all their tags will be added.
  4. Each tag with a member's name should have an X that I can click to remove them.
  5. When I save the form, the group is saved with the members as listed.
  6. On the Edit form, the tags showing existing members should already be present.
  7. PS. Order of members doesn't matter.

There are tag input libraries that do this, but we'd like to avoid using one if possible, because they can be hard to customize; and I think it's feasible in our system to roll our own.

We're using headlessUI (already installed), so try to make use of the autocomplete component. headlessUI components are unstyled by default, so a typical workflow is to copy or look at their sample code snippet, which IS styled, but change the styling to make sense for us.

To get profiles data such as people's names, you will need to use the queryService (see Explorer for example), as that is the only way to read the data of profiles other than the current user's.

Bonus points if you make the entire tag-input component a common component that takes a list of any items and fulfills #1-4 above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant