1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-27 12:36:14 +01:00

premium access addon for orgs

This commit is contained in:
Kyle Spearrin 2018-11-20 16:38:00 -05:00
parent d88b23c42d
commit 9c7b7b0d75
5 changed files with 50 additions and 3 deletions

2
jslib

@ -1 +1 @@
Subproject commit 464bca8c4d745eb86bdb0b36e6e4a983caa3c891 Subproject commit 5d5200b12e36dc170d7d3ec7bd34f0e7f99cd422

View File

@ -124,6 +124,15 @@
<small class="text-muted form-text">{{'additionalStorageIntervalDesc' | i18n : '1 GB' : (storageGb.price | currency:'$') : ('month' | i18n)}}</small> <small class="text-muted form-text">{{'additionalStorageIntervalDesc' | i18n : '1 GB' : (storageGb.price | currency:'$') : ('month' | i18n)}}</small>
</div> </div>
</div> </div>
<div class="row">
<div class="form-group col-6" *ngIf="plans[plan].canBuyPremiumAccessAddon">
<div class="form-check">
<input id="premiumAccess" class="form-check-input" type="checkbox" name="PremiumAccessAddon" [(ngModel)]="premiumAccessAddon">
<label for="premiumAccess" class="form-check-label bold">{{'premiumAccess' | i18n}}</label>
</div>
<small class="text-muted form-text">{{'premiumAccessDesc' | i18n : (3.33 | currency:'$') : ('month' | i18n)}}</small>
</div>
</div>
<h2 class="spaced-header">{{'summary' | i18n}}</h2> <h2 class="spaced-header">{{'summary' | i18n}}</h2>
<div class="form-check form-check-block"> <div class="form-check form-check-block">
<input class="form-check-input" type="radio" name="BillingInterval" id="intervalAnnually" value="year" [(ngModel)]="interval"> <input class="form-check-input" type="radio" name="BillingInterval" id="intervalAnnually" value="year" [(ngModel)]="interval">
@ -143,6 +152,10 @@
{{'additionalStorageGb' | i18n}}: {{additionalStorage || 0}} &times; {{storageGb.price | currency:'$'}} &times;12 {{'monthAbbr' {{'additionalStorageGb' | i18n}}: {{additionalStorage || 0}} &times; {{storageGb.price | currency:'$'}} &times;12 {{'monthAbbr'
| i18n}} = {{additionalStorageTotal(true) | currency:'$'}} /{{'year' | i18n}} | i18n}} = {{additionalStorageTotal(true) | currency:'$'}} /{{'year' | i18n}}
</small> </small>
<small *ngIf="plans[plan].canBuyPremiumAccessAddon && premiumAccessAddon">
{{'premiumAccess' | i18n}}:
{{3.33 | currency:'$'}} &times;12 {{'monthAbbr' | i18n}} = {{40 | currency:'$'}} /{{'year' | i18n}}
</small>
</label> </label>
</div> </div>
<div class="form-check form-check-block" *ngIf="plans[plan].monthlySeatPrice"> <div class="form-check form-check-block" *ngIf="plans[plan].monthlySeatPrice">

View File

@ -31,6 +31,7 @@ export class CreateOrganizationComponent implements OnInit {
selfHosted = false; selfHosted = false;
ownedBusiness = false; ownedBusiness = false;
premiumAccessAddon = false;
storageGbPriceMonthly = 0.33; storageGbPriceMonthly = 0.33;
additionalStorage = 0; additionalStorage = 0;
additionalSeats = 0; additionalSeats = 0;
@ -58,6 +59,7 @@ export class CreateOrganizationComponent implements OnInit {
baseSeats: 5, baseSeats: 5,
noAdditionalSeats: true, noAdditionalSeats: true,
annualPlanType: PlanType.FamiliesAnnually, annualPlanType: PlanType.FamiliesAnnually,
canBuyPremiumAccessAddon: true,
}, },
teams: { teams: {
basePrice: 5, basePrice: 5,
@ -144,6 +146,8 @@ export class CreateOrganizationComponent implements OnInit {
request.businessName = this.ownedBusiness ? this.businessName : null; request.businessName = this.ownedBusiness ? this.businessName : null;
request.additionalSeats = this.additionalSeats; request.additionalSeats = this.additionalSeats;
request.additionalStorageGb = this.additionalStorage; request.additionalStorageGb = this.additionalStorage;
request.premiumAccessAddon = this.plans[this.plan].canBuyPremiumAccessAddon &&
this.premiumAccessAddon;
request.country = this.paymentComponent.getCountry(); request.country = this.paymentComponent.getCountry();
if (this.interval === 'month') { if (this.interval === 'month') {
request.planType = this.plans[this.plan].monthPlanType; request.planType = this.plans[this.plan].monthPlanType;
@ -170,6 +174,10 @@ export class CreateOrganizationComponent implements OnInit {
} }
changedPlan() { changedPlan() {
if (!this.plans[this.plan].canBuyPremiumAccessAddon) {
this.premiumAccessAddon = false;
}
if (this.plans[this.plan].monthPlanType == null) { if (this.plans[this.plan].monthPlanType == null) {
this.interval = 'year'; this.interval = 'year';
} }
@ -217,8 +225,18 @@ export class CreateOrganizationComponent implements OnInit {
} }
} }
premiumAccessTotal(annual: boolean): number {
if (this.plans[this.plan].canBuyPremiumAccessAddon && this.premiumAccessAddon) {
if (annual) {
return 40;
}
}
return 0;
}
get total(): number { get total(): number {
const annual = this.interval === 'year'; const annual = this.interval === 'year';
return this.baseTotal(annual) + this.seatTotal(annual) + this.additionalStorageTotal(annual); return this.baseTotal(annual) + this.seatTotal(annual) + this.additionalStorageTotal(annual) +
this.premiumAccessTotal(annual);
} }
} }

View File

@ -1386,6 +1386,22 @@
"addons": { "addons": {
"message": "Addons" "message": "Addons"
}, },
"premiumAccess": {
"message": "Premium Access"
},
"premiumAccessDesc": {
"message": "You can add premium access to all members of your organization for $PRICE$ /$INTERVAL$.",
"placeholders": {
"price": {
"content": "$1",
"example": "$3.33"
},
"interval": {
"content": "$2",
"example": "'month' or 'year'"
}
}
},
"additionalStorageGb": { "additionalStorageGb": {
"message": "Additional Storage (GB)" "message": "Additional Storage (GB)"
}, },

View File

@ -250,7 +250,7 @@ input, select, textarea {
@include border-radius($modal-content-border-radius); @include border-radius($modal-content-border-radius);
} }
label:not(.form-check-label):not(.btn) { label:not(.form-check-label):not(.btn), label.bold {
font-weight: 600; font-weight: 600;
} }