Skip to content
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

[AC-1360] Add logic to automatically populate the reseller name field #3149

Conversation

r-tome
Copy link
Contributor

@r-tome r-tome commented Aug 3, 2023

Type of change

- [ ] Bug fix
- [ ] New feature development
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [X] Other

Objective

Reseller providers were being created without a value for the Name column, just a value in the BusinessName column.
This PR addresses this by adding a new field to the Reseller creation form and by populating existing Providers Name column with the value from the BusinessName column.

image

Code changes

  • src/Admin/Models/CreateProviderModel.cs: Added a field for the Name column
  • src/Admin/Views/Providers/Create.cshtml: Added a field for the Name column
  • util/Migrator/DbScripts/2023-08-03_00_PopulateResellerNames.sql: SQL migration script to populate the Name column for existing entries with a NULL value

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

@r-tome r-tome requested a review from a team August 3, 2023 11:09
@r-tome r-tome marked this pull request as ready for review August 3, 2023 11:09
@bitwarden-bot
Copy link

bitwarden-bot commented Aug 3, 2023

Logo
Checkmarx One – Scan Summary & Details41be6338-868b-4d60-b39f-7b08dd1cd272

New Issues

Severity Issue Source File / Package Checkmarx Insight
MEDIUM CSRF /src/Api/SecretsManager/Controllers/ServiceAccountsController.cs: 60 Attack Vector

@r-tome r-tome requested a review from vvolkgang August 3, 2023 14:53
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in the DbScripts_data_migration folder because it is data migration only. And you need to coordinate with devops so they know to run it.

Copy link
Member

@eliykat eliykat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, providers are not supported on self-hosted, so EF migrations are not required.

@r-tome r-tome added the needs-qa label Aug 4, 2023
@bitwarden-devops-bot bitwarden-devops-bot temporarily deployed to EU-QA Cloud August 4, 2023 12:29 Inactive
@r-tome r-tome removed the needs-qa label Aug 4, 2023
@r-tome r-tome merged commit 222d576 into master Aug 4, 2023
44 of 45 checks passed
@r-tome r-tome deleted the AC-1360-add-logic-to-automatically-populate-the-reseller-name-field branch August 4, 2023 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants