Skip to content

Commit

Permalink
[PM-11417] Customers' Expiration Date in Admin Console changing to ne…
Browse files Browse the repository at this point in the history
…xt invoice date when Pending Invoice items exist (#10774)

* Resolve the wrong subscription expiration date

* Refactor the change to include flag

* refactor the change to consider the flag

* Resolve the year bug for all subscription

* Changes for the premium user

* resolve the premium issue
  • Loading branch information
cyprain-okeke authored Sep 5, 2024
1 parent b2966b1 commit 8eef46a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
}}</span>
</dd>
<dt>{{ "nextCharge" | i18n }}</dt>
<dd>
<dd *ngIf="!enableTimeThreshold">
{{
nextInvoice
? (nextInvoice.date | date: "mediumDate") +
Expand All @@ -57,6 +57,15 @@
: "-"
}}
</dd>
<dd *ngIf="enableTimeThreshold">
{{
nextInvoice
? (sub.subscription.periodEndDate | date: "mediumDate") +
", " +
(nextInvoice.amount | currency: "$")
: "-"
}}
</dd>
</dl>
</div>
<div class="tw-w-2/3" *ngIf="subscription">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,13 @@ export class UserSubscriptionComponent implements OnInit {
sub: SubscriptionResponse;
selfHosted = false;
cloudWebVaultUrl: string;
enableTimeThreshold: boolean;

cancelPromise: Promise<any>;
reinstatePromise: Promise<any>;
protected enableTimeThreshold$ = this.configService.getFeatureFlag$(
FeatureFlag.EnableTimeThreshold,
);

protected deprecateStripeSourcesAPI$ = this.configService.getFeatureFlag$(
FeatureFlag.AC2476_DeprecateStripeSourcesAPI,
Expand All @@ -67,6 +71,7 @@ export class UserSubscriptionComponent implements OnInit {
async ngOnInit() {
this.cloudWebVaultUrl = await firstValueFrom(this.environmentService.cloudWebVaultUrl$);
await this.load();
this.enableTimeThreshold = await firstValueFrom(this.enableTimeThreshold$);
this.firstLoaded = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@
<dt [ngClass]="{ 'tw-text-danger': isExpired }">
{{ "subscriptionExpiration" | i18n }}
</dt>
<dd [ngClass]="{ 'tw-text-danger': isExpired }">
<dd [ngClass]="{ 'tw-text-danger': isExpired }" *ngIf="!enableTimeThreshold">
{{ nextInvoice ? (nextInvoice.date | date: "mediumDate") : "-" }}
</dd>
<dd [ngClass]="{ 'tw-text-danger': isExpired }" *ngIf="enableTimeThreshold">
{{ nextInvoice ? (sub.subscription.periodEndDate | date: "mediumDate") : "-" }}
</dd>
</ng-container>
</dl>
</ng-container>
Expand Down

0 comments on commit 8eef46a

Please sign in to comment.