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

View File

@ -99,6 +99,16 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy
return this.sub != null ? this.sub.upcomingInvoice : null; 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() { get storagePercentage() {
return this.sub != null && this.sub.maxStorageGb return this.sub != null && this.sub.maxStorageGb
? +(100 * (this.sub.storageGb / this.sub.maxStorageGb)).toFixed(2) ? +(100 * (this.sub.storageGb / this.sub.maxStorageGb)).toFixed(2)

View File

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