|
|
@ -1,6 +1,7 @@ |
|
|
|
import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service'; |
|
|
|
import { UserService } from '@ghostfolio/client/services/user/user.service'; |
|
|
|
import { TabConfiguration, User } from '@ghostfolio/common/interfaces'; |
|
|
|
import { hasPermission, permissions } from '@ghostfolio/common/permissions'; |
|
|
|
import { internalRoutes } from '@ghostfolio/common/routes/routes'; |
|
|
|
|
|
|
|
import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; |
|
|
@ -33,6 +34,8 @@ export class HomePageComponent implements OnDestroy, OnInit { |
|
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
|
.subscribe((state) => { |
|
|
|
if (state?.user) { |
|
|
|
this.user = state.user; |
|
|
|
|
|
|
|
this.tabs = [ |
|
|
|
{ |
|
|
|
iconName: 'analytics-outline', |
|
|
@ -56,18 +59,22 @@ export class HomePageComponent implements OnDestroy, OnInit { |
|
|
|
}, |
|
|
|
{ |
|
|
|
iconName: 'newspaper-outline', |
|
|
|
label: internalRoutes.home.subRoutes.markets.title, |
|
|
|
routerLink: internalRoutes.home.subRoutes.markets.routerLink |
|
|
|
}, |
|
|
|
{ |
|
|
|
iconName: 'newspaper-outline', |
|
|
|
label: internalRoutes.home.subRoutes.markets.title + ' (new)', |
|
|
|
routerLink: ['/home', 'markets-new'] // TODO
|
|
|
|
label: hasPermission( |
|
|
|
this.user?.permissions, |
|
|
|
permissions.readMarketDataOfMarkets |
|
|
|
) |
|
|
|
? internalRoutes.home.subRoutes.marketsPremium.title |
|
|
|
: internalRoutes.home.subRoutes.markets.title, |
|
|
|
|
|
|
|
routerLink: hasPermission( |
|
|
|
this.user?.permissions, |
|
|
|
permissions.readMarketDataOfMarkets |
|
|
|
) |
|
|
|
? internalRoutes.home.subRoutes.marketsPremium.routerLink |
|
|
|
: internalRoutes.home.subRoutes.markets.routerLink |
|
|
|
} |
|
|
|
]; |
|
|
|
|
|
|
|
this.user = state.user; |
|
|
|
|
|
|
|
this.changeDetectorRef.markForCheck(); |
|
|
|
} |
|
|
|
}); |
|
|
|