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:
parent
775c8a1bbe
commit
9f8f93ef97
@ -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">
|
||||
|
@ -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: {
|
||||
|
Loading…
Reference in New Issue
Block a user