[AC-1078] feat: do not block client org creating (#4899)

Single org policy shouldn't not block provider from creating client organizations
This commit is contained in:
Andreas Coroiu 2023-03-08 08:28:58 +01:00 committed by GitHub
parent 720b61076a
commit c223567cae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -71,7 +71,7 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
this.formGroup?.controls?.plan?.setValue(plan);
}
private _plan = PlanType.Free;
@Input() providerId: string;
@Input() providerId?: string;
@Output() onSuccess = new EventEmitter<OnSuccessArgs>();
@Output() onCanceled = new EventEmitter<void>();
@Output() onTrialBillingSuccess = new EventEmitter();
@ -80,7 +80,7 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
selfHosted = false;
productTypes = ProductType;
formPromise: Promise<string>;
singleOrgPolicyBlock = false;
singleOrgPolicyAppliesToActiveUser = false;
isInTrialFlow = false;
discount = 0;
@ -146,7 +146,7 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
.policyAppliesToActiveUser$(PolicyType.SingleOrg)
.pipe(takeUntil(this.destroy$))
.subscribe((policyAppliesToActiveUser) => {
this.singleOrgPolicyBlock = policyAppliesToActiveUser;
this.singleOrgPolicyAppliesToActiveUser = policyAppliesToActiveUser;
});
this.loading = false;
@ -157,6 +157,10 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
this.destroy$.complete();
}
get singleOrgPolicyBlock() {
return this.singleOrgPolicyAppliesToActiveUser && this.providerId == null;
}
get createOrganization() {
return this.organizationId == null;
}