mirror of
https://github.com/bitwarden/server
synced 2025-12-25 12:43:14 +00:00
SM-1012: Removing SM Beta (Phase 2) (#3663)
* SM-1012: Phase 2, removing SM Beta from the server (but not db) * SM-1012: Add migration for RemoveSMBetaFromOrganization * SM-1012: Dotnet format * SM-1012: Undo RemoveSMBetaFromOrganization EF migration * SM-1012: Redo RemoveSMBetaFromOrganization EF migration * SM-1012: Ran dotnet format
This commit is contained in:
@@ -213,7 +213,6 @@ public class OrganizationsController : Controller
|
||||
var organization = await GetOrganization(id, model);
|
||||
|
||||
if (organization.UseSecretsManager &&
|
||||
!organization.SecretsManagerBeta &&
|
||||
!StaticStore.GetPlan(organization.PlanType).SupportsSecretsManager)
|
||||
{
|
||||
throw new BadRequestException("Plan does not support Secrets Manager");
|
||||
@@ -363,7 +362,6 @@ public class OrganizationsController : Controller
|
||||
organization.UseTotp = model.UseTotp;
|
||||
organization.UsersGetPremium = model.UsersGetPremium;
|
||||
organization.UseSecretsManager = model.UseSecretsManager;
|
||||
organization.SecretsManagerBeta = model.SecretsManagerBeta;
|
||||
|
||||
//secrets
|
||||
organization.SmSeats = model.SmSeats;
|
||||
|
||||
@@ -70,7 +70,6 @@ public class OrganizationEditModel : OrganizationViewModel
|
||||
MaxAutoscaleSmSeats = org.MaxAutoscaleSmSeats;
|
||||
SmServiceAccounts = org.SmServiceAccounts;
|
||||
MaxAutoscaleSmServiceAccounts = org.MaxAutoscaleSmServiceAccounts;
|
||||
SecretsManagerBeta = org.SecretsManagerBeta;
|
||||
}
|
||||
|
||||
public BillingInfo BillingInfo { get; set; }
|
||||
@@ -150,8 +149,6 @@ public class OrganizationEditModel : OrganizationViewModel
|
||||
public int? SmServiceAccounts { get; set; }
|
||||
[Display(Name = "Max Autoscale Service Accounts")]
|
||||
public int? MaxAutoscaleSmServiceAccounts { get; set; }
|
||||
[Display(Name = "Secrets Manager Beta")]
|
||||
public bool SecretsManagerBeta { get; set; }
|
||||
|
||||
/**
|
||||
* Creates a Plan[] object for use in Javascript
|
||||
@@ -210,7 +207,6 @@ public class OrganizationEditModel : OrganizationViewModel
|
||||
existingOrganization.MaxAutoscaleSmSeats = MaxAutoscaleSmSeats;
|
||||
existingOrganization.SmServiceAccounts = SmServiceAccounts;
|
||||
existingOrganization.MaxAutoscaleSmServiceAccounts = MaxAutoscaleSmServiceAccounts;
|
||||
existingOrganization.SecretsManagerBeta = SecretsManagerBeta;
|
||||
return existingOrganization;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,10 +174,6 @@
|
||||
<input type="checkbox" class="form-check-input" asp-for="UseSecretsManager" disabled='@(canEditPlan ? null : "disabled")'>
|
||||
<label class="form-check-label" asp-for="UseSecretsManager"></label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" asp-for="SecretsManagerBeta" disabled='@(canEditPlan ? null : "disabled")'>
|
||||
<label class="form-check-label" asp-for="SecretsManagerBeta"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -217,7 +213,7 @@
|
||||
|
||||
@if (canViewPlan)
|
||||
{
|
||||
<div id="organization-secrets-configuration" hidden="@(!Model.UseSecretsManager || Model.SecretsManagerBeta)">
|
||||
<div id="organization-secrets-configuration" hidden="@(!Model.UseSecretsManager)">
|
||||
<h2>Secrets Manager Configuration</h2>
|
||||
<div class="row">
|
||||
<div class="col-sm">
|
||||
|
||||
@@ -46,24 +46,8 @@
|
||||
return;
|
||||
}
|
||||
|
||||
// SM beta requires SM access
|
||||
document.getElementById('@(nameof(Model.SecretsManagerBeta))').checked = false;
|
||||
clearSecretsManagerConfiguration();
|
||||
});
|
||||
|
||||
document.getElementById('@(nameof(Model.SecretsManagerBeta))').addEventListener('change', (event) => {
|
||||
document.getElementById('organization-secrets-configuration').hidden = event.target.checked;
|
||||
|
||||
if (event.target.checked) {
|
||||
// SM beta requires SM access
|
||||
document.getElementById('@(nameof(Model.UseSecretsManager))').checked = true;
|
||||
// SM Beta orgs do not have subscription limits
|
||||
clearSecretsManagerConfiguration();
|
||||
return;
|
||||
}
|
||||
|
||||
setInitialSecretsManagerConfiguration();
|
||||
});
|
||||
})();
|
||||
|
||||
function togglePlanFeatures(planType) {
|
||||
|
||||
Reference in New Issue
Block a user