1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-27 05:33:59 +00:00
Files
browser/apps/web/src/app/admin-console/settings/create-organization.component.ts
Oscar Hinton 3cad691f13 Remove standalone true from ac (#15036)
Remove standalone: true from every instance since it's the default as of Angular 19.
2025-06-03 08:51:36 +10:00

49 lines
1.9 KiB
TypeScript

// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { Component } from "@angular/core";
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
import { ActivatedRoute } from "@angular/router";
import { first } from "rxjs/operators";
import { PlanType, ProductTierType, ProductType } from "@bitwarden/common/billing/enums";
import { OrganizationPlansComponent } from "../../billing";
import { HeaderModule } from "../../layouts/header/header.module";
import { SharedModule } from "../../shared";
@Component({
templateUrl: "create-organization.component.html",
imports: [SharedModule, OrganizationPlansComponent, HeaderModule],
})
export class CreateOrganizationComponent {
protected secretsManager = false;
protected plan: PlanType = PlanType.Free;
protected productTier: ProductTierType = ProductTierType.Free;
constructor(private route: ActivatedRoute) {
this.route.queryParams.pipe(first(), takeUntilDestroyed()).subscribe((qParams) => {
if (qParams.plan === "families" || qParams.productTier == ProductTierType.Families) {
this.plan = PlanType.FamiliesAnnually;
this.productTier = ProductTierType.Families;
} else if (qParams.plan === "teams" || qParams.productTier == ProductTierType.Teams) {
this.plan = PlanType.TeamsAnnually;
this.productTier = ProductTierType.Teams;
} else if (
qParams.plan === "teamsStarter" ||
qParams.productTier == ProductTierType.TeamsStarter
) {
this.plan = PlanType.TeamsStarter;
this.productTier = ProductTierType.TeamsStarter;
} else if (
qParams.plan === "enterprise" ||
qParams.productTier == ProductTierType.Enterprise
) {
this.plan = PlanType.EnterpriseAnnually;
this.productTier = ProductTierType.Enterprise;
}
this.secretsManager = qParams.product == ProductType.SecretsManager;
});
}
}