Browse Source

feat(client): set paths for home pages

pull/4711/head
KenTandrian 3 months ago
parent
commit
99f0a90abe
  1. 5
      apps/client/src/app/core/paths.ts
  2. 14
      apps/client/src/app/pages/home/home-page-routing.module.ts
  3. 11
      apps/client/src/app/pages/home/home-page.component.ts

5
apps/client/src/app/core/paths.ts

@ -9,8 +9,11 @@ export const paths = {
fire: 'fire', fire: 'fire',
guides: $localize`:snake-case:guides`, guides: $localize`:snake-case:guides`,
glossary: $localize`:snake-case:glossary`, glossary: $localize`:snake-case:glossary`,
holdings: 'holdings',
home: 'home',
jobs: 'jobs', jobs: 'jobs',
license: $localize`:snake-case:license`, license: $localize`:snake-case:license`,
market: 'market',
marketData: 'market-data', marketData: 'market-data',
markets: $localize`:snake-case:markets`, markets: $localize`:snake-case:markets`,
ossFriends: $localize`:snake-case:oss-friends`, ossFriends: $localize`:snake-case:oss-friends`,
@ -20,7 +23,9 @@ export const paths = {
register: $localize`:snake-case:register`, register: $localize`:snake-case:register`,
resources: $localize`:snake-case:resources`, resources: $localize`:snake-case:resources`,
settings: 'settings', settings: 'settings',
summary: 'summary',
termsOfService: $localize`:snake-case:terms-of-service`, termsOfService: $localize`:snake-case:terms-of-service`,
users: 'users', users: 'users',
watchlist: 'watchlist',
xRay: 'x-ray' xRay: 'x-ray'
}; };

14
apps/client/src/app/pages/home/home-page-routing.module.ts

@ -4,6 +4,7 @@ import { HomeOverviewComponent } from '@ghostfolio/client/components/home-overvi
import { HomeSummaryComponent } from '@ghostfolio/client/components/home-summary/home-summary.component'; import { HomeSummaryComponent } from '@ghostfolio/client/components/home-summary/home-summary.component';
import { HomeWatchlistComponent } from '@ghostfolio/client/components/home-watchlist/home-watchlist.component'; import { HomeWatchlistComponent } from '@ghostfolio/client/components/home-watchlist/home-watchlist.component';
import { AuthGuard } from '@ghostfolio/client/core/auth.guard'; import { AuthGuard } from '@ghostfolio/client/core/auth.guard';
import { paths } from '@ghostfolio/client/core/paths';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router'; import { RouterModule, Routes } from '@angular/router';
@ -19,27 +20,22 @@ const routes: Routes = [
component: HomeOverviewComponent component: HomeOverviewComponent
}, },
{ {
path: 'holdings', path: paths.holdings,
component: HomeHoldingsComponent, component: HomeHoldingsComponent,
title: $localize`Holdings` title: $localize`Holdings`
}, },
{ {
path: 'holdings', path: paths.summary,
component: HomeHoldingsComponent,
title: $localize`Holdings`
},
{
path: 'summary',
component: HomeSummaryComponent, component: HomeSummaryComponent,
title: $localize`Summary` title: $localize`Summary`
}, },
{ {
path: 'market', path: paths.market,
component: HomeMarketComponent, component: HomeMarketComponent,
title: $localize`Markets` title: $localize`Markets`
}, },
{ {
path: 'watchlist', path: paths.watchlist,
component: HomeWatchlistComponent, component: HomeWatchlistComponent,
title: $localize`Watchlist` title: $localize`Watchlist`
} }

11
apps/client/src/app/pages/home/home-page.component.ts

@ -1,3 +1,4 @@
import { paths } from '@ghostfolio/client/core/paths';
import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service'; import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service';
import { UserService } from '@ghostfolio/client/services/user/user.service'; import { UserService } from '@ghostfolio/client/services/user/user.service';
import { TabConfiguration, User } from '@ghostfolio/common/interfaces'; import { TabConfiguration, User } from '@ghostfolio/common/interfaces';
@ -36,27 +37,27 @@ export class HomePageComponent implements OnDestroy, OnInit {
{ {
iconName: 'analytics-outline', iconName: 'analytics-outline',
label: $localize`Overview`, label: $localize`Overview`,
path: ['/home'] path: ['/' + paths.home]
}, },
{ {
iconName: 'wallet-outline', iconName: 'wallet-outline',
label: $localize`Holdings`, label: $localize`Holdings`,
path: ['/home', 'holdings'] path: ['/' + paths.home, paths.holdings]
}, },
{ {
iconName: 'reader-outline', iconName: 'reader-outline',
label: $localize`Summary`, label: $localize`Summary`,
path: ['/home', 'summary'] path: ['/' + paths.home, paths.summary]
}, },
{ {
iconName: 'bookmark-outline', iconName: 'bookmark-outline',
label: $localize`Watchlist`, label: $localize`Watchlist`,
path: ['/home', 'watchlist'] path: ['/' + paths.home, paths.watchlist]
}, },
{ {
iconName: 'newspaper-outline', iconName: 'newspaper-outline',
label: $localize`Markets`, label: $localize`Markets`,
path: ['/home', 'market'] path: ['/' + paths.home, paths.market]
} }
]; ];

Loading…
Cancel
Save