1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-21 16:18:28 +01:00

[AC-471] Cloud update subscription page (#4897)

* [AC-471] feat: update copy

* [AC-471] feat: change text color when expired

* [AC-471] feat: remove charge amount
This commit is contained in:
Andreas Coroiu 2023-03-24 09:39:22 +01:00 committed by GitHub
parent 926012f921
commit 7e905d518b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 9 deletions

View File

@ -55,15 +55,11 @@
"pendingCancellation" | i18n
}}</span>
</dd>
<dt>{{ "nextCharge" | i18n }}</dt>
<dd>
{{
nextInvoice
? (nextInvoice.date | date : "mediumDate") +
", " +
(nextInvoice.amount | currency : "$")
: "-"
}}
<dt [ngClass]="{ 'tw-text-danger': isExpired }">
{{ "subscriptionExpiration" | i18n }}
</dt>
<dd [ngClass]="{ 'tw-text-danger': isExpired }">
{{ nextInvoice ? (nextInvoice.date | date : "mediumDate") : "-" }}
</dd>
</ng-container>
</dl>

View File

@ -99,6 +99,16 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy
return this.sub != null ? this.sub.upcomingInvoice : null;
}
get isExpired() {
const nextInvoice = this.nextInvoice;
if (nextInvoice == null) {
return false;
}
return new Date(nextInvoice.date).getTime() < Date.now();
}
get storagePercentage() {
return this.sub != null && this.sub.maxStorageGb
? +(100 * (this.sub.storageGb / this.sub.maxStorageGb)).toFixed(2)

View File

@ -2020,6 +2020,9 @@
"cancelSubscription": {
"message": "Cancel subscription"
},
"subscriptionExpiration": {
"message": "Subscription expiration"
},
"subscriptionCanceled": {
"message": "The subscription has been canceled."
},