mirror of
https://github.com/bitwarden/browser
synced 2026-02-18 02:19:18 +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:
@@ -15,8 +15,9 @@ import { PreValidateSponsorshipResponse } from "@bitwarden/common/admin-console/
|
||||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||
import { getUserId } from "@bitwarden/common/auth/services/account.service";
|
||||
import { PlanSponsorshipType, PlanType, ProductTierType } 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 { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||
import { ValidationService } from "@bitwarden/common/platform/abstractions/validation.service";
|
||||
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
||||
import { DialogService, ToastService } from "@bitwarden/components";
|
||||
@@ -43,7 +44,7 @@ export class FamiliesForEnterpriseSetupComponent implements OnInit, OnDestroy {
|
||||
return;
|
||||
}
|
||||
|
||||
value.plan = PlanType.FamiliesAnnually;
|
||||
value.plan = this._familyPlan;
|
||||
value.productTier = ProductTierType.Families;
|
||||
value.acceptingSponsorship = true;
|
||||
value.planSponsorshipType = PlanSponsorshipType.FamiliesForEnterprise;
|
||||
@@ -63,13 +64,14 @@ export class FamiliesForEnterpriseSetupComponent implements OnInit, OnDestroy {
|
||||
_selectedFamilyOrganizationId = "";
|
||||
|
||||
private _destroy = new Subject<void>();
|
||||
private _familyPlan: PlanType;
|
||||
formGroup = this.formBuilder.group({
|
||||
selectedFamilyOrganizationId: ["", Validators.required],
|
||||
});
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private platformUtilsService: PlatformUtilsService,
|
||||
private configService: ConfigService,
|
||||
private i18nService: I18nService,
|
||||
private route: ActivatedRoute,
|
||||
private apiService: ApiService,
|
||||
@@ -120,6 +122,13 @@ export class FamiliesForEnterpriseSetupComponent implements OnInit, OnDestroy {
|
||||
this.badToken = !this.preValidateSponsorshipResponse.isTokenValid;
|
||||
}
|
||||
|
||||
const milestone3FeatureEnabled = await this.configService.getFeatureFlag(
|
||||
FeatureFlag.PM26462_Milestone_3,
|
||||
);
|
||||
this._familyPlan = milestone3FeatureEnabled
|
||||
? PlanType.FamiliesAnnually
|
||||
: PlanType.FamiliesAnnually2025;
|
||||
|
||||
this.loading = false;
|
||||
});
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user