feat: allow editing user avatars#26652
Open
aslilac wants to merge 1 commit into
Open
Conversation
Add an avatar URL field to the admin edit user page for users whose login type is password or none. Identity-provider avatars are synced on login, so the field is hidden for those users and the API ignores a submitted avatar.
Docs preview📖 View docs preview for |
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.
Adds an avatar URL field to the admin Edit user page, available only for users whose login type is
passwordornone.For identity-provider login types (
github,oidc) the avatar is synced from the IdP on every login, so the field is hidden and the API ignores any submitted avatar to avoid confusing overwrites.The field reuses the same emoji picker + URL input (
IconField) already used for template, group, and organization icons.A follow-up PR will add the same control to the self-service Account settings page.
Implementation plan & decisions
Goal: Let an admin set/clear a user's avatar from the Edit user page, gated to
password/nonelogin types.Backend
avatar_urltocodersdk.UpdateUserProfileRequest.putUserProfileapplies the submitted avatar only forpassword/none; otherwise it preserves the existing (IdP-synced) value.make gen.Frontend
EditUserFormrenders anIconField("Avatar URL") when the login type allows it.EditUserPagepasses the avatar value and acanEditAvatarflag.AccountPageround-tripsavatar_urlso the shared request type doesn't wipe avatars on the self-service path.Gating is enforced in both the UI (field hidden) and the backend (submitted value ignored for IdP login types).
Tests/stories: backend
TestUpdateUserProfilecovers apply (password) and ignore (SSO);EditUserFormstories cover the shown/hidden states with interaction tests.