From 1484d52293460d5742cd71904099239d5479da72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Panzar?= Date: Sun, 27 Sep 2020 20:42:29 +0200 Subject: [PATCH] Migrate to latest Play version - addresses #92 Fixes admin app. --- .../translatr-admin/src/app/app.component.ts | 1 - .../dashboard-page-routing.module.ts | 91 ++++++++++--------- .../dashboard-page.component.ts | 2 +- .../utils/src/lib/routing/name-icon-route.ts | 1 + 4 files changed, 49 insertions(+), 46 deletions(-) diff --git a/ui/apps/translatr-admin/src/app/app.component.ts b/ui/apps/translatr-admin/src/app/app.component.ts index 1721a523..74c5e8ab 100644 --- a/ui/apps/translatr-admin/src/app/app.component.ts +++ b/ui/apps/translatr-admin/src/app/app.component.ts @@ -9,7 +9,6 @@ import { AppFacade } from './+state/app.facade'; }) export class AppComponent { constructor(readonly facade: AppFacade, readonly translocoService: TranslocoService) { - facade.loadMe(); facade.me$ .pipe(filter(x => !!x && !!x.preferredLanguage)) .subscribe(me => translocoService.setActiveLang(me.preferredLanguage)); diff --git a/ui/apps/translatr-admin/src/app/modules/pages/dashboard-page/dashboard-page-routing.module.ts b/ui/apps/translatr-admin/src/app/modules/pages/dashboard-page/dashboard-page-routing.module.ts index ac2db74b..06775d4c 100644 --- a/ui/apps/translatr-admin/src/app/modules/pages/dashboard-page/dashboard-page-routing.module.ts +++ b/ui/apps/translatr-admin/src/app/modules/pages/dashboard-page/dashboard-page-routing.module.ts @@ -14,56 +14,59 @@ export const routes: Routes = [ { component: DashboardPageComponent, path: '', - canActivate: [AuthGuard] - }, - { - component: DashboardInfoComponent, - path: '', - data: { - icon: 'view_quilt', - name: 'Dashboard' - } - }, - { - path: 'users', - data: { - icon: 'group', - name: 'Users' - }, + canActivate: [AuthGuard], children: [ { - component: DashboardUsersComponent, - path: '' + component: DashboardInfoComponent, + path: '', + data: { + icon: 'view_quilt', + name: 'Dashboard' + } + }, + { + path: 'users', + data: { + icon: 'group', + name: 'Users' + }, + children: [ + { + component: DashboardUsersComponent, + path: '', + pathMatch: 'full' + }, + { + component: DashboardUserComponent, + path: ':id' + } + ] + }, + { + component: DashboardProjectsComponent, + path: 'projects', + data: { + icon: 'library_books', + name: 'Projects' + } + }, + { + component: DashboardAccessTokensComponent, + path: 'accesstokens', + data: { + icon: 'vpn_key', + name: 'Access Tokens' + } }, { - component: DashboardUserComponent, - path: ':id' + component: DashboardFeatureFlagsComponent, + path: 'featureflags', + data: { + icon: 'flag', + name: 'Feature Flags' + } } ] - }, - { - component: DashboardProjectsComponent, - path: 'projects', - data: { - icon: 'library_books', - name: 'Projects' - } - }, - { - component: DashboardAccessTokensComponent, - path: 'accesstokens', - data: { - icon: 'vpn_key', - name: 'Access Tokens' - } - }, - { - component: DashboardFeatureFlagsComponent, - path: 'featureflags', - data: { - icon: 'flag', - name: 'Feature Flags' - } } ]; diff --git a/ui/apps/translatr-admin/src/app/modules/pages/dashboard-page/dashboard-page.component.ts b/ui/apps/translatr-admin/src/app/modules/pages/dashboard-page/dashboard-page.component.ts index 08f96bd8..3671101f 100644 --- a/ui/apps/translatr-admin/src/app/modules/pages/dashboard-page/dashboard-page.component.ts +++ b/ui/apps/translatr-admin/src/app/modules/pages/dashboard-page/dashboard-page.component.ts @@ -17,7 +17,7 @@ export class DashboardPageComponent { constructor( private readonly facade: AppFacade, private readonly router: Router, - @Inject(DASHBOARD_ROUTES) private routes: Array<{ children: NameIconRoute[] }> + @Inject(DASHBOARD_ROUTES) private routes: Array ) {} routerLink(route: Route) { diff --git a/ui/libs/utils/src/lib/routing/name-icon-route.ts b/ui/libs/utils/src/lib/routing/name-icon-route.ts index 8b9ab77c..b09804bc 100644 --- a/ui/libs/utils/src/lib/routing/name-icon-route.ts +++ b/ui/libs/utils/src/lib/routing/name-icon-route.ts @@ -5,4 +5,5 @@ export interface NameIconRoute extends Route { icon: string; name: string; }; + children: Array; }