[AC-1638] Disallow Secrets Manager for MSP-managed organizations (#6392)

* Hide Add SM component on sub page for MSPs

* Hide Add SM component on create org page for MSPs

* Use hasProvider instead of providerType
This commit is contained in:
Thomas Rittson 2023-10-13 00:56:42 +10:00 committed by GitHub
parent 84bafe5e73
commit a6b725d08a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 4 deletions

View File

@ -276,7 +276,7 @@
<!-- Secrets Manager -->
<div class="tw-my-10">
<sm-subscribe
*ngIf="planOffersSecretsManager"
*ngIf="planOffersSecretsManager && !hasProvider"
[formGroup]="formGroup.controls.secretsManager"
[selectedPlan]="selectedSecretsManagerPlan"
[upgradeOrganization]="!createOrganization"

View File

@ -148,7 +148,7 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
}
}
if (this.providerId) {
if (this.hasProvider) {
this.formGroup.controls.businessOwned.setValue(true);
this.changedOwnedBusiness();
}
@ -176,7 +176,7 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
}
get singleOrgPolicyBlock() {
return this.singleOrgPolicyAppliesToActiveUser && this.providerId == null;
return this.singleOrgPolicyAppliesToActiveUser && !this.hasProvider;
}
get createOrganization() {
@ -235,6 +235,10 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
);
}
get hasProvider() {
return this.providerId != null;
}
additionalStoragePriceMonthly(selectedPlan: PlanResponse) {
if (!selectedPlan.isAnnual) {
return selectedPlan.additionalStoragePricePerGb;
@ -540,7 +544,7 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
// Secrets Manager
this.buildSecretsManagerRequest(request);
if (this.providerId) {
if (this.hasProvider) {
const providerRequest = new ProviderOrganizationCreateRequest(
this.formGroup.controls.clientOwnerEmail.value,
request

View File

@ -115,6 +115,7 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy
this.showSecretsManagerSubscribe =
this.userOrg.canEditSubscription &&
!this.userOrg.hasProvider &&
!this.userOrg.useSecretsManager &&
!this.subscription?.cancelled &&
!this.subscriptionMarkedForCancel;