-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[SG-58] Avatar color selector #3691
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not seeing this change here, but can you update the OrganizationNameBadgeComponent
to use the color selected by the user?
I skimmed the PR, since I've migrated the old avatars to the new component library component. Some things to consider:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a failing build on CLI because of the addition of avatar service to sync service; I'd try setting the value in state service instead of injecting the avatar service here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @BrandonM-Bitwarden !
Relevant blockers have been resolved. Thanks.
* SG-920 + SG-921 * Update change-avatar.component.html * Update selectable-avatar.component.ts
… the Account Settings menu (#4359) * SG-926 * fix: comment * fix: undo * fix: imp
Approving this to be PRed into |
* changes * merge * undo * work * stuffs * chore: added custom color picker * oops * chore: everything but the broken sink * picker v2 * fix: cleanup * fix: linty * fix: use tailwind * fix: use tailwind * undo: merge error * remove: old color picker * fix: merge issue * chore: use input vs component * fix: move logic out! * fix: revert changes to bit-avatar * fix: cleanup undos * feat: color lookup for "me" badge in vault * fix: naming stuff * fix: event emitter * fix: linty * fix: protect * fix: remove v1 states work: navatar * fix: big * fix: messages merge issue * bug: differing bg colors for generated components * feat: added sync stuff * fix: cli * fix: remove service refs, use state * fix: moved from EventEmitter to Subjects * fix: srs * fix: strict stuff is nice tbh * SG-920 + SG-921 (#4342) * SG-920 + SG-921 * Update change-avatar.component.html * Update selectable-avatar.component.ts * [SG-926] [SG-58] [Defect] - Selected Avatar color does not persist in the Account Settings menu (#4359) * SG-926 * fix: comment * fix: undo * fix: imp * work: done with static values (#4272) * [SG-35] (#4361) Co-authored-by: Todd Martin <[email protected]>
* changes * merge * undo * work * stuffs * chore: added custom color picker * oops * chore: everything but the broken sink * picker v2 * fix: cleanup * fix: linty * fix: use tailwind * fix: use tailwind * undo: merge error * remove: old color picker * fix: merge issue * chore: use input vs component * fix: move logic out! * fix: revert changes to bit-avatar * fix: cleanup undos * feat: color lookup for "me" badge in vault * fix: naming stuff * fix: event emitter * fix: linty * fix: protect * fix: remove v1 states work: navatar * fix: big * fix: messages merge issue * bug: differing bg colors for generated components * feat: added sync stuff * fix: cli * fix: remove service refs, use state * fix: moved from EventEmitter to Subjects * fix: srs * fix: strict stuff is nice tbh * SG-920 + SG-921 (#4342) * SG-920 + SG-921 * Update change-avatar.component.html * Update selectable-avatar.component.ts * [SG-926] [SG-58] [Defect] - Selected Avatar color does not persist in the Account Settings menu (#4359) * SG-926 * fix: comment * fix: undo * fix: imp * work: done with static values (#4272) * [SG-35] (#4361) Co-authored-by: Todd Martin <[email protected]>
* changes * merge * undo * work * stuffs * chore: added custom color picker * oops * chore: everything but the broken sink * picker v2 * fix: cleanup * fix: linty * fix: use tailwind * fix: use tailwind * undo: merge error * remove: old color picker * fix: merge issue * chore: use input vs component * fix: move logic out! * fix: revert changes to bit-avatar * fix: cleanup undos * feat: color lookup for "me" badge in vault * fix: naming stuff * fix: event emitter * fix: linty * fix: protect * fix: remove v1 states work: navatar * fix: big * fix: messages merge issue * bug: differing bg colors for generated components * feat: added sync stuff * fix: cli * fix: remove service refs, use state * fix: moved from EventEmitter to Subjects * fix: srs * fix: strict stuff is nice tbh * SG-920 + SG-921 (#4342) * SG-920 + SG-921 * Update change-avatar.component.html * Update selectable-avatar.component.ts * [SG-926] [SG-58] [Defect] - Selected Avatar color does not persist in the Account Settings menu (#4359) * SG-926 * fix: comment * fix: undo * fix: imp * work: done with static values (#4272) * [SG-35] (#4361) Co-authored-by: Todd Martin <[email protected]>
Type of change
Objective
We want to add the ability for users to select the avatar color that will represent an account in the header of the app, so that they can better distinguish between accounts with similar or the same initials.
Code changes
Backend: bitwarden/server#2330
+ dynamic-avatar.component – A component that encapsulates the bit-avatar component and listens for changes in the avatar color values via the AvatarService.
+ selectable-avatar.component – A component that encapsulates the bit-avatar component and reacts to click events by toggling their selection state and firing events.
~ navbar.comonent – Changed bit-avatar to dynamic-avatar so it can react to changes.
+ change-avatar.component – The components that gets put into a modal and allows users to pick avatar colors as needed.
~ profile.component - Changed bit-avatar to dynamic-avatar so it can react to changes and added a button to open the change-avatar modal.
~ loose-components.module – Added needed component references.
~ organization-name-badge.component – Made color rely on a state lookup and fallback to default.
~ messages.json – language stuff.
~ jslib-services.module – Added new services references.
+ avatar-update.service – Added service that handles loading and saving colors from state and api along with emitting events.
~ api.service – Added new avatar color API endpoints.
~ state.service – Added new avatar color state endpoints.
~ utils.ts – Added RegEx Validator for hex colors.
~ account.ts – Added color property.
+ update-avatar.request – Added request body model for API endpoint save call.
~ profile.response – Added color property.
~ avatar.component – Added more sizes and title input.
Screenshots
Button to open modal
Avatar change modal
Custom color picker
Avatar colors
Colors used elsewhere!
Before you submit