server icon indicating copy to clipboard operation
server copied to clipboard

[SG-58] Avatar color selector

Open BrandonM-Bitwarden opened this issue 2 years ago • 4 comments

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 avatar Oct 05 '22 02:10 BrandonM-Bitwarden

@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?

differsthecat avatar Nov 08 '22 21:11 differsthecat

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.

trmartin4 avatar Nov 08 '22 22:11 trmartin4

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.

BrandonM-Bitwarden avatar Nov 09 '22 16:11 BrandonM-Bitwarden

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.

gbubemismith avatar Nov 10 '22 05:11 gbubemismith