Skip to content

Commit

Permalink
fix(subscriptions): Cope with "no active subscriptions" with link
Browse files Browse the repository at this point in the history
  • Loading branch information
castaway committed Jan 17, 2024
1 parent cc61c1a commit 1d41126
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/app/account-app/account-renewals.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
<h1> Your Subscriptions </h1>

<div *ngIf="quota_usage | async as q_usage; else usageLoading">
<div *ngIf="active_products.length === 0; else productsTable">
<div *ngIf="!loadedProducts; else productsTable">
<app-runbox-loading text="Loading your subscriptions...">
</app-runbox-loading>
</div>

<ng-template #productsTable>
<ng-container *ngIf="active_products.length > 0; else buyPlans">

<p>
These are the subscriptions associated with your account. You may renew any of them at any time, which will add the new period to the end of your current subscription.
Expand Down Expand Up @@ -159,8 +160,15 @@ <h1> Your Subscriptions </h1>
<tr mat-footer-row *matFooterRowDef="['renewal_name']"></tr>
</table>

</ng-container>
</ng-template>
</div>

<ng-template #buyPlans>
<p>You do not have any of our currently available products.</p>
<p>Please visit <a routerLink='/account/plans'>Plans & Upgrades</a> to subscribe.</p>
</ng-template>

<ng-template #usageLoading>
<app-runbox-loading text="Loading your usage to tailor page...">
</app-runbox-loading>
Expand Down
3 changes: 3 additions & 0 deletions src/app/account-app/account-renewals.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export class AccountRenewalsComponent {
all_products: ActiveProduct[] = [];
current_subscription: number;

loadedProducts = false;

displayedColumns: string[];
expandedProduct: ActiveProduct;
showExpired = false;
Expand Down Expand Up @@ -99,6 +101,7 @@ export class AccountRenewalsComponent {
this.cart.contains(p.pid, p.apid).then(ordered => p.ordered = ordered);
}
});
this.loadedProducts = true;
});

this.displayedColumns = this.mobileQuery.matches ? columnsMobile : columnsDefault;
Expand Down

0 comments on commit 1d41126

Please sign in to comment.