Bugfix/fix upgrade vs. renew subscription button labels (#4549)
* Fix upgrade vs. renew subscription button labels
This commit is contained in:
parent
5e64de6650
commit
07ad7f2817
@ -183,8 +183,8 @@ export class SubscriptionService {
|
||||
});
|
||||
|
||||
return {
|
||||
expiresAt,
|
||||
offer,
|
||||
expiresAt: isBefore(new Date(), expiresAt) ? expiresAt : undefined,
|
||||
type: isBefore(new Date(), expiresAt)
|
||||
? SubscriptionType.Premium
|
||||
: SubscriptionType.Basic
|
||||
@ -210,10 +210,15 @@ export class SubscriptionService {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const offers =
|
||||
const offers: {
|
||||
[offer in SubscriptionOfferKey]: SubscriptionOffer;
|
||||
} =
|
||||
((await this.propertyService.getByKey(PROPERTY_STRIPE_CONFIG)) as any) ??
|
||||
{};
|
||||
|
||||
return offers[key];
|
||||
return {
|
||||
...offers[key],
|
||||
isRenewal: key.startsWith('renewal')
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -181,14 +181,10 @@
|
||||
<a class="d-flex" mat-menu-item [routerLink]="routerLinkPricing"
|
||||
><span class="align-items-center d-flex"
|
||||
><span>
|
||||
@if (user.subscription.offer === 'default') {
|
||||
<ng-container i18n>Upgrade Plan</ng-container>
|
||||
} @else if (
|
||||
user.subscription.offer === 'renewal' ||
|
||||
user.subscription.offer === 'renewal-early-bird-2023' ||
|
||||
user.subscription.offer === 'renewal-early-bird-2024'
|
||||
) {
|
||||
@if (user.subscription.offer.isRenewal) {
|
||||
<ng-container i18n>Renew Plan</ng-container>
|
||||
} @else {
|
||||
<ng-container i18n>Upgrade Plan</ng-container>
|
||||
}
|
||||
</span>
|
||||
<gf-premium-indicator
|
||||
|
@ -14,14 +14,10 @@
|
||||
hasPermissionForSubscription && hasPermissionToUpdateUserSettings
|
||||
) {
|
||||
<button color="primary" mat-flat-button (click)="onCheckout()">
|
||||
@if (user.subscription.offer === 'default') {
|
||||
<ng-container i18n>Upgrade Plan</ng-container>
|
||||
} @else if (
|
||||
user.subscription.offer === 'renewal' ||
|
||||
user.subscription.offer === 'renewal-early-bird-2023' ||
|
||||
user.subscription.offer === 'renewal-early-bird-2024'
|
||||
) {
|
||||
@if (user.subscription.offer.isRenewal) {
|
||||
<ng-container i18n>Renew Plan</ng-container>
|
||||
} @else {
|
||||
<ng-container i18n>Upgrade Plan</ng-container>
|
||||
}
|
||||
</button>
|
||||
@if (price) {
|
||||
|
@ -306,14 +306,10 @@
|
||||
mat-flat-button
|
||||
(click)="onCheckout()"
|
||||
>
|
||||
@if (user.subscription.offer === 'default') {
|
||||
<ng-container i18n>Upgrade Plan</ng-container>
|
||||
} @else if (
|
||||
user.subscription.offer === 'renewal' ||
|
||||
user.subscription.offer === 'renewal-early-bird-2023' ||
|
||||
user.subscription.offer === 'renewal-early-bird-2024'
|
||||
) {
|
||||
@if (user.subscription.offer.isRenewal) {
|
||||
<ng-container i18n>Renew Plan</ng-container>
|
||||
} @else {
|
||||
<ng-container i18n>Upgrade Plan</ng-container>
|
||||
}
|
||||
</button>
|
||||
<p class="m-0 text-muted">
|
||||
|
@ -4,6 +4,7 @@ export interface SubscriptionOffer {
|
||||
coupon?: number;
|
||||
couponId?: string;
|
||||
durationExtension?: StringValue;
|
||||
isRenewal?: boolean;
|
||||
label?: string;
|
||||
price: number;
|
||||
priceId: string;
|
||||
|
Loading…
x
Reference in New Issue
Block a user