|
@ -1,4 +1,7 @@ |
|
|
import { Component, OnInit } from '@angular/core'; |
|
|
import { Component, OnInit } from '@angular/core'; |
|
|
|
|
|
import { DataService } from '@ghostfolio/client/services/data.service'; |
|
|
|
|
|
import { InfoItem } from '@ghostfolio/common/interfaces'; |
|
|
|
|
|
import { hasPermission, permissions } from '@ghostfolio/common/permissions'; |
|
|
import { Subject } from 'rxjs'; |
|
|
import { Subject } from 'rxjs'; |
|
|
|
|
|
|
|
|
@Component({ |
|
|
@Component({ |
|
@ -8,11 +11,21 @@ import { Subject } from 'rxjs'; |
|
|
templateUrl: './resources-page.html' |
|
|
templateUrl: './resources-page.html' |
|
|
}) |
|
|
}) |
|
|
export class ResourcesPageComponent implements OnInit { |
|
|
export class ResourcesPageComponent implements OnInit { |
|
|
|
|
|
public hasPermissionForSubscription: boolean; |
|
|
|
|
|
public info: InfoItem; |
|
|
|
|
|
|
|
|
private unsubscribeSubject = new Subject<void>(); |
|
|
private unsubscribeSubject = new Subject<void>(); |
|
|
|
|
|
|
|
|
public constructor() {} |
|
|
public constructor(private dataService: DataService) { |
|
|
|
|
|
this.info = this.dataService.fetchInfo(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public ngOnInit() {} |
|
|
public ngOnInit() { |
|
|
|
|
|
this.hasPermissionForSubscription = hasPermission( |
|
|
|
|
|
this.info?.globalPermissions, |
|
|
|
|
|
permissions.enableSubscription |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public ngOnDestroy() { |
|
|
public ngOnDestroy() { |
|
|
this.unsubscribeSubject.next(); |
|
|
this.unsubscribeSubject.next(); |
|
|