1
0
mirror of https://github.com/bitwarden/web synced 2026-01-10 12:33:43 +00:00

Organization autoscaling (#1193)

* Add seat autoscale component

* Move small description under title

* tweak autoscale terminology

* Linter fixes

* Use single component for org subscription updates

* Delete unused localization string

* Clarify max bill copy

* Remove cancel from org subscription adjustment

* Update jslib

* PR review

* update jslib

* Simplify success toast
This commit is contained in:
Matt Gibson
2021-09-27 15:23:12 -04:00
committed by GitHub
parent 1df2225a52
commit c98a189430
9 changed files with 286 additions and 234 deletions

View File

@@ -26,6 +26,7 @@ export class OrganizationSubscriptionComponent implements OnInit {
organizationId: string;
adjustSeatsAdd = true;
showAdjustSeats = false;
showAdjustSeatAutoscale = false;
adjustStorageAdd = true;
showAdjustStorage = false;
showUpdateLicense = false;
@@ -142,16 +143,8 @@ export class OrganizationSubscriptionComponent implements OnInit {
}
}
adjustSeats(add: boolean) {
this.adjustSeatsAdd = add;
this.showAdjustSeats = true;
}
closeSeats(load: boolean) {
this.showAdjustSeats = false;
if (load) {
this.load();
}
subscriptionAdjusted() {
this.load();
}
adjustStorage(add: boolean) {
@@ -205,6 +198,14 @@ export class OrganizationSubscriptionComponent implements OnInit {
return this.sub.plan.seatPrice;
}
get seats() {
return this.sub.seats;
}
get maxAutoscaleSeats() {
return this.sub.maxAutoscaleSeats;
}
get canAdjustSeats() {
return this.sub.plan.hasAdditionalSeatsOption;
}
@@ -213,4 +214,14 @@ export class OrganizationSubscriptionComponent implements OnInit {
return (this.sub.planType !== PlanType.Free && this.subscription == null) ||
(this.subscription != null && !this.subscription.cancelled);
}
get subscriptionDesc() {
if (this.sub.maxAutoscaleSeats == this.sub.seats && this.sub.seats != null) {
return this.i18nService.t('subscriptionMaxReached', this.sub.seats.toString());
} else if (this.sub.maxAutoscaleSeats == null) {
return this.i18nService.t('subscriptionUserSeatsUnlimitedAutoscale');
} else {
return this.i18nService.t('subscriptionUserSeatsLimitedAutoscale', this.sub.maxAutoscaleSeats.toString());
}
}
}