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
Unable to find user while trying to add a new assembly member #12675
Comments
I have found where is the problem. Let me better explain the context. (I will obviously anonymize the information of the users). Giving an instance with the users below:
We have several users with the same name. Yes, the name can be repeated and yes, every user has a different nickname and email but let me keep explaining our problem. Since #8524 we have been using this library: https://github.com/TarekRaafat/autoComplete.js. It's configured so it will only show a maximum of 10 results in the selector (maybe we should increase that number, but it's not a proper solution because the platform could have thousands of users, and returning all the results would be a problem too). To include the items in the selector, we call the So... nice! I want to find the first user. If we find by name or email ("john") it will return 11 results and we'll show only 10 of them, so it's possible to not have the user we want between the items in the selector. So, let's find by email ( john.doe@example.org). But it won't work either... why?? The complete library needs an attribute To deal with this problem I have two proposals:
@decidim/maintainers what do you think about it? |
I think this could be problematic in other cases where we actually want to search by email:
As far as I know, for meetings specially it's common tu use the invitation with the emails, as the admins may not know the nicknames/names used in the platform.
This should be the correct behaviour IMO, if I'm searching for a value and there's an exact match then it should be the first value. |
Ok, I can fix it by ordering the results by similarity and maintaining the filter by email. Additionally, we could introduce a parameter to specify which fields (such as name, email, or nickname) we want to search within. This way, we can address this specific case without affecting other scenarios. I don't like this solution, but I have no idea how to tackle it instead. |
Describe the bug
I'm trying to include a new assembly member from the administration panel (
/admin/assemblies/:slug/members/new
). As the user is registered on the platform, I choose "Existing user" on the "User type" input. Then I find the user in the "Participant or group" by email and by nickname but the results are not shown in the select. However, checking the calls I see the/admin/organization/user_entities
is returning the user.To Reproduce
Expected behavior
All the results returned by the API must be present in the selector.
Screenshots
Filtering by email the API returns one result, but it's not present in the selector.
Filtering by nickname the API returns 450 results, but only 10 of them are present in the selector.
Stacktrace
No response
Extra data
Additional context
I could only reproduce it with a production dump database.
The instance uses a custom fork for the 0.27.5 version but uses the official 0.28.0 gem from RubyGems.
The text was updated successfully, but these errors were encountered: