[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:
parent
e521d702ba
commit
f484dd491b
|
@ -57,12 +57,12 @@
|
|||
>
|
||||
<div class="vault-select-org-text-container">
|
||||
<i
|
||||
*ngIf="organization.planProductType !== 1"
|
||||
*ngIf="organization.productTierType !== 1"
|
||||
class="bwi bwi-fw bwi-business vault-select-prefix-icon"
|
||||
aria-hidden="true"
|
||||
></i>
|
||||
<i
|
||||
*ngIf="organization.planProductType === 1"
|
||||
*ngIf="organization.productTierType === 1"
|
||||
class="bwi bwi-fw bwi-family vault-select-prefix-icon"
|
||||
aria-hidden="true"
|
||||
></i>
|
||||
|
|
|
@ -5,7 +5,7 @@ import { BehaviorSubject } from "rxjs";
|
|||
import { SearchService } from "@bitwarden/common/abstractions/search.service";
|
||||
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
||||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||
import { ProductType } from "@bitwarden/common/enums";
|
||||
import { ProductTierType } from "@bitwarden/common/billing/enums";
|
||||
import { ObservableTracker } from "@bitwarden/common/spec";
|
||||
import { CipherId } from "@bitwarden/common/types/guid";
|
||||
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
||||
|
@ -78,7 +78,7 @@ describe("VaultPopupItemsService", () => {
|
|||
mockOrg = {
|
||||
id: "org1",
|
||||
name: "Organization 1",
|
||||
planProductType: ProductType.Enterprise,
|
||||
productTierType: ProductTierType.Enterprise,
|
||||
} as Organization;
|
||||
|
||||
mockCollections = [
|
||||
|
|
|
@ -6,7 +6,7 @@ import { OrganizationService } from "@bitwarden/common/admin-console/abstraction
|
|||
import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
|
||||
import { PolicyType } from "@bitwarden/common/admin-console/enums";
|
||||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||
import { ProductType } from "@bitwarden/common/enums";
|
||||
import { ProductTierType } from "@bitwarden/common/billing/enums";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
||||
import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service";
|
||||
|
@ -206,7 +206,7 @@ describe("VaultPopupListFiltersService", () => {
|
|||
name: "family org",
|
||||
id: "1234-3323-23223",
|
||||
enabled: true,
|
||||
planProductType: ProductType.Families,
|
||||
productTierType: ProductTierType.Families,
|
||||
},
|
||||
] as Organization[];
|
||||
|
||||
|
@ -224,7 +224,7 @@ describe("VaultPopupListFiltersService", () => {
|
|||
name: "free org",
|
||||
id: "1234-3323-23223",
|
||||
enabled: true,
|
||||
planProductType: ProductType.Free,
|
||||
productTierType: ProductTierType.Free,
|
||||
},
|
||||
] as Organization[];
|
||||
|
||||
|
@ -242,7 +242,7 @@ describe("VaultPopupListFiltersService", () => {
|
|||
name: "free org",
|
||||
id: "1234-3323-23223",
|
||||
enabled: false,
|
||||
planProductType: ProductType.Free,
|
||||
productTierType: ProductTierType.Free,
|
||||
},
|
||||
] as Organization[];
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ import { OrganizationService } from "@bitwarden/common/admin-console/abstraction
|
|||
import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
|
||||
import { PolicyType } from "@bitwarden/common/admin-console/enums";
|
||||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||
import { ProductType } from "@bitwarden/common/enums";
|
||||
import { ProductTierType } from "@bitwarden/common/billing/enums";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
||||
|
@ -216,8 +216,8 @@ export class VaultPopupListFiltersService {
|
|||
// Show a warning icon if the organization is deactivated
|
||||
icon = "bwi-exclamation-triangle tw-text-danger";
|
||||
} else if (
|
||||
org.planProductType === ProductType.Families ||
|
||||
org.planProductType === ProductType.Free
|
||||
org.productTierType === ProductTierType.Families ||
|
||||
org.productTierType === ProductTierType.Free
|
||||
) {
|
||||
// Show a family icon if the organization is a family or free org
|
||||
icon = "bwi-family";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||
import { ProductType } from "@bitwarden/common/enums";
|
||||
import { ProductTierType } from "@bitwarden/common/billing/enums";
|
||||
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
||||
import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view";
|
||||
|
||||
|
@ -26,13 +26,13 @@ export class PopupCipherView extends CipherView {
|
|||
* Get the bwi icon for the cipher according to the organization type.
|
||||
*/
|
||||
get orgIcon(): "bwi-family" | "bwi-business" | null {
|
||||
switch (this.organization?.planProductType) {
|
||||
case ProductType.Free:
|
||||
case ProductType.Families:
|
||||
switch (this.organization?.productTierType) {
|
||||
case ProductTierType.Free:
|
||||
case ProductTierType.Families:
|
||||
return "bwi-family";
|
||||
case ProductType.Teams:
|
||||
case ProductType.Enterprise:
|
||||
case ProductType.TeamsStarter:
|
||||
case ProductTierType.Teams:
|
||||
case ProductTierType.Enterprise:
|
||||
case ProductTierType.TeamsStarter:
|
||||
return "bwi-business";
|
||||
default:
|
||||
return null;
|
||||
|
|
|
@ -28,7 +28,8 @@
|
|||
<input id="emails" type="text" appAutoFocus bitInput formControlName="emails" />
|
||||
<bit-hint>{{
|
||||
"inviteMultipleEmailDesc"
|
||||
| i18n: (organization.planProductType === ProductType.TeamsStarter ? "10" : "20")
|
||||
| i18n
|
||||
: (organization.productTierType === ProductTierType.TeamsStarter ? "10" : "20")
|
||||
}}</bit-hint>
|
||||
</bit-form-field>
|
||||
</ng-container>
|
||||
|
|
|
@ -22,7 +22,7 @@ import {
|
|||
import { PermissionsApi } from "@bitwarden/common/admin-console/models/api/permissions.api";
|
||||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||
import { ProductType } from "@bitwarden/common/enums";
|
||||
import { 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";
|
||||
|
@ -463,7 +463,8 @@ export class MemberDialogComponent implements OnDestroy {
|
|||
await this.userService.save(userView);
|
||||
} else {
|
||||
userView.id = this.params.organizationUserId;
|
||||
const maxEmailsCount = organization.planProductType === ProductType.TeamsStarter ? 10 : 20;
|
||||
const maxEmailsCount =
|
||||
organization.productTierType === ProductTierType.TeamsStarter ? 10 : 20;
|
||||
const emails = [...new Set(this.formGroup.value.emails.trim().split(/\s*,\s*/))];
|
||||
if (emails.length > maxEmailsCount) {
|
||||
this.formGroup.controls.emails.setErrors({
|
||||
|
@ -614,7 +615,7 @@ export class MemberDialogComponent implements OnDestroy {
|
|||
});
|
||||
}
|
||||
|
||||
protected readonly ProductType = ProductType;
|
||||
protected readonly ProductTierType = ProductTierType;
|
||||
}
|
||||
|
||||
function mapCollectionToAccessItemView(
|
||||
|
|
|
@ -2,7 +2,7 @@ import { AbstractControl, FormControl, ValidationErrors } from "@angular/forms";
|
|||
|
||||
import { OrganizationUserType } from "@bitwarden/common/admin-console/enums";
|
||||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||
import { ProductType } from "@bitwarden/common/enums";
|
||||
import { ProductTierType } from "@bitwarden/common/billing/enums";
|
||||
|
||||
import { orgSeatLimitReachedValidator } from "./org-seat-limit-reached.validator";
|
||||
|
||||
|
@ -54,7 +54,7 @@ describe("orgSeatLimitReachedValidator", () => {
|
|||
|
||||
it("should return null when max seats are not exceeded on free plan", () => {
|
||||
organization = orgFactory({
|
||||
planProductType: ProductType.Free,
|
||||
productTierType: ProductTierType.Free,
|
||||
seats: 2,
|
||||
});
|
||||
validatorFn = orgSeatLimitReachedValidator(
|
||||
|
@ -71,7 +71,7 @@ describe("orgSeatLimitReachedValidator", () => {
|
|||
|
||||
it("should return null when max seats are not exceeded on teams starter plan", () => {
|
||||
organization = orgFactory({
|
||||
planProductType: ProductType.TeamsStarter,
|
||||
productTierType: ProductTierType.TeamsStarter,
|
||||
seats: 10,
|
||||
});
|
||||
validatorFn = orgSeatLimitReachedValidator(
|
||||
|
@ -98,7 +98,7 @@ describe("orgSeatLimitReachedValidator", () => {
|
|||
|
||||
it("should return validation error when max seats are exceeded on free plan", () => {
|
||||
organization = orgFactory({
|
||||
planProductType: ProductType.Free,
|
||||
productTierType: ProductTierType.Free,
|
||||
seats: 2,
|
||||
});
|
||||
const errorMessage = "You cannot invite more than 2 members without upgrading your plan.";
|
||||
|
@ -117,7 +117,7 @@ describe("orgSeatLimitReachedValidator", () => {
|
|||
it("should return null when not on free plan", () => {
|
||||
const control = new FormControl("user2@example.com,user3@example.com");
|
||||
organization = orgFactory({
|
||||
planProductType: ProductType.Enterprise,
|
||||
productTierType: ProductTierType.Enterprise,
|
||||
seats: 100,
|
||||
});
|
||||
validatorFn = orgSeatLimitReachedValidator(
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { AbstractControl, ValidationErrors, ValidatorFn } from "@angular/forms";
|
||||
|
||||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||
import { ProductType } from "@bitwarden/common/enums";
|
||||
import { ProductTierType } from "@bitwarden/common/billing/enums";
|
||||
|
||||
/**
|
||||
* If the organization doesn't allow additional seat options, this checks if the seat limit has been reached when adding
|
||||
|
@ -37,9 +37,9 @@ export function orgSeatLimitReachedValidator(
|
|||
);
|
||||
|
||||
const productHasAdditionalSeatsOption =
|
||||
organization.planProductType !== ProductType.Free &&
|
||||
organization.planProductType !== ProductType.Families &&
|
||||
organization.planProductType !== ProductType.TeamsStarter;
|
||||
organization.productTierType !== ProductTierType.Free &&
|
||||
organization.productTierType !== ProductTierType.Families &&
|
||||
organization.productTierType !== ProductTierType.TeamsStarter;
|
||||
|
||||
return !productHasAdditionalSeatsOption &&
|
||||
allOrganizationUserEmails.length + newEmailsToAdd.length > organization.seats
|
||||
|
|
|
@ -33,7 +33,7 @@ import { Organization } from "@bitwarden/common/admin-console/models/domain/orga
|
|||
import { Policy } from "@bitwarden/common/admin-console/models/domain/policy";
|
||||
import { OrganizationKeysRequest } from "@bitwarden/common/admin-console/models/request/organization-keys.request";
|
||||
import { BillingApiServiceAbstraction } from "@bitwarden/common/billing/abstractions/billilng-api.service.abstraction";
|
||||
import { ProductType } from "@bitwarden/common/enums";
|
||||
import { ProductTierType } from "@bitwarden/common/billing/enums";
|
||||
import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||
|
@ -335,13 +335,13 @@ export class PeopleComponent extends NewBasePeopleComponent<OrganizationUserView
|
|||
return this.organization.canEditSubscription ? "ManageBilling" : "NoManageBilling";
|
||||
}
|
||||
|
||||
private getProductKey(productType: ProductType): string {
|
||||
private getProductKey(productType: ProductTierType): string {
|
||||
let product = "";
|
||||
switch (productType) {
|
||||
case ProductType.Free:
|
||||
case ProductTierType.Free:
|
||||
product = "freeOrg";
|
||||
break;
|
||||
case ProductType.TeamsStarter:
|
||||
case ProductTierType.TeamsStarter:
|
||||
product = "teamsStarterPlan";
|
||||
break;
|
||||
default:
|
||||
|
@ -352,7 +352,7 @@ export class PeopleComponent extends NewBasePeopleComponent<OrganizationUserView
|
|||
|
||||
private getDialogContent(): string {
|
||||
return this.i18nService.t(
|
||||
this.getProductKey(this.organization.planProductType),
|
||||
this.getProductKey(this.organization.productTierType),
|
||||
this.organization.seats,
|
||||
);
|
||||
}
|
||||
|
@ -362,9 +362,9 @@ export class PeopleComponent extends NewBasePeopleComponent<OrganizationUserView
|
|||
return this.i18nService.t("ok");
|
||||
}
|
||||
|
||||
const productType = this.organization.planProductType;
|
||||
const productType = this.organization.productTierType;
|
||||
|
||||
if (productType !== ProductType.Free && productType !== ProductType.TeamsStarter) {
|
||||
if (productType !== ProductTierType.Free && productType !== ProductTierType.TeamsStarter) {
|
||||
throw new Error(`Unsupported product type: ${productType}`);
|
||||
}
|
||||
|
||||
|
@ -376,10 +376,10 @@ export class PeopleComponent extends NewBasePeopleComponent<OrganizationUserView
|
|||
return;
|
||||
}
|
||||
|
||||
const productType = this.organization.planProductType;
|
||||
const productType = this.organization.productTierType;
|
||||
|
||||
if (productType !== ProductType.Free && productType !== ProductType.TeamsStarter) {
|
||||
throw new Error(`Unsupported product type: ${this.organization.planProductType}`);
|
||||
if (productType !== ProductTierType.Free && productType !== ProductTierType.TeamsStarter) {
|
||||
throw new Error(`Unsupported product type: ${this.organization.productTierType}`);
|
||||
}
|
||||
|
||||
await this.router.navigate(
|
||||
|
@ -423,8 +423,8 @@ export class PeopleComponent extends NewBasePeopleComponent<OrganizationUserView
|
|||
if (
|
||||
!user &&
|
||||
this.allUsers.length === this.organization.seats &&
|
||||
(this.organization.planProductType === ProductType.Free ||
|
||||
this.organization.planProductType === ProductType.TeamsStarter)
|
||||
(this.organization.productTierType === ProductTierType.Free ||
|
||||
this.organization.productTierType === ProductTierType.TeamsStarter)
|
||||
) {
|
||||
// Show org upgrade modal
|
||||
await this.showSeatLimitReachedDialog();
|
||||
|
|
|
@ -8,8 +8,7 @@ import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
|||
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
||||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||
import { OrganizationSponsorshipRedeemRequest } from "@bitwarden/common/admin-console/models/request/organization/organization-sponsorship-redeem.request";
|
||||
import { PlanSponsorshipType, PlanType } from "@bitwarden/common/billing/enums";
|
||||
import { ProductType } from "@bitwarden/common/enums";
|
||||
import { PlanSponsorshipType, PlanType, ProductTierType } from "@bitwarden/common/billing/enums";
|
||||
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";
|
||||
|
@ -36,7 +35,7 @@ export class FamiliesForEnterpriseSetupComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
|
||||
value.plan = PlanType.FamiliesAnnually;
|
||||
value.product = ProductType.Families;
|
||||
value.productTier = ProductTierType.Families;
|
||||
value.acceptingSponsorship = true;
|
||||
// eslint-disable-next-line rxjs-angular/prefer-takeuntil
|
||||
value.onSuccess.subscribe(this.onOrganizationCreateSuccess.bind(this));
|
||||
|
@ -96,7 +95,7 @@ export class FamiliesForEnterpriseSetupComponent implements OnInit, OnDestroy {
|
|||
});
|
||||
|
||||
this.existingFamilyOrganizations$ = this.organizationService.organizations$.pipe(
|
||||
map((orgs) => orgs.filter((o) => o.planProductType === ProductType.Families)),
|
||||
map((orgs) => orgs.filter((o) => o.productTierType === ProductTierType.Families)),
|
||||
);
|
||||
|
||||
this.existingFamilyOrganizations$.pipe(takeUntil(this._destroy)).subscribe((orgs) => {
|
||||
|
|
|
@ -2,8 +2,7 @@ import { Component, OnInit, ViewChild } from "@angular/core";
|
|||
import { ActivatedRoute } from "@angular/router";
|
||||
import { first } from "rxjs/operators";
|
||||
|
||||
import { PlanType } from "@bitwarden/common/billing/enums";
|
||||
import { ProductType } from "@bitwarden/common/enums";
|
||||
import { PlanType, ProductTierType } from "@bitwarden/common/billing/enums";
|
||||
|
||||
import { OrganizationPlansComponent } from "../../billing";
|
||||
import { HeaderModule } from "../../layouts/header/header.module";
|
||||
|
@ -26,16 +25,16 @@ export class CreateOrganizationComponent implements OnInit {
|
|||
this.route.queryParams.pipe(first()).subscribe(async (qParams) => {
|
||||
if (qParams.plan === "families") {
|
||||
this.orgPlansComponent.plan = PlanType.FamiliesAnnually;
|
||||
this.orgPlansComponent.product = ProductType.Families;
|
||||
this.orgPlansComponent.productTier = ProductTierType.Families;
|
||||
} else if (qParams.plan === "teams") {
|
||||
this.orgPlansComponent.plan = PlanType.TeamsAnnually;
|
||||
this.orgPlansComponent.product = ProductType.Teams;
|
||||
this.orgPlansComponent.productTier = ProductTierType.Teams;
|
||||
} else if (qParams.plan === "teamsStarter") {
|
||||
this.orgPlansComponent.plan = PlanType.TeamsStarter;
|
||||
this.orgPlansComponent.product = ProductType.TeamsStarter;
|
||||
this.orgPlansComponent.productTier = ProductTierType.TeamsStarter;
|
||||
} else if (qParams.plan === "enterprise") {
|
||||
this.orgPlansComponent.plan = PlanType.EnterpriseAnnually;
|
||||
this.orgPlansComponent.product = ProductType.Enterprise;
|
||||
this.orgPlansComponent.productTier = ProductTierType.Enterprise;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,16 +9,15 @@ import {
|
|||
PaymentInformation,
|
||||
PlanInformation,
|
||||
} from "@bitwarden/common/billing/abstractions/organization-billing.service";
|
||||
import { PaymentMethodType, PlanType } from "@bitwarden/common/billing/enums";
|
||||
import { PaymentMethodType, PlanType, ProductTierType } from "@bitwarden/common/billing/enums";
|
||||
import { PlanResponse } from "@bitwarden/common/billing/models/response/plan.response";
|
||||
import { ProductType } from "@bitwarden/common/enums";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
|
||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||
|
||||
import { BillingSharedModule, PaymentComponent, TaxInfoComponent } from "../../shared";
|
||||
|
||||
export type TrialOrganizationType = Exclude<ProductType, ProductType.Free>;
|
||||
export type TrialOrganizationType = Exclude<ProductTierType, ProductTierType.Free>;
|
||||
|
||||
export interface OrganizationInfo {
|
||||
name: string;
|
||||
|
@ -176,19 +175,19 @@ export class TrialBillingStepComponent implements OnInit {
|
|||
[cadence in SubscriptionCadence]?: PlanType;
|
||||
};
|
||||
} = {
|
||||
[ProductType.Enterprise]: {
|
||||
[ProductTierType.Enterprise]: {
|
||||
[SubscriptionCadence.Annual]: PlanType.EnterpriseAnnually,
|
||||
[SubscriptionCadence.Monthly]: PlanType.EnterpriseMonthly,
|
||||
},
|
||||
[ProductType.Families]: {
|
||||
[ProductTierType.Families]: {
|
||||
[SubscriptionCadence.Annual]: PlanType.FamiliesAnnually,
|
||||
// No monthly option for Families plan
|
||||
},
|
||||
[ProductType.Teams]: {
|
||||
[ProductTierType.Teams]: {
|
||||
[SubscriptionCadence.Annual]: PlanType.TeamsAnnually,
|
||||
[SubscriptionCadence.Monthly]: PlanType.TeamsMonthly,
|
||||
},
|
||||
[ProductType.TeamsStarter]: {
|
||||
[ProductTierType.TeamsStarter]: {
|
||||
// No annual option for Teams Starter plan
|
||||
[SubscriptionCadence.Monthly]: PlanType.TeamsStarter,
|
||||
},
|
||||
|
@ -233,10 +232,10 @@ export class TrialBillingStepComponent implements OnInit {
|
|||
|
||||
private isApplicable(plan: PlanResponse): boolean {
|
||||
const hasCorrectProductType =
|
||||
plan.product === ProductType.Enterprise ||
|
||||
plan.product === ProductType.Families ||
|
||||
plan.product === ProductType.Teams ||
|
||||
plan.product === ProductType.TeamsStarter;
|
||||
plan.productTier === ProductTierType.Enterprise ||
|
||||
plan.productTier === ProductTierType.Families ||
|
||||
plan.productTier === ProductTierType.Teams ||
|
||||
plan.productTier === ProductTierType.TeamsStarter;
|
||||
const notDisabledOrLegacy = !plan.disabled && !plan.legacyYear;
|
||||
return hasCorrectProductType && notDisabledOrLegacy;
|
||||
}
|
||||
|
|
|
@ -51,14 +51,17 @@
|
|||
</bit-section>
|
||||
<bit-section>
|
||||
<h2 bitTypography="h2">{{ "chooseYourPlan" | i18n }}</h2>
|
||||
<bit-radio-group formControlName="product" [block]="true">
|
||||
<bit-radio-group formControlName="productTier" [block]="true">
|
||||
<div *ngFor="let selectableProduct of selectableProducts" class="tw-mb-3">
|
||||
<bit-radio-button [value]="selectableProduct.product" (change)="changedProduct()">
|
||||
<bit-radio-button [value]="selectableProduct.productTier" (change)="changedProduct()">
|
||||
<bit-label>{{ selectableProduct.nameLocalizationKey | i18n }}</bit-label>
|
||||
<bit-hint class="tw-text-sm"
|
||||
>{{ selectableProduct.descriptionLocalizationKey | i18n: "1" }}
|
||||
<ng-container
|
||||
*ngIf="selectableProduct.product === productTypes.Enterprise; else nonEnterprisePlans"
|
||||
*ngIf="
|
||||
selectableProduct.productTier === productTypes.Enterprise;
|
||||
else nonEnterprisePlans
|
||||
"
|
||||
>
|
||||
<ul class="tw-pl-0 tw-list-inside tw-mb-0">
|
||||
<li>{{ "includeAllTeamsFeatures" | i18n }}</li>
|
||||
|
@ -75,7 +78,8 @@
|
|||
<ng-template #nonEnterprisePlans>
|
||||
<ng-container
|
||||
*ngIf="
|
||||
selectableProduct.product === productTypes.Teams && teamsStarterPlanIsAvailable;
|
||||
selectableProduct.productTier === productTypes.Teams &&
|
||||
teamsStarterPlanIsAvailable;
|
||||
else fullFeatureList
|
||||
"
|
||||
>
|
||||
|
@ -90,13 +94,13 @@
|
|||
</ng-container>
|
||||
<ng-template #fullFeatureList>
|
||||
<ul class="tw-pl-0 tw-list-inside tw-mb-0">
|
||||
<li *ngIf="selectableProduct.product == productTypes.Free">
|
||||
<li *ngIf="selectableProduct.productTier == productTypes.Free">
|
||||
{{ "limitedUsers" | i18n: selectableProduct.PasswordManager.maxSeats }}
|
||||
</li>
|
||||
<li
|
||||
*ngIf="
|
||||
selectableProduct.product != productTypes.Free &&
|
||||
selectableProduct.product != productTypes.TeamsStarter &&
|
||||
selectableProduct.productTier != productTypes.Free &&
|
||||
selectableProduct.productTier != productTypes.TeamsStarter &&
|
||||
selectableProduct.PasswordManager.maxSeats
|
||||
"
|
||||
>
|
||||
|
@ -136,7 +140,7 @@
|
|||
{{ "onPremHostingOptional" | i18n }}
|
||||
</li>
|
||||
<li *ngIf="selectableProduct.usersGetPremium">{{ "usersGetPremium" | i18n }}</li>
|
||||
<li *ngIf="selectableProduct.product != productTypes.Free">
|
||||
<li *ngIf="selectableProduct.productTier != productTypes.Free">
|
||||
{{ "priorityCustomerSupport" | i18n }}
|
||||
</li>
|
||||
<li *ngIf="selectableProduct.trialPeriodDays && createOrganization">
|
||||
|
@ -147,7 +151,7 @@
|
|||
</ng-template>
|
||||
</bit-hint>
|
||||
</bit-radio-button>
|
||||
<span *ngIf="selectableProduct.product != productTypes.Free" class="tw-pl-4">
|
||||
<span *ngIf="selectableProduct.productTier != productTypes.Free" class="tw-pl-4">
|
||||
<ng-container
|
||||
*ngIf="selectableProduct.PasswordManager.basePrice && !acceptingSponsorship"
|
||||
>
|
||||
|
@ -189,13 +193,13 @@
|
|||
}}
|
||||
/{{ "month" | i18n }}
|
||||
</span>
|
||||
<span *ngIf="selectableProduct.product == productTypes.Free" class="tw-pl-4">{{
|
||||
<span *ngIf="selectableProduct.productTier == productTypes.Free" class="tw-pl-4">{{
|
||||
"freeForever" | i18n
|
||||
}}</span>
|
||||
</div>
|
||||
</bit-radio-group>
|
||||
</bit-section>
|
||||
<bit-section *ngIf="formGroup.value.product !== productTypes.Free">
|
||||
<bit-section *ngIf="formGroup.value.productTier !== productTypes.Free">
|
||||
<bit-section
|
||||
*ngIf="
|
||||
selectedPlan.PasswordManager.hasAdditionalSeatsOption &&
|
||||
|
@ -415,7 +419,7 @@
|
|||
</bit-section>
|
||||
|
||||
<!-- Payment info -->
|
||||
<bit-section *ngIf="formGroup.value.product !== productTypes.Free">
|
||||
<bit-section *ngIf="formGroup.value.productTier !== productTypes.Free">
|
||||
<h2 bitTypography="h2">
|
||||
{{ (createOrganization ? "paymentInformation" : "billingInformation") | i18n }}
|
||||
</h2>
|
||||
|
|
|
@ -23,12 +23,11 @@ import { OrganizationKeysRequest } from "@bitwarden/common/admin-console/models/
|
|||
import { OrganizationUpgradeRequest } from "@bitwarden/common/admin-console/models/request/organization-upgrade.request";
|
||||
import { ProviderOrganizationCreateRequest } from "@bitwarden/common/admin-console/models/request/provider/provider-organization-create.request";
|
||||
import { ProviderResponse } from "@bitwarden/common/admin-console/models/response/provider/provider.response";
|
||||
import { PaymentMethodType, PlanType } from "@bitwarden/common/billing/enums";
|
||||
import { PaymentMethodType, PlanType, ProductTierType } from "@bitwarden/common/billing/enums";
|
||||
import { PaymentRequest } from "@bitwarden/common/billing/models/request/payment.request";
|
||||
import { BillingResponse } from "@bitwarden/common/billing/models/response/billing.response";
|
||||
import { OrganizationSubscriptionResponse } from "@bitwarden/common/billing/models/response/organization-subscription.response";
|
||||
import { PlanResponse } from "@bitwarden/common/billing/models/response/plan.response";
|
||||
import { ProductType } from "@bitwarden/common/enums";
|
||||
import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||
|
@ -73,16 +72,16 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
|
|||
selectedFile: File;
|
||||
|
||||
@Input()
|
||||
get product(): ProductType {
|
||||
return this._product;
|
||||
get productTier(): ProductTierType {
|
||||
return this._productTier;
|
||||
}
|
||||
|
||||
set product(product: ProductType) {
|
||||
this._product = product;
|
||||
this.formGroup?.controls?.product?.setValue(product);
|
||||
set productTier(product: ProductTierType) {
|
||||
this._productTier = product;
|
||||
this.formGroup?.controls?.productTier?.setValue(product);
|
||||
}
|
||||
|
||||
private _product = ProductType.Free;
|
||||
private _productTier = ProductTierType.Free;
|
||||
|
||||
@Input()
|
||||
get plan(): PlanType {
|
||||
|
@ -102,7 +101,7 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
|
|||
|
||||
loading = true;
|
||||
selfHosted = false;
|
||||
productTypes = ProductType;
|
||||
productTypes = ProductTierType;
|
||||
formPromise: Promise<string>;
|
||||
singleOrgPolicyAppliesToActiveUser = false;
|
||||
isInTrialFlow = false;
|
||||
|
@ -123,7 +122,7 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
|
|||
additionalSeats: [0, [Validators.min(0), Validators.max(100000)]],
|
||||
clientOwnerEmail: ["", [Validators.email]],
|
||||
plan: [this.plan],
|
||||
product: [this.product],
|
||||
productTier: [this.productTier],
|
||||
secretsManager: this.secretsManagerSubscription,
|
||||
});
|
||||
|
||||
|
@ -166,20 +165,23 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
|
|||
this.passwordManagerPlans = plans.data.filter((plan) => !!plan.PasswordManager);
|
||||
this.secretsManagerPlans = plans.data.filter((plan) => !!plan.SecretsManager);
|
||||
|
||||
if (this.product === ProductType.Enterprise || this.product === ProductType.Teams) {
|
||||
if (
|
||||
this.productTier === ProductTierType.Enterprise ||
|
||||
this.productTier === ProductTierType.Teams
|
||||
) {
|
||||
this.formGroup.controls.businessOwned.setValue(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.currentPlan && this.currentPlan.product !== ProductType.Enterprise) {
|
||||
if (this.currentPlan && this.currentPlan.productTier !== ProductTierType.Enterprise) {
|
||||
const upgradedPlan = this.passwordManagerPlans.find((plan) =>
|
||||
this.currentPlan.product === ProductType.Free
|
||||
this.currentPlan.productTier === ProductTierType.Free
|
||||
? plan.type === PlanType.FamiliesAnnually
|
||||
: plan.upgradeSortOrder == this.currentPlan.upgradeSortOrder + 1,
|
||||
);
|
||||
|
||||
this.plan = upgradedPlan.type;
|
||||
this.product = upgradedPlan.product;
|
||||
this.productTier = upgradedPlan.productTier;
|
||||
}
|
||||
|
||||
if (this.hasProvider) {
|
||||
|
@ -190,7 +192,7 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
|
|||
(plan) => plan.type === PlanType.TeamsAnnually,
|
||||
);
|
||||
this.plan = providerDefaultPlan.type;
|
||||
this.product = providerDefaultPlan.product;
|
||||
this.productTier = providerDefaultPlan.productTier;
|
||||
}
|
||||
|
||||
if (!this.createOrganization) {
|
||||
|
@ -229,7 +231,7 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
|
|||
|
||||
get upgradeRequiresPaymentMethod() {
|
||||
return (
|
||||
this.organization?.planProductType === ProductType.Free &&
|
||||
this.organization?.productTierType === ProductTierType.Free &&
|
||||
!this.showFree &&
|
||||
!this.billing?.paymentSource
|
||||
);
|
||||
|
@ -277,12 +279,12 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
|
|||
(plan) =>
|
||||
plan.type !== PlanType.Custom &&
|
||||
(!businessOwnedIsChecked || plan.canBeUsedByBusiness) &&
|
||||
(this.showFree || plan.product !== ProductType.Free) &&
|
||||
(this.showFree || plan.productTier !== ProductTierType.Free) &&
|
||||
(plan.isAnnual ||
|
||||
plan.product === ProductType.Free ||
|
||||
plan.product === ProductType.TeamsStarter) &&
|
||||
plan.productTier === ProductTierType.Free ||
|
||||
plan.productTier === ProductTierType.TeamsStarter) &&
|
||||
(!this.currentPlan || this.currentPlan.upgradeSortOrder < plan.upgradeSortOrder) &&
|
||||
(!this.hasProvider || plan.product !== ProductType.TeamsStarter) &&
|
||||
(!this.hasProvider || plan.productTier !== ProductTierType.TeamsStarter) &&
|
||||
((!this.isProviderQualifiedFor2020Plan() && this.planIsEnabled(plan)) ||
|
||||
(this.isProviderQualifiedFor2020Plan() &&
|
||||
Allowed2020PlansForLegacyProviders.includes(plan.type))),
|
||||
|
@ -294,11 +296,11 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
|
||||
get selectablePlans() {
|
||||
const selectedProductType = this.formGroup.controls.product.value;
|
||||
const selectedProductTierType = this.formGroup.controls.productTier.value;
|
||||
const result =
|
||||
this.passwordManagerPlans?.filter(
|
||||
(plan) =>
|
||||
plan.product === selectedProductType &&
|
||||
plan.productTier === selectedProductTierType &&
|
||||
((!this.isProviderQualifiedFor2020Plan() && this.planIsEnabled(plan)) ||
|
||||
(this.isProviderQualifiedFor2020Plan() &&
|
||||
Allowed2020PlansForLegacyProviders.includes(plan.type))),
|
||||
|
@ -516,10 +518,10 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
|
|||
return;
|
||||
}
|
||||
if (this.teamsStarterPlanIsAvailable) {
|
||||
this.formGroup.controls.product.setValue(ProductType.TeamsStarter);
|
||||
this.formGroup.controls.productTier.setValue(ProductTierType.TeamsStarter);
|
||||
this.formGroup.controls.plan.setValue(PlanType.TeamsStarter);
|
||||
} else {
|
||||
this.formGroup.controls.product.setValue(ProductType.Teams);
|
||||
this.formGroup.controls.productTier.setValue(ProductTierType.Teams);
|
||||
this.formGroup.controls.plan.setValue(PlanType.TeamsAnnually);
|
||||
}
|
||||
this.changedProduct();
|
||||
|
@ -766,19 +768,19 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
|
|||
|
||||
private upgradeFlowPrefillForm() {
|
||||
if (this.acceptingSponsorship) {
|
||||
this.formGroup.controls.product.setValue(ProductType.Families);
|
||||
this.formGroup.controls.productTier.setValue(ProductTierType.Families);
|
||||
this.changedProduct();
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.currentPlan && this.currentPlan.product !== ProductType.Enterprise) {
|
||||
if (this.currentPlan && this.currentPlan.productTier !== ProductTierType.Enterprise) {
|
||||
const upgradedPlan = this.passwordManagerPlans.find((plan) => {
|
||||
if (this.currentPlan.product === ProductType.Free) {
|
||||
if (this.currentPlan.productTier === ProductTierType.Free) {
|
||||
return plan.type === PlanType.FamiliesAnnually;
|
||||
}
|
||||
|
||||
if (
|
||||
this.currentPlan.product === ProductType.Families &&
|
||||
this.currentPlan.productTier === ProductTierType.Families &&
|
||||
!this.teamsStarterPlanIsAvailable
|
||||
) {
|
||||
return plan.type === PlanType.TeamsAnnually;
|
||||
|
@ -788,7 +790,7 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
|
|||
});
|
||||
|
||||
this.plan = upgradedPlan.type;
|
||||
this.product = upgradedPlan.product;
|
||||
this.productTier = upgradedPlan.productTier;
|
||||
this.changedProduct();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,10 +8,9 @@ import { OrganizationService } from "@bitwarden/common/admin-console/abstraction
|
|||
import { ProviderService } from "@bitwarden/common/admin-console/abstractions/provider.service";
|
||||
import { OrganizationApiKeyType, ProviderStatusType } from "@bitwarden/common/admin-console/enums";
|
||||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||
import { PlanType } from "@bitwarden/common/billing/enums";
|
||||
import { PlanType, ProductTierType } from "@bitwarden/common/billing/enums";
|
||||
import { OrganizationSubscriptionResponse } from "@bitwarden/common/billing/models/response/organization-subscription.response";
|
||||
import { BillingSubscriptionItemResponse } from "@bitwarden/common/billing/models/response/subscription.response";
|
||||
import { ProductType } from "@bitwarden/common/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";
|
||||
|
@ -53,7 +52,7 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy
|
|||
manageBillingFromProviderPortal = ManageBilling;
|
||||
isProviderManaged = false;
|
||||
|
||||
protected readonly teamsStarter = ProductType.TeamsStarter;
|
||||
protected readonly teamsStarter = ProductTierType.TeamsStarter;
|
||||
|
||||
private destroy$ = new Subject<void>();
|
||||
|
||||
|
@ -286,7 +285,7 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy
|
|||
}
|
||||
} else if (this.sub.maxAutoscaleSeats === this.sub.seats && this.sub.seats != null) {
|
||||
return this.i18nService.t("subscriptionMaxReached", this.sub.seats.toString());
|
||||
} else if (this.userOrg.planProductType === ProductType.TeamsStarter) {
|
||||
} else if (this.userOrg.productTierType === ProductTierType.TeamsStarter) {
|
||||
return this.i18nService.t("subscriptionUserSeatsWithoutAdditionalSeatsOption", 10);
|
||||
} else if (this.sub.maxAutoscaleSeats == null) {
|
||||
return this.i18nService.t("subscriptionUserSeatsUnlimitedAutoscale");
|
||||
|
@ -440,12 +439,12 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy
|
|||
};
|
||||
|
||||
get showChangePlanButton() {
|
||||
return this.sub.plan.product !== ProductType.Enterprise && !this.showChangePlan;
|
||||
return this.sub.plan.productTier !== ProductTierType.Enterprise && !this.showChangePlan;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to sort subscription items by product type and then by addon status
|
||||
* Helper to sort subscription items by productTier type and then by addon status
|
||||
*/
|
||||
function sortSubscriptionItems(
|
||||
a: BillingSubscriptionItemResponse,
|
||||
|
|
|
@ -3,9 +3,9 @@ import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
|||
import { Subject, startWith, takeUntil } from "rxjs";
|
||||
|
||||
import { ControlsOf } from "@bitwarden/angular/types/controls-of";
|
||||
import { ProductTierType } from "@bitwarden/common/billing/enums";
|
||||
import { BillingCustomerDiscount } from "@bitwarden/common/billing/models/response/organization-subscription.response";
|
||||
import { PlanResponse } from "@bitwarden/common/billing/models/response/plan.response";
|
||||
import { ProductType } from "@bitwarden/common/enums";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
|
||||
import { SecretsManagerLogo } from "../../layouts/secrets-manager-logo";
|
||||
|
@ -40,7 +40,7 @@ export class SecretsManagerSubscribeComponent implements OnInit, OnDestroy {
|
|||
@Input() customerDiscount: BillingCustomerDiscount;
|
||||
|
||||
logo = SecretsManagerLogo;
|
||||
productTypes = ProductType;
|
||||
productTypes = ProductTierType;
|
||||
|
||||
private destroy$ = new Subject<void>();
|
||||
|
||||
|
@ -75,17 +75,17 @@ export class SecretsManagerSubscribeComponent implements OnInit, OnDestroy {
|
|||
};
|
||||
|
||||
get product() {
|
||||
return this.selectedPlan.product;
|
||||
return this.selectedPlan.productTier;
|
||||
}
|
||||
|
||||
get planName() {
|
||||
switch (this.product) {
|
||||
case ProductType.Free:
|
||||
case ProductTierType.Free:
|
||||
return this.i18nService.t("free2PersonOrganization");
|
||||
case ProductType.Teams:
|
||||
case ProductType.TeamsStarter:
|
||||
case ProductTierType.Teams:
|
||||
case ProductTierType.TeamsStarter:
|
||||
return this.i18nService.t("planNameTeams");
|
||||
case ProductType.Enterprise:
|
||||
case ProductTierType.Enterprise:
|
||||
return this.i18nService.t("planNameEnterprise");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,8 @@ import { OrganizationService } from "@bitwarden/common/admin-console/abstraction
|
|||
import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
|
||||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||
import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions/account/billing-account-profile-state.service";
|
||||
import { EventType, ProductType } from "@bitwarden/common/enums";
|
||||
import { ProductTierType } from "@bitwarden/common/billing/enums";
|
||||
import { EventType } from "@bitwarden/common/enums";
|
||||
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||
|
@ -271,7 +272,7 @@ export class AddEditComponent extends BaseAddEditComponent implements OnInit, On
|
|||
return (
|
||||
this.cipher.type === CipherType.Login &&
|
||||
this.cipher.login.totp &&
|
||||
this.organization?.planProductType != ProductType.Free &&
|
||||
this.organization?.productTierType != ProductTierType.Free &&
|
||||
(this.cipher.organizationUseTotp || this.canAccessPremium)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import { firstValueFrom } from "rxjs";
|
|||
|
||||
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
||||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||
import { ProductType } from "@bitwarden/common/enums";
|
||||
import { 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";
|
||||
|
@ -183,7 +183,7 @@ export class VaultHeaderComponent implements OnInit {
|
|||
}
|
||||
|
||||
async addCollection() {
|
||||
if (this.organization.planProductType === ProductType.Free) {
|
||||
if (this.organization.productTierType === ProductTierType.Free) {
|
||||
const collections = await this.collectionAdminService.getAll(this.organization.id);
|
||||
if (collections.length === this.organization.maxCollections) {
|
||||
this.showFreeOrgUpgradeDialog();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ProductType } from "../../../enums/product-type.enum";
|
||||
import { ProductTierType } from "../../../billing/enums/product-tier-type.enum";
|
||||
import { OrganizationUserStatusType, OrganizationUserType } from "../../enums";
|
||||
import { ORGANIZATIONS } from "../../services/organization/organization.service";
|
||||
|
||||
|
@ -47,7 +47,7 @@ describe("ORGANIZATIONS state", () => {
|
|||
isMember: false,
|
||||
familySponsorshipFriendlyName: "fsfn",
|
||||
familySponsorshipAvailable: false,
|
||||
planProductType: ProductType.Free,
|
||||
productTierType: ProductTierType.Free,
|
||||
keyConnectorEnabled: false,
|
||||
keyConnectorUrl: "kcu",
|
||||
accessSecretsManager: false,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Jsonify } from "type-fest";
|
||||
|
||||
import { ProductType } from "../../../enums";
|
||||
import { ProductTierType } from "../../../billing/enums";
|
||||
import { OrganizationUserStatusType, OrganizationUserType, ProviderType } from "../../enums";
|
||||
import { PermissionsApi } from "../api/permissions.api";
|
||||
import { ProfileOrganizationResponse } from "../response/profile-organization.response";
|
||||
|
@ -45,7 +45,7 @@ export class OrganizationData {
|
|||
isMember: boolean;
|
||||
familySponsorshipFriendlyName: string;
|
||||
familySponsorshipAvailable: boolean;
|
||||
planProductType: ProductType;
|
||||
productTierType: ProductTierType;
|
||||
keyConnectorEnabled: boolean;
|
||||
keyConnectorUrl: string;
|
||||
familySponsorshipLastSyncDate?: Date;
|
||||
|
@ -104,7 +104,7 @@ export class OrganizationData {
|
|||
this.providerType = response.providerType;
|
||||
this.familySponsorshipFriendlyName = response.familySponsorshipFriendlyName;
|
||||
this.familySponsorshipAvailable = response.familySponsorshipAvailable;
|
||||
this.planProductType = response.planProductType;
|
||||
this.productTierType = response.planProductType;
|
||||
this.keyConnectorEnabled = response.keyConnectorEnabled;
|
||||
this.keyConnectorUrl = response.keyConnectorUrl;
|
||||
this.familySponsorshipLastSyncDate = response.familySponsorshipLastSyncDate;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Jsonify } from "type-fest";
|
||||
|
||||
import { ProductType } from "../../../enums";
|
||||
import { ProductTierType } from "../../../billing/enums";
|
||||
import { OrganizationUserStatusType, OrganizationUserType, ProviderType } from "../../enums";
|
||||
import { PermissionsApi } from "../api/permissions.api";
|
||||
import { OrganizationData } from "../data/organization.data";
|
||||
|
@ -58,7 +58,7 @@ export class Organization {
|
|||
isMember: boolean;
|
||||
familySponsorshipFriendlyName: string;
|
||||
familySponsorshipAvailable: boolean;
|
||||
planProductType: ProductType;
|
||||
productTierType: ProductTierType;
|
||||
keyConnectorEnabled: boolean;
|
||||
keyConnectorUrl: string;
|
||||
familySponsorshipLastSyncDate?: Date;
|
||||
|
@ -123,7 +123,7 @@ export class Organization {
|
|||
this.isMember = obj.isMember;
|
||||
this.familySponsorshipFriendlyName = obj.familySponsorshipFriendlyName;
|
||||
this.familySponsorshipAvailable = obj.familySponsorshipAvailable;
|
||||
this.planProductType = obj.planProductType;
|
||||
this.productTierType = obj.productTierType;
|
||||
this.keyConnectorEnabled = obj.keyConnectorEnabled;
|
||||
this.keyConnectorUrl = obj.keyConnectorUrl;
|
||||
this.familySponsorshipLastSyncDate = obj.familySponsorshipLastSyncDate;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ProductType } from "../../../enums";
|
||||
import { ProductTierType } from "../../../billing/enums";
|
||||
import { BaseResponse } from "../../../models/response/base.response";
|
||||
import { OrganizationUserStatusType, OrganizationUserType, ProviderType } from "../../enums";
|
||||
import { PermissionsApi } from "../api/permissions.api";
|
||||
|
@ -42,7 +42,7 @@ export class ProfileOrganizationResponse extends BaseResponse {
|
|||
providerType?: ProviderType;
|
||||
familySponsorshipFriendlyName: string;
|
||||
familySponsorshipAvailable: boolean;
|
||||
planProductType: ProductType;
|
||||
planProductType: ProductTierType;
|
||||
keyConnectorEnabled: boolean;
|
||||
keyConnectorUrl: string;
|
||||
familySponsorshipLastSyncDate?: Date;
|
||||
|
|
|
@ -3,3 +3,4 @@ export * from "./plan-sponsorship-type.enum";
|
|||
export * from "./plan-type.enum";
|
||||
export * from "./transaction-type.enum";
|
||||
export * from "./bitwarden-product-type.enum";
|
||||
export * from "./product-tier-type.enum";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export enum ProductType {
|
||||
export enum ProductTierType {
|
||||
Free = 0,
|
||||
Families = 1,
|
||||
Teams = 2,
|
|
@ -0,0 +1,4 @@
|
|||
export enum ProductType {
|
||||
PasswordManager = 0,
|
||||
SecretsManager = 1,
|
||||
}
|
|
@ -1,10 +1,9 @@
|
|||
import { ProductType } from "../../../enums";
|
||||
import { ProductTierType, PlanType } from "../../../billing/enums";
|
||||
import { BaseResponse } from "../../../models/response/base.response";
|
||||
import { PlanType } from "../../enums";
|
||||
|
||||
export class PlanResponse extends BaseResponse {
|
||||
type: PlanType;
|
||||
product: ProductType;
|
||||
productTier: ProductTierType;
|
||||
name: string;
|
||||
isAnnual: boolean;
|
||||
nameLocalizationKey: string;
|
||||
|
@ -32,7 +31,7 @@ export class PlanResponse extends BaseResponse {
|
|||
constructor(response: any) {
|
||||
super(response);
|
||||
this.type = this.getResponseProperty("Type");
|
||||
this.product = this.getResponseProperty("Product");
|
||||
this.productTier = this.getResponseProperty("ProductTier");
|
||||
this.name = this.getResponseProperty("Name");
|
||||
this.isAnnual = this.getResponseProperty("IsAnnual");
|
||||
this.nameLocalizationKey = this.getResponseProperty("NameLocalizationKey");
|
||||
|
|
|
@ -6,4 +6,3 @@ export * from "./http-status-code.enum";
|
|||
export * from "./integration-type.enum";
|
||||
export * from "./native-messaging-version.enum";
|
||||
export * from "./notification-type.enum";
|
||||
export * from "./product-type.enum";
|
||||
|
|
Loading…
Reference in New Issue