From c223567caef5c29d637583b370d906d47b7e0d4c Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Wed, 8 Mar 2023 08:28:58 +0100 Subject: [PATCH] [AC-1078] feat: do not block client org creating (#4899) Single org policy shouldn't not block provider from creating client organizations --- .../src/app/settings/organization-plans.component.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/web/src/app/settings/organization-plans.component.ts b/apps/web/src/app/settings/organization-plans.component.ts index 7bf5bb4733c..91db366bf43 100644 --- a/apps/web/src/app/settings/organization-plans.component.ts +++ b/apps/web/src/app/settings/organization-plans.component.ts @@ -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(); @Output() onCanceled = new EventEmitter(); @Output() onTrialBillingSuccess = new EventEmitter(); @@ -80,7 +80,7 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy { selfHosted = false; productTypes = ProductType; formPromise: Promise; - 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; }