mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-21 11:35:34 +01:00
Hiding teams starter plan option from org creation and org upgrade (#9017)
This commit is contained in:
parent
7819dbdd56
commit
61f2def195
@ -74,7 +74,10 @@
|
||||
</ng-container>
|
||||
<ng-template #nonEnterprisePlans>
|
||||
<ng-container
|
||||
*ngIf="selectableProduct.product === productTypes.Teams; else fullFeatureList"
|
||||
*ngIf="
|
||||
selectableProduct.product === productTypes.Teams && teamsStarterPlanIsAvailable;
|
||||
else fullFeatureList
|
||||
"
|
||||
>
|
||||
<ul class="tw-pl-0 tw-list-inside tw-mb-0">
|
||||
<li>{{ "includeAllTeamsStarterFeatures" | i18n }}</li>
|
||||
|
@ -438,6 +438,10 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
|
||||
return this.selectedSecretsManagerPlan != null;
|
||||
}
|
||||
|
||||
get teamsStarterPlanIsAvailable() {
|
||||
return this.selectablePlans.some((plan) => plan.type === PlanType.TeamsStarter);
|
||||
}
|
||||
|
||||
changedProduct() {
|
||||
const selectedPlan = this.selectablePlans[0];
|
||||
|
||||
@ -511,8 +515,13 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
|
||||
if (!this.formGroup.controls.businessOwned.value || this.selectedPlan.canBeUsedByBusiness) {
|
||||
return;
|
||||
}
|
||||
this.formGroup.controls.product.setValue(ProductType.TeamsStarter);
|
||||
this.formGroup.controls.plan.setValue(PlanType.TeamsStarter);
|
||||
if (this.teamsStarterPlanIsAvailable) {
|
||||
this.formGroup.controls.product.setValue(ProductType.TeamsStarter);
|
||||
this.formGroup.controls.plan.setValue(PlanType.TeamsStarter);
|
||||
} else {
|
||||
this.formGroup.controls.product.setValue(ProductType.Teams);
|
||||
this.formGroup.controls.plan.setValue(PlanType.TeamsAnnually);
|
||||
}
|
||||
this.changedProduct();
|
||||
}
|
||||
|
||||
@ -763,11 +772,20 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
if (this.currentPlan && this.currentPlan.product !== ProductType.Enterprise) {
|
||||
const upgradedPlan = this.passwordManagerPlans.find((plan) =>
|
||||
this.currentPlan.product === ProductType.Free
|
||||
? plan.type === PlanType.FamiliesAnnually
|
||||
: plan.upgradeSortOrder == this.currentPlan.upgradeSortOrder + 1,
|
||||
);
|
||||
const upgradedPlan = this.passwordManagerPlans.find((plan) => {
|
||||
if (this.currentPlan.product === ProductType.Free) {
|
||||
return plan.type === PlanType.FamiliesAnnually;
|
||||
}
|
||||
|
||||
if (
|
||||
this.currentPlan.product === ProductType.Families &&
|
||||
!this.teamsStarterPlanIsAvailable
|
||||
) {
|
||||
return plan.type === PlanType.TeamsAnnually;
|
||||
}
|
||||
|
||||
return plan.upgradeSortOrder === this.currentPlan.upgradeSortOrder + 1;
|
||||
});
|
||||
|
||||
this.plan = upgradedPlan.type;
|
||||
this.product = upgradedPlan.product;
|
||||
|
Loading…
Reference in New Issue
Block a user