1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-23 11:43:46 +00:00

[PM-8830] Billing Enums Rename (#9612)

* Renamed ProductType to ProductTierType

* Renamed Product properties to ProductTier

* Moved product-tier-type.enum.ts to billing folder

* Added ProductType enum
This commit is contained in:
Conner Turnbull
2024-06-14 15:43:40 -04:00
committed by GitHub
parent e521d702ba
commit f484dd491b
31 changed files with 164 additions and 157 deletions

View File

@@ -17,7 +17,7 @@ import { TwoFactorYubiKeyResponse } from "@bitwarden/common/auth/models/response
import { TwoFactorProviders } from "@bitwarden/common/auth/services/two-factor.service";
import { AuthResponse } from "@bitwarden/common/auth/types/auth-response";
import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions/account/billing-account-profile-state.service";
import { ProductType } from "@bitwarden/common/enums";
import { ProductTierType } from "@bitwarden/common/billing/enums";
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
import { DialogService } from "@bitwarden/components";
@@ -258,6 +258,6 @@ export class TwoFactorSetupComponent implements OnInit, OnDestroy {
}
get isEnterpriseOrg() {
return this.organization?.planProductType === ProductType.Enterprise;
return this.organization?.productTierType === ProductTierType.Enterprise;
}
}

View File

@@ -1,6 +1,6 @@
import { Component, Input, ViewChild } from "@angular/core";
import { ProductType } from "@bitwarden/common/enums";
import { ProductTierType } from "@bitwarden/common/billing/enums";
import {
OrganizationCreatedEvent,
@@ -33,22 +33,22 @@ export class SecretsManagerTrialPaidStepperComponent extends SecretsManagerTrial
get createAccountLabel() {
const organizationType =
this.productType === ProductType.TeamsStarter
this.productType === ProductTierType.TeamsStarter
? "Teams Starter"
: ProductType[this.productType];
: ProductTierType[this.productType];
return `Before creating your ${organizationType} organization, you first need to log in or create a personal account.`;
}
get productType(): TrialOrganizationType {
switch (this.organizationTypeQueryParameter) {
case "enterprise":
return ProductType.Enterprise;
return ProductTierType.Enterprise;
case "families":
return ProductType.Families;
return ProductTierType.Families;
case "teams":
return ProductType.Teams;
return ProductTierType.Teams;
case "teamsStarter":
return ProductType.TeamsStarter;
return ProductTierType.TeamsStarter;
}
}

View File

@@ -9,8 +9,7 @@ import { PolicyApiServiceAbstraction } from "@bitwarden/common/admin-console/abs
import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
import { MasterPasswordPolicyOptions } from "@bitwarden/common/admin-console/models/domain/master-password-policy-options";
import { Policy } from "@bitwarden/common/admin-console/models/domain/policy";
import { PlanType } from "@bitwarden/common/billing/enums";
import { ProductType } from "@bitwarden/common/enums";
import { PlanType, ProductTierType } from "@bitwarden/common/billing/enums";
import { ReferenceEventRequest } from "@bitwarden/common/models/request/reference-event.request";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
@@ -67,7 +66,7 @@ export class TrialInitiationComponent implements OnInit, OnDestroy {
billingSubLabel = "";
layout = "default";
plan: PlanType;
product: ProductType;
productTier: ProductTierType;
accountCreateOnly = true;
useTrialStepper = false;
policies: Policy[];
@@ -153,16 +152,16 @@ export class TrialInitiationComponent implements OnInit, OnDestroy {
if (this.org === ValidOrgParams.families) {
this.plan = PlanType.FamiliesAnnually;
this.product = ProductType.Families;
this.productTier = ProductTierType.Families;
} else if (this.org === ValidOrgParams.teamsStarter) {
this.plan = PlanType.TeamsStarter;
this.product = ProductType.TeamsStarter;
this.productTier = ProductTierType.TeamsStarter;
} else if (this.org === ValidOrgParams.teams) {
this.plan = PlanType.TeamsAnnually;
this.product = ProductType.Teams;
this.productTier = ProductTierType.Teams;
} else if (this.org === ValidOrgParams.enterprise) {
this.plan = PlanType.EnterpriseAnnually;
this.product = ProductType.Enterprise;
this.productTier = ProductTierType.Enterprise;
}
} else if (this.routeFlowOrgs.includes(qParams.org)) {
this.referenceData.flow = qParams.org;
@@ -268,11 +267,11 @@ export class TrialInitiationComponent implements OnInit, OnDestroy {
}
get trialOrganizationType(): TrialOrganizationType {
switch (this.product) {
case ProductType.Free:
switch (this.productTier) {
case ProductTierType.Free:
return null;
default:
return this.product;
return this.productTier;
}
}