server
server copied to clipboard
[SG-58] Avatar color selector
Type of change
- [ ] Bug fix
- [X] New feature development
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other
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.
Frontend
https://github.com/bitwarden/clients/pull/3691
Code changes
~ AccountsController.cs – Added new endpoint + UpdateAvatarRequestModel.cs – Model for requests to update the avatar color. ~ ProfileResponseModel.cs – Added color property. ~ User.cs – Added EF color property. ~ User_Create.sql – Added new property. Empty by default. ~ Update_Update – Added new property. ~ Users.sql – Added new column. ~ 2022-09-20_00_AvatarColor.sql – Migration script to add new column and update the create and update user SPs and the User View.
Before you submit
- Please check for formatting errors (
dotnet format --verify-no-changes
) (required) - If making database changes - make sure you also update Entity Framework queries and/or migrations
- Please add unit tests where it makes sense to do so (encouraged but not required)
- If this change requires a documentation update - notify the documentation team
- If this change has particular deployment requirements - notify the DevOps team
@BrandonM-Bitwarden There's only one migration script here, but I think there should be more according to other recent PR's (example). Can you look into this and see if it needs to be done?
I think this Is what's missing - generating the EF migrations. I think it's definitely unclear that this is required, as it's not linked at all in the actual Migrations documentation.
I'll get a PR to contributing-docs
that adds a note.
Thanks for the heads up @differsthecat @trmartin4, I was attempting to get those created but I was getting a migration file that included a bunch of changes related to time field changes across the entire schema. I attempted to run the existing migration scripts didn't help. I'll give it a try again.
Thanks for the heads up @differsthecat @trmartin4, I was attempting to get those created but I was getting a migration file that included a bunch of changes related to time field changes across the entire schema. I attempted to run the existing migration scripts didn't help. I'll give it a try again.
When running the migration script for EF you need to include from and to in the command e.g
dotnet ef migrations script PasswordlessAuthRequestAddApprovedColumn OrganizationDomainClaim -o ./Scripts/2022-11-03_00_OrganizationDomainClaim.sql
where PasswordlessAuthRequestAddApprovedColumn
is FROM
and OrganizationDomainClaim
(new migration) is TO
.