Improve results when adding new members to project or group
Description
Adding new members to a project or group uses the "Add members" section of the respective page, where a user can specify a user to add from a dropdown. As described in https://gitlab.com/gitlab-com/support-forum/issues/3396, the results we return in the AJAX lookup don't always match what the user's looking for. This is especially true when an instance has many members (like GitLab.com).
The current set of results we return does not seem to prioritize exact matches or members who are already in other owned projects/groups, and seems to just wildcard match on name or username.
Proposal
- Allow a user to add members by username. For example, typing "@jeremy_" into "select members to invite" should return me as the only result.
- Return results we may consider more important first. When searching, present:
- First, present members who are in a parent group (if one exists; if the project or group has a parent group with a matching member, display them first in the list), using our current matching logic (wildcard on username or name).
- Second, present members who are exact username or name matches.
- Then, present everyone else with our current logic (wildcard on username or name).