Browse Source
Feature/refactor public routes: oss-friends (#4928)
* Refactor public routes: oss-friends
pull/4930/head
Thomas Kaul
2 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with
25 additions and
9 deletions
-
apps/client/src/app/pages/about/about-page-routing.module.ts
-
apps/client/src/app/pages/about/about-page.component.ts
-
apps/client/src/app/pages/about/oss-friends/oss-friends-page-routing.module.ts
-
apps/client/src/app/pages/blog/2023/08/ghostfolio-joins-oss-friends/ghostfolio-joins-oss-friends-page.component.ts
-
libs/common/src/lib/routes/routes.ts
|
|
@ -1,5 +1,8 @@ |
|
|
|
import { AuthGuard } from '@ghostfolio/client/core/auth.guard'; |
|
|
|
import { routes as ghostfolioRoutes } from '@ghostfolio/common/routes/routes'; |
|
|
|
import { |
|
|
|
routes as ghostfolioRoutes, |
|
|
|
publicRoutes |
|
|
|
} from '@ghostfolio/common/routes/routes'; |
|
|
|
|
|
|
|
import { NgModule } from '@angular/core'; |
|
|
|
import { RouterModule, Routes } from '@angular/router'; |
|
|
@ -32,7 +35,7 @@ const routes: Routes = [ |
|
|
|
) |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: ghostfolioRoutes.ossFriends, |
|
|
|
path: publicRoutes.about.subRoutes.ossFriends.path, |
|
|
|
loadChildren: () => |
|
|
|
import('./oss-friends/oss-friends-page.module').then( |
|
|
|
(m) => m.OpenSourceSoftwareFriendsPageModule |
|
|
|
|
|
@ -2,7 +2,7 @@ import { DataService } from '@ghostfolio/client/services/data.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 { routes } from '@ghostfolio/common/routes/routes'; |
|
|
|
import { publicRoutes, routes } from '@ghostfolio/common/routes/routes'; |
|
|
|
|
|
|
|
import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; |
|
|
|
import { DeviceDetectorService } from 'ngx-device-detector'; |
|
|
@ -81,8 +81,8 @@ export class AboutPageComponent implements OnDestroy, OnInit { |
|
|
|
|
|
|
|
this.tabs.push({ |
|
|
|
iconName: 'happy-outline', |
|
|
|
label: 'OSS Friends', |
|
|
|
path: ['/' + routes.about, routes.ossFriends] |
|
|
|
label: publicRoutes.about.subRoutes.ossFriends.title, |
|
|
|
path: publicRoutes.about.subRoutes.ossFriends.routerLink |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
@ -1,4 +1,5 @@ |
|
|
|
import { AuthGuard } from '@ghostfolio/client/core/auth.guard'; |
|
|
|
import { publicRoutes } from '@ghostfolio/common/routes/routes'; |
|
|
|
|
|
|
|
import { NgModule } from '@angular/core'; |
|
|
|
import { RouterModule, Routes } from '@angular/router'; |
|
|
@ -10,7 +11,7 @@ const routes: Routes = [ |
|
|
|
canActivate: [AuthGuard], |
|
|
|
component: OpenSourceSoftwareFriendsPageComponent, |
|
|
|
path: '', |
|
|
|
title: 'OSS Friends' |
|
|
|
title: publicRoutes.about.subRoutes.ossFriends.title |
|
|
|
} |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
@ -1,4 +1,4 @@ |
|
|
|
import { routes } from '@ghostfolio/common/routes/routes'; |
|
|
|
import { publicRoutes, routes } from '@ghostfolio/common/routes/routes'; |
|
|
|
|
|
|
|
import { Component } from '@angular/core'; |
|
|
|
import { MatButtonModule } from '@angular/material/button'; |
|
|
@ -11,6 +11,7 @@ import { RouterModule } from '@angular/router'; |
|
|
|
templateUrl: './ghostfolio-joins-oss-friends-page.html' |
|
|
|
}) |
|
|
|
export class GhostfolioJoinsOssFriendsPageComponent { |
|
|
|
public routerLinkAboutOssFriends = ['/' + routes.about, routes.ossFriends]; |
|
|
|
public routerLinkAboutOssFriends = |
|
|
|
publicRoutes.about.subRoutes.ossFriends.routerLink; |
|
|
|
public routerLinkBlog = ['/' + routes.blog]; |
|
|
|
} |
|
|
|
|
|
@ -31,7 +31,6 @@ export const routes = { |
|
|
|
license: $localize`:kebab-case:license`, |
|
|
|
markets: $localize`:kebab-case:markets`, |
|
|
|
openSourceAlternativeTo: $localize`:kebab-case:open-source-alternative-to`, |
|
|
|
ossFriends: 'oss-friends', |
|
|
|
pricing: $localize`:kebab-case:pricing`, |
|
|
|
privacyPolicy: $localize`:kebab-case:privacy-policy`, |
|
|
|
resources: $localize`:kebab-case:resources`, |
|
|
@ -120,6 +119,18 @@ export const internalRoutes: Record<string, IRoute> = { |
|
|
|
}; |
|
|
|
|
|
|
|
export const publicRoutes = { |
|
|
|
about: { |
|
|
|
path: $localize`:kebab-case:about`, |
|
|
|
routerLink: ['/' + $localize`:kebab-case:about`], |
|
|
|
subRoutes: { |
|
|
|
ossFriends: { |
|
|
|
path: 'oss-friends', |
|
|
|
routerLink: ['/' + $localize`:kebab-case:about`, 'oss-friends'], |
|
|
|
title: 'OSS Friends' |
|
|
|
} |
|
|
|
}, |
|
|
|
title: $localize`About` |
|
|
|
}, |
|
|
|
features: { |
|
|
|
path: $localize`:kebab-case:features`, |
|
|
|
routerLink: ['/' + $localize`:kebab-case:features`], |
|
|
|