Display avatars in user search#4939
Merged
ThiefMaster merged 5 commits intoindico:masterfrom Jun 9, 2021
Merged
Conversation
The `avatar_url` field is added to results from `/user/search` and from `/api/principals`. The modification of the second endpoint is needed because the results are used by the user search modal. The `avatar_url` always contains a valid url. If the user does not have a profile picture set, a default avatar url is returned instead.
If the user has set a profile picture, it will be displayed in the search result instead of the default result icon. This change only affects user search even though the code is shared between users and groups. Groups still use the default `resultIcon` passed to `SearchFactory`, if the `avatarURL` field of the search result does not exist.
ThiefMaster
reviewed
Jun 9, 2021
ThiefMaster
approved these changes
Jun 9, 2021
Member
ThiefMaster
left a comment
There was a problem hiding this comment.
Tested it locally and it works great! :) Just one more small naming suggestion...
pferreir
pushed a commit
to pferreir/indico
that referenced
this pull request
Oct 12, 2021
* Add `avatar_url` to user search results The `avatar_url` field is added to results from `/user/search` and from `/api/principals`. The modification of the second endpoint is needed because the results are used by the user search modal. * Show avatars in user search If the user has set a profile picture, it will be displayed in the search result instead of the default result icon. This change only affects user search even though the code is shared between users and groups. Groups still use the default `resultIcon` passed to `SearchFactory`, if the `avatarURL` field of the search result does not exist.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When searching users, instead of the default icon, avatars are displayed.
If the user does not have an avatar, the default avatar with the first letter of
the first name is used.
The group search still displays the default result icon.
Before:



After: