1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-21 11:35:34 +01:00

Resolved subscription page problem for free org (#8622)

This commit is contained in:
Alex Morask 2024-04-05 09:23:12 -04:00 committed by GitHub
parent 775c8a1bbe
commit 9f8f93ef97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 7 deletions

View File

@ -14,7 +14,7 @@
<dl class="tw-grid tw-grid-flow-col tw-grid-rows-2">
<dt>{{ "billingPlan" | i18n }}</dt>
<dd>{{ planName }}</dd>
<ng-container>
<ng-container *ngIf="data.status && data.date">
<dt>{{ data.status.label }}</dt>
<dd>
<span class="tw-capitalize">

View File

@ -5,11 +5,11 @@ import { OrganizationSubscriptionResponse } from "@bitwarden/common/billing/mode
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
type ComponentData = {
status: {
status?: {
label: string;
value: string;
};
date: {
date?: {
label: string;
value: string;
};
@ -44,13 +44,15 @@ export class SubscriptionStatusComponent {
}
get status(): string {
return this.subscription.status != "canceled" && this.subscription.cancelAtEndDate
? "pending_cancellation"
: this.subscription.status;
return this.subscription
? this.subscription.status != "canceled" && this.subscription.cancelAtEndDate
? "pending_cancellation"
: this.subscription.status
: "free";
}
get subscription() {
return this.organizationSubscriptionResponse.subscription;
return this.organizationSubscriptionResponse?.subscription;
}
get data(): ComponentData {
@ -61,6 +63,9 @@ export class SubscriptionStatusComponent {
const cancellationDateLabel = this.i18nService.t("cancellationDate");
switch (this.status) {
case "free": {
return {};
}
case "trialing": {
return {
status: {