diff --git a/apps/web/src/app/admin-console/organizations/guards/is-enterprise-org.guard.ts b/apps/web/src/app/admin-console/organizations/guards/is-enterprise-org.guard.ts index 8e35c60db9..605ce0059d 100644 --- a/apps/web/src/app/admin-console/organizations/guards/is-enterprise-org.guard.ts +++ b/apps/web/src/app/admin-console/organizations/guards/is-enterprise-org.guard.ts @@ -56,7 +56,7 @@ export class IsEnterpriseOrgGuard implements CanActivate { }); if (upgradeConfirmed) { await this.router.navigate(["organizations", org.id, "billing", "subscription"], { - queryParams: { upgrade: true }, + queryParams: { upgrade: true, productTierType: ProductTierType.Enterprise }, }); } } diff --git a/apps/web/src/app/billing/organizations/change-plan.component.html b/apps/web/src/app/billing/organizations/change-plan.component.html index a25dde4fd3..75a12122d1 100644 --- a/apps/web/src/app/billing/organizations/change-plan.component.html +++ b/apps/web/src/app/billing/organizations/change-plan.component.html @@ -18,6 +18,7 @@ [showCancel]="true" [organizationId]="organizationId" [currentPlan]="currentPlan" + [preSelectedProductTier]="preSelectedProductTier" (onCanceled)="cancel()" > diff --git a/apps/web/src/app/billing/organizations/change-plan.component.ts b/apps/web/src/app/billing/organizations/change-plan.component.ts index a131e344b7..51cdbba557 100644 --- a/apps/web/src/app/billing/organizations/change-plan.component.ts +++ b/apps/web/src/app/billing/organizations/change-plan.component.ts @@ -1,5 +1,6 @@ import { Component, EventEmitter, Input, Output } from "@angular/core"; +import { ProductTierType } from "@bitwarden/common/billing/enums"; import { PlanResponse } from "@bitwarden/common/billing/models/response/plan.response"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; @@ -10,6 +11,7 @@ import { LogService } from "@bitwarden/common/platform/abstractions/log.service" export class ChangePlanComponent { @Input() organizationId: string; @Input() currentPlan: PlanResponse; + @Input() preSelectedProductTier: ProductTierType; @Output() onChanged = new EventEmitter(); @Output() onCanceled = new EventEmitter(); diff --git a/apps/web/src/app/billing/organizations/organization-plans.component.ts b/apps/web/src/app/billing/organizations/organization-plans.component.ts index 661b896913..4f8fbea94d 100644 --- a/apps/web/src/app/billing/organizations/organization-plans.component.ts +++ b/apps/web/src/app/billing/organizations/organization-plans.component.ts @@ -95,6 +95,7 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy { private _plan = PlanType.Free; @Input() providerId?: string; + @Input() preSelectedProductTier?: ProductTierType; @Output() onSuccess = new EventEmitter(); @Output() onCanceled = new EventEmitter(); @Output() onTrialBillingSuccess = new EventEmitter(); @@ -209,6 +210,9 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy { this.singleOrgPolicyAppliesToActiveUser = policyAppliesToActiveUser; }); + if (this.preSelectedProductTier != null && this.productTier < this.preSelectedProductTier) { + this.productTier = this.preSelectedProductTier; + } if (!this.selfHosted) { this.changedProduct(); } diff --git a/apps/web/src/app/billing/organizations/organization-subscription-cloud.component.html b/apps/web/src/app/billing/organizations/organization-subscription-cloud.component.html index e519b8887b..72a0a40080 100644 --- a/apps/web/src/app/billing/organizations/organization-subscription-cloud.component.html +++ b/apps/web/src/app/billing/organizations/organization-subscription-cloud.component.html @@ -122,6 +122,7 @@