|
@ -2,6 +2,7 @@ import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; |
|
|
import { DataService } from '@ghostfolio/client/services/data.service'; |
|
|
import { DataService } from '@ghostfolio/client/services/data.service'; |
|
|
import { UserService } from '@ghostfolio/client/services/user/user.service'; |
|
|
import { UserService } from '@ghostfolio/client/services/user/user.service'; |
|
|
import { User } from '@ghostfolio/common/interfaces'; |
|
|
import { User } from '@ghostfolio/common/interfaces'; |
|
|
|
|
|
import { hasPermission, permissions } from '@ghostfolio/common/permissions'; |
|
|
import { translate } from '@ghostfolio/ui/i18n'; |
|
|
import { translate } from '@ghostfolio/ui/i18n'; |
|
|
import { StripeService } from 'ngx-stripe'; |
|
|
import { StripeService } from 'ngx-stripe'; |
|
|
import { Subject } from 'rxjs'; |
|
|
import { Subject } from 'rxjs'; |
|
@ -17,6 +18,7 @@ export class PricingPageComponent implements OnDestroy, OnInit { |
|
|
public baseCurrency: string; |
|
|
public baseCurrency: string; |
|
|
public coupon: number; |
|
|
public coupon: number; |
|
|
public couponId: string; |
|
|
public couponId: string; |
|
|
|
|
|
public hasPermissionToUpdateUserSettings: boolean; |
|
|
public importAndExportTooltipBasic = translate( |
|
|
public importAndExportTooltipBasic = translate( |
|
|
'DATA_IMPORT_AND_EXPORT_TOOLTIP_BASIC' |
|
|
'DATA_IMPORT_AND_EXPORT_TOOLTIP_BASIC' |
|
|
); |
|
|
); |
|
@ -55,6 +57,11 @@ export class PricingPageComponent implements OnDestroy, OnInit { |
|
|
if (state?.user) { |
|
|
if (state?.user) { |
|
|
this.user = state.user; |
|
|
this.user = state.user; |
|
|
|
|
|
|
|
|
|
|
|
this.hasPermissionToUpdateUserSettings = hasPermission( |
|
|
|
|
|
this.user.permissions, |
|
|
|
|
|
permissions.updateUserSettings |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
this.coupon = subscriptions?.[this.user?.subscription?.offer]?.coupon; |
|
|
this.coupon = subscriptions?.[this.user?.subscription?.offer]?.coupon; |
|
|
this.couponId = |
|
|
this.couponId = |
|
|
subscriptions?.[this.user.subscription.offer]?.couponId; |
|
|
subscriptions?.[this.user.subscription.offer]?.couponId; |
|
|