mirror of
https://github.com/bitwarden/browser
synced 2025-12-27 13:43:41 +00:00
Fix basePrice to reflect the sponsorship (#1311)
* Fix basePrice to reflect the sponsorship * Ran linter * Add latest copy * Remove unneeded if * Fix times * Stopped hardcoding basePrice * Stopped hardcoding 40 in UI * Switch to single small block * Update jslib * Revert "Update jslib" This reverts commit 28534f223075ce8386b95d4cbd3324613bca6fdc. * Revert "Remove unneeded if" This reverts commit 5540b1999822671387474b9c513d9c404c6cad00. * Fix revert issue
This commit is contained in:
@@ -68,6 +68,7 @@ export class OrganizationPlansComponent implements OnInit {
|
||||
productTypes = ProductType;
|
||||
formPromise: Promise<any>;
|
||||
singleOrgPolicyBlock: boolean = false;
|
||||
discount = 0;
|
||||
|
||||
plans: PlanResponse[];
|
||||
|
||||
@@ -120,14 +121,18 @@ export class OrganizationPlansComponent implements OnInit {
|
||||
validPlans = validPlans.filter(plan => plan.product !== ProductType.Free);
|
||||
}
|
||||
|
||||
if (this.acceptingSponsorship) {
|
||||
validPlans = validPlans.filter(plan => plan.product === ProductType.Families);
|
||||
}
|
||||
|
||||
validPlans = validPlans
|
||||
.filter(plan => !plan.legacyYear
|
||||
&& !plan.disabled
|
||||
&& (plan.isAnnual || plan.product === this.productTypes.Free));
|
||||
.filter(plan => !plan.legacyYear
|
||||
&& !plan.disabled
|
||||
&& (plan.isAnnual || plan.product === this.productTypes.Free));
|
||||
|
||||
if (this.acceptingSponsorship) {
|
||||
const familyPlan = this.plans.find(plan => plan.type === PlanType.FamiliesAnnually);
|
||||
this.discount = familyPlan.basePrice;
|
||||
validPlans = [
|
||||
familyPlan,
|
||||
];
|
||||
}
|
||||
|
||||
return validPlans;
|
||||
}
|
||||
@@ -177,7 +182,7 @@ export class OrganizationPlansComponent implements OnInit {
|
||||
if (this.selectedPlan.hasPremiumAccessOption && this.premiumAccessAddon) {
|
||||
subTotal += this.selectedPlan.premiumAccessOptionPrice;
|
||||
}
|
||||
return subTotal;
|
||||
return subTotal - this.discount;
|
||||
}
|
||||
|
||||
get freeTrial() {
|
||||
|
||||
Reference in New Issue
Block a user