1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-24 16:43:27 +00:00

[PM-24284] - milestone 3 (#17230)

* first draft

# Conflicts:
#	apps/web/src/app/billing/individual/upgrade/upgrade-payment/services/upgrade-payment.service.ts
#	apps/web/src/app/billing/organizations/organization-plans.component.ts
#	libs/common/src/billing/services/subscription-pricing.service.ts
#	libs/common/src/enums/feature-flag.enum.ts

* more filtering for pricing cards

* prettier

* tests

* tests v2
This commit is contained in:
Kyle Denney
2025-11-10 11:50:49 -06:00
committed by GitHub
parent c8281a079b
commit e3acd27dec
13 changed files with 189 additions and 46 deletions

View File

@@ -1,11 +1,13 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { Component } from "@angular/core";
import { Component, OnInit } 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 { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
import { OrganizationPlansComponent } from "../../billing";
import { HeaderModule } from "../../layouts/header/header.module";
@@ -17,15 +19,27 @@ import { SharedModule } from "../../shared";
templateUrl: "create-organization.component.html",
imports: [SharedModule, OrganizationPlansComponent, HeaderModule],
})
export class CreateOrganizationComponent {
export class CreateOrganizationComponent implements OnInit {
protected secretsManager = false;
protected plan: PlanType = PlanType.Free;
protected productTier: ProductTierType = ProductTierType.Free;
constructor(private route: ActivatedRoute) {
constructor(
private route: ActivatedRoute,
private configService: ConfigService,
) {}
async ngOnInit(): Promise<void> {
const milestone3FeatureEnabled = await this.configService.getFeatureFlag(
FeatureFlag.PM26462_Milestone_3,
);
const familyPlan = milestone3FeatureEnabled
? PlanType.FamiliesAnnually
: PlanType.FamiliesAnnually2025;
this.route.queryParams.pipe(first(), takeUntilDestroyed()).subscribe((qParams) => {
if (qParams.plan === "families" || qParams.productTier == ProductTierType.Families) {
this.plan = PlanType.FamiliesAnnually;
this.plan = familyPlan;
this.productTier = ProductTierType.Families;
} else if (qParams.plan === "teams" || qParams.productTier == ProductTierType.Teams) {
this.plan = PlanType.TeamsAnnually;