1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-22 11:45:59 +01:00

Hiding teams starter plan option from org creation and org upgrade (#9017)

This commit is contained in:
Conner Turnbull 2024-05-17 09:35:41 -04:00 committed by GitHub
parent 7819dbdd56
commit 61f2def195
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 29 additions and 8 deletions

View File

@ -74,7 +74,10 @@
</ng-container> </ng-container>
<ng-template #nonEnterprisePlans> <ng-template #nonEnterprisePlans>
<ng-container <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"> <ul class="tw-pl-0 tw-list-inside tw-mb-0">
<li>{{ "includeAllTeamsStarterFeatures" | i18n }}</li> <li>{{ "includeAllTeamsStarterFeatures" | i18n }}</li>

View File

@ -438,6 +438,10 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
return this.selectedSecretsManagerPlan != null; return this.selectedSecretsManagerPlan != null;
} }
get teamsStarterPlanIsAvailable() {
return this.selectablePlans.some((plan) => plan.type === PlanType.TeamsStarter);
}
changedProduct() { changedProduct() {
const selectedPlan = this.selectablePlans[0]; const selectedPlan = this.selectablePlans[0];
@ -511,8 +515,13 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
if (!this.formGroup.controls.businessOwned.value || this.selectedPlan.canBeUsedByBusiness) { if (!this.formGroup.controls.businessOwned.value || this.selectedPlan.canBeUsedByBusiness) {
return; return;
} }
this.formGroup.controls.product.setValue(ProductType.TeamsStarter); if (this.teamsStarterPlanIsAvailable) {
this.formGroup.controls.plan.setValue(PlanType.TeamsStarter); 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(); this.changedProduct();
} }
@ -763,11 +772,20 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
} }
if (this.currentPlan && this.currentPlan.product !== ProductType.Enterprise) { if (this.currentPlan && this.currentPlan.product !== ProductType.Enterprise) {
const upgradedPlan = this.passwordManagerPlans.find((plan) => const upgradedPlan = this.passwordManagerPlans.find((plan) => {
this.currentPlan.product === ProductType.Free if (this.currentPlan.product === ProductType.Free) {
? plan.type === PlanType.FamiliesAnnually return plan.type === PlanType.FamiliesAnnually;
: plan.upgradeSortOrder == this.currentPlan.upgradeSortOrder + 1, }
);
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.plan = upgradedPlan.type;
this.product = upgradedPlan.product; this.product = upgradedPlan.product;