mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +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:
@@ -92,7 +92,7 @@
|
|||||||
</small>
|
</small>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<span *ngIf="selectableProduct.product != productTypes.Free">
|
<span *ngIf="selectableProduct.product != productTypes.Free">
|
||||||
<ng-container *ngIf="selectableProduct.basePrice">
|
<ng-container *ngIf="selectableProduct.basePrice && !acceptingSponsorship">
|
||||||
{{selectableProduct.basePrice / 12 | currency:'$'}} /{{'month' | i18n}},
|
{{selectableProduct.basePrice / 12 | currency:'$'}} /{{'month' | i18n}},
|
||||||
{{'includesXUsers' | i18n : selectableProduct.baseSeats}}
|
{{'includesXUsers' | i18n : selectableProduct.baseSeats}}
|
||||||
<ng-container *ngIf="selectableProduct.hasAdditionalSeatsOption">
|
<ng-container *ngIf="selectableProduct.hasAdditionalSeatsOption">
|
||||||
@@ -162,8 +162,14 @@
|
|||||||
{{'basePrice' | i18n}}: {{ selectablePlan.basePrice / 12 | currency:'$'}} × 12
|
{{'basePrice' | i18n}}: {{ selectablePlan.basePrice / 12 | currency:'$'}} × 12
|
||||||
{{'monthAbbr' | i18n}}
|
{{'monthAbbr' | 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:'$'}}
|
{{selectablePlan.basePrice | currency:'$'}}
|
||||||
/{{'year' | i18n}}
|
/{{'year' | i18n}}
|
||||||
|
</ng-template>
|
||||||
</small>
|
</small>
|
||||||
<small *ngIf="selectablePlan.hasAdditionalSeatsOption">
|
<small *ngIf="selectablePlan.hasAdditionalSeatsOption">
|
||||||
<span *ngIf="selectablePlan.baseSeats">{{'additionalUsers' | i18n}}:</span>
|
<span *ngIf="selectablePlan.baseSeats">{{'additionalUsers' | i18n}}:</span>
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ export class OrganizationPlansComponent implements OnInit {
|
|||||||
productTypes = ProductType;
|
productTypes = ProductType;
|
||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
singleOrgPolicyBlock: boolean = false;
|
singleOrgPolicyBlock: boolean = false;
|
||||||
|
discount = 0;
|
||||||
|
|
||||||
plans: PlanResponse[];
|
plans: PlanResponse[];
|
||||||
|
|
||||||
@@ -120,15 +121,19 @@ export class OrganizationPlansComponent implements OnInit {
|
|||||||
validPlans = validPlans.filter(plan => plan.product !== ProductType.Free);
|
validPlans = validPlans.filter(plan => plan.product !== ProductType.Free);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.acceptingSponsorship) {
|
|
||||||
validPlans = validPlans.filter(plan => plan.product === ProductType.Families);
|
|
||||||
}
|
|
||||||
|
|
||||||
validPlans = validPlans
|
validPlans = validPlans
|
||||||
.filter(plan => !plan.legacyYear
|
.filter(plan => !plan.legacyYear
|
||||||
&& !plan.disabled
|
&& !plan.disabled
|
||||||
&& (plan.isAnnual || plan.product === this.productTypes.Free));
|
&& (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;
|
return validPlans;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,7 +182,7 @@ export class OrganizationPlansComponent implements OnInit {
|
|||||||
if (this.selectedPlan.hasPremiumAccessOption && this.premiumAccessAddon) {
|
if (this.selectedPlan.hasPremiumAccessOption && this.premiumAccessAddon) {
|
||||||
subTotal += this.selectedPlan.premiumAccessOptionPrice;
|
subTotal += this.selectedPlan.premiumAccessOptionPrice;
|
||||||
}
|
}
|
||||||
return subTotal;
|
return subTotal - this.discount;
|
||||||
}
|
}
|
||||||
|
|
||||||
get freeTrial() {
|
get freeTrial() {
|
||||||
|
|||||||
@@ -4730,5 +4730,8 @@
|
|||||||
},
|
},
|
||||||
"sponsorshipTokenHasExpired": {
|
"sponsorshipTokenHasExpired": {
|
||||||
"message": "The sponsorship offer has expired."
|
"message": "The sponsorship offer has expired."
|
||||||
|
},
|
||||||
|
"freeWithSponsorship": {
|
||||||
|
"message": "FREE with sponsorship"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user