1
0
mirror of https://github.com/bitwarden/web synced 2026-02-14 15:33:29 +00:00

Stopped hardcoding basePrice

This commit is contained in:
Justin Baur
2021-11-24 13:02:07 -05:00
parent 38c69efaaf
commit f5f0f43ead
2 changed files with 5 additions and 4 deletions

View File

@@ -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">
@@ -158,7 +158,7 @@
<label class="form-check-label" for="interval{{selectablePlan.type}}">
<ng-container *ngIf="selectablePlan.isAnnual">
{{'annually' | i18n}}
<small *ngIf="selectablePlan.basePrice">
<small *ngIf="selectablePlan.basePrice && !acceptingSponsorship">
{{'basePrice' | i18n}}: {{ selectablePlan.basePrice / 12 | currency:'$'}} &times; 12
{{'monthAbbr' | i18n}}
=

View File

@@ -68,6 +68,7 @@ export class OrganizationPlansComponent implements OnInit {
productTypes = ProductType;
formPromise: Promise<any>;
singleOrgPolicyBlock: boolean = false;
discount = 0;
plans: PlanResponse[];
@@ -127,7 +128,7 @@ export class OrganizationPlansComponent implements OnInit {
if (this.acceptingSponsorship) {
const familyPlan = this.plans.find(plan => plan.type === PlanType.FamiliesAnnually);
familyPlan.basePrice = 0;
this.discount = familyPlan.basePrice;
validPlans = [
familyPlan,
];
@@ -181,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() {