From 2083d28d02a509cfd5b1297e4af7489d188e9300 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sun, 22 Aug 2021 10:25:34 +0200 Subject: [PATCH] Feature/minor improvements in the page components (#310) * Move permissions to constructor * Sort imports --- .../src/app/pages/about/about-page.component.ts | 12 ++++++------ .../allocations/allocations-page.component.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/client/src/app/pages/about/about-page.component.ts b/apps/client/src/app/pages/about/about-page.component.ts index 4a7cb6071..8fe70607c 100644 --- a/apps/client/src/app/pages/about/about-page.component.ts +++ b/apps/client/src/app/pages/about/about-page.component.ts @@ -35,12 +35,7 @@ export class AboutPageComponent implements OnDestroy, OnInit { private changeDetectorRef: ChangeDetectorRef, private dataService: DataService, private userService: UserService - ) {} - - /** - * Initializes the controller - */ - public ngOnInit() { + ) { const { globalPermissions, statistics } = this.dataService.fetchInfo(); this.hasPermissionForBlog = hasPermission( @@ -59,7 +54,12 @@ export class AboutPageComponent implements OnDestroy, OnInit { ); this.statistics = statistics; + } + /** + * Initializes the controller + */ + public ngOnInit() { this.userService.stateChanged .pipe(takeUntil(this.unsubscribeSubject)) .subscribe((state) => { diff --git a/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts b/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts index cec11e5de..b44822832 100644 --- a/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts +++ b/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts @@ -3,7 +3,7 @@ import { ToggleOption } from '@ghostfolio/client/components/toggle/interfaces/to import { DataService } from '@ghostfolio/client/services/data.service'; import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; -import { ghostfolioCashSymbol, UNKNOWN_KEY } from '@ghostfolio/common/config'; +import { UNKNOWN_KEY, ghostfolioCashSymbol } from '@ghostfolio/common/config'; import { PortfolioDetails, PortfolioPosition,