Browse Source

feat(client): set paths for admin and portfolio pages

pull/4711/head
KenTandrian 3 months ago
parent
commit
598b2ec84a
  1. 4
      apps/client/src/app/app-routing.module.ts
  2. 12
      apps/client/src/app/core/paths.ts
  3. 9
      apps/client/src/app/pages/admin/admin-page-routing.module.ts
  4. 11
      apps/client/src/app/pages/admin/admin-page.component.ts
  5. 9
      apps/client/src/app/pages/portfolio/portfolio-page-routing.module.ts
  6. 11
      apps/client/src/app/pages/portfolio/portfolio-page.component.ts

4
apps/client/src/app/app-routing.module.ts

@ -28,7 +28,7 @@ const routes: Routes = [
)
},
{
path: 'admin',
path: paths.admin,
loadChildren: () =>
import('./pages/admin/admin-page.module').then((m) => m.AdminPageModule)
},
@ -107,7 +107,7 @@ const routes: Routes = [
)
},
{
path: 'portfolio',
path: paths.portfolio,
loadChildren: () =>
import('./pages/portfolio/portfolio-page.module').then(
(m) => m.PortfolioPageModule

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

@ -1,16 +1,26 @@
export const paths = {
about: $localize`:snake-case:about`,
activities: 'activities',
admin: 'admin',
allocations: 'allocations',
changelog: $localize`:snake-case:changelog`,
faq: $localize`:snake-case:faq`,
features: $localize`:snake-case:features`,
fire: 'fire',
guides: $localize`:snake-case:guides`,
glossary: $localize`:snake-case:glossary`,
jobs: 'jobs',
license: $localize`:snake-case:license`,
marketData: 'market-data',
markets: $localize`:snake-case:markets`,
ossFriends: $localize`:snake-case:oss-friends`,
portfolio: 'portfolio',
pricing: $localize`:snake-case:pricing`,
privacyPolicy: $localize`:snake-case:privacy-policy`,
register: $localize`:snake-case:register`,
resources: $localize`:snake-case:resources`,
termsOfService: $localize`:snake-case:terms-of-service`
settings: 'settings',
termsOfService: $localize`:snake-case:terms-of-service`,
users: 'users',
xRay: 'x-ray'
};

9
apps/client/src/app/pages/admin/admin-page-routing.module.ts

@ -4,6 +4,7 @@ import { AdminOverviewComponent } from '@ghostfolio/client/components/admin-over
import { AdminSettingsComponent } from '@ghostfolio/client/components/admin-settings/admin-settings.component';
import { AdminUsersComponent } from '@ghostfolio/client/components/admin-users/admin-users.component';
import { AuthGuard } from '@ghostfolio/client/core/auth.guard';
import { paths } from '@ghostfolio/client/core/paths';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
@ -20,22 +21,22 @@ const routes: Routes = [
title: $localize`Admin Control`
},
{
path: 'jobs',
path: paths.jobs,
component: AdminJobsComponent,
title: $localize`Job Queue`
},
{
path: 'market-data',
path: paths.marketData,
component: AdminMarketDataComponent,
title: $localize`Market Data`
},
{
path: 'settings',
path: paths.settings,
component: AdminSettingsComponent,
title: $localize`Settings`
},
{
path: 'users',
path: paths.users,
component: AdminUsersComponent,
title: $localize`Users`
}

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

@ -1,3 +1,4 @@
import { paths } from '@ghostfolio/client/core/paths';
import { TabConfiguration } from '@ghostfolio/common/interfaces';
import { Component, OnDestroy, OnInit } from '@angular/core';
@ -26,27 +27,27 @@ export class AdminPageComponent implements OnDestroy, OnInit {
{
iconName: 'reader-outline',
label: $localize`Overview`,
path: ['/admin']
path: ['/' + paths.admin]
},
{
iconName: 'settings-outline',
label: $localize`Settings`,
path: ['/admin', 'settings']
path: ['/' + paths.admin, paths.settings]
},
{
iconName: 'server-outline',
label: $localize`Market Data`,
path: ['/admin', 'market-data']
path: ['/' + paths.admin, paths.marketData]
},
{
iconName: 'flash-outline',
label: $localize`Job Queue`,
path: ['/admin', 'jobs']
path: ['/' + paths.admin, paths.jobs]
},
{
iconName: 'people-outline',
label: $localize`Users`,
path: ['/admin', 'users']
path: ['/' + paths.admin, paths.users]
}
];
}

9
apps/client/src/app/pages/portfolio/portfolio-page-routing.module.ts

@ -1,4 +1,5 @@
import { AuthGuard } from '@ghostfolio/client/core/auth.guard';
import { paths } from '@ghostfolio/client/core/paths';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
@ -17,26 +18,26 @@ const routes: Routes = [
)
},
{
path: 'activities',
path: paths.activities,
loadChildren: () =>
import('./activities/activities-page.module').then(
(m) => m.ActivitiesPageModule
)
},
{
path: 'allocations',
path: paths.allocations,
loadChildren: () =>
import('./allocations/allocations-page.module').then(
(m) => m.AllocationsPageModule
)
},
{
path: 'fire',
path: paths.fire,
loadChildren: () =>
import('./fire/fire-page.module').then((m) => m.FirePageModule)
},
{
path: 'x-ray',
path: paths.xRay,
loadChildren: () =>
import('./x-ray/x-ray-page.module').then((m) => m.XRayPageModule)
}

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

@ -1,3 +1,4 @@
import { paths } from '@ghostfolio/client/core/paths';
import { UserService } from '@ghostfolio/client/services/user/user.service';
import { TabConfiguration, User } from '@ghostfolio/common/interfaces';
@ -33,27 +34,27 @@ export class PortfolioPageComponent implements OnDestroy, OnInit {
{
iconName: 'analytics-outline',
label: $localize`Analysis`,
path: ['/portfolio']
path: ['/' + paths.portfolio]
},
{
iconName: 'swap-vertical-outline',
label: $localize`Activities`,
path: ['/portfolio', 'activities']
path: ['/' + paths.portfolio, paths.activities]
},
{
iconName: 'pie-chart-outline',
label: $localize`Allocations`,
path: ['/portfolio', 'allocations']
path: ['/' + paths.portfolio, paths.allocations]
},
{
iconName: 'calculator-outline',
label: 'FIRE ',
path: ['/portfolio', 'fire']
path: ['/' + paths.portfolio, paths.fire]
},
{
iconName: 'scan-outline',
label: 'X-ray',
path: ['/portfolio', 'x-ray']
path: ['/' + paths.portfolio, paths.xRay]
}
];
this.user = state.user;

Loading…
Cancel
Save