mirror of
https://github.com/bitwarden/browser.git
synced 2025-02-28 03:21:40 +01: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:
parent
4029554658
commit
4b856d9016
@ -92,7 +92,7 @@
|
||||
</small>
|
||||
</ng-template>
|
||||
<span *ngIf="selectableProduct.product != productTypes.Free">
|
||||
<ng-container *ngIf="selectableProduct.basePrice">
|
||||
<ng-container *ngIf="selectableProduct.basePrice && !acceptingSponsorship">
|
||||
{{selectableProduct.basePrice / 12 | currency:'$'}} /{{'month' | i18n}},
|
||||
{{'includesXUsers' | i18n : selectableProduct.baseSeats}}
|
||||
<ng-container *ngIf="selectableProduct.hasAdditionalSeatsOption">
|
||||
@ -162,8 +162,14 @@
|
||||
{{'basePrice' | i18n}}: {{ selectablePlan.basePrice / 12 | currency:'$'}} × 12
|
||||
{{'monthAbbr' | i18n}}
|
||||
=
|
||||
{{selectablePlan.basePrice | currency:'$'}}
|
||||
/{{'year' | i18n}}
|
||||
<ng-container *ngIf="acceptingSponsorship; else notAcceptingSponsorship">
|
||||
<span style="text-decoration: line-through;">{{selectablePlan.basePrice | currency:'$'}}</span>
|
||||
{{'freeWithSponsorship' | i18n}}
|
||||
</ng-container>
|
||||
<ng-template #notAcceptingSponsorship>
|
||||
{{selectablePlan.basePrice | currency:'$'}}
|
||||
/{{'year' | i18n}}
|
||||
</ng-template>
|
||||
</small>
|
||||
<small *ngIf="selectablePlan.hasAdditionalSeatsOption">
|
||||
<span *ngIf="selectablePlan.baseSeats">{{'additionalUsers' | i18n}}:</span>
|
||||
|
@ -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() {
|
||||
|
@ -4730,5 +4730,8 @@
|
||||
},
|
||||
"sponsorshipTokenHasExpired": {
|
||||
"message": "The sponsorship offer has expired."
|
||||
},
|
||||
"freeWithSponsorship": {
|
||||
"message": "FREE with sponsorship"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user