From 2775841d84b6825ac2c06eedaf60d8bb09d481eb Mon Sep 17 00:00:00 2001 From: gkolokythas Date: Mon, 20 May 2019 10:32:01 +0300 Subject: [PATCH] Adds Admin pages on the side nav menu. (Ticket #85) --- dmp-frontend/src/app/app-routing.module.ts | 4 ++-- .../src/app/ui/sidebar/sidebar.component.ts | 13 +++++++++++++ dmp-frontend/src/assets/i18n/en.json | 6 +++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/dmp-frontend/src/app/app-routing.module.ts b/dmp-frontend/src/app/app-routing.module.ts index a49c429a5..b8e111478 100644 --- a/dmp-frontend/src/app/app-routing.module.ts +++ b/dmp-frontend/src/app/app-routing.module.ts @@ -61,7 +61,7 @@ const appRoutes: Routes = [ } }, { - path: 'dmp-profiles', + path: 'dmp-templates', loadChildren: './ui/admin/dmp-profile/dmp-profile.module#DmpProfileModule', data: { breadcrumb: true @@ -75,7 +75,7 @@ const appRoutes: Routes = [ } }, { - path: 'dataset-profiles', + path: 'dataset-templates', loadChildren: './ui/admin/dataset-profile/dataset-profile.module#DatasetProfileModule', data: { breadcrumb: true diff --git a/dmp-frontend/src/app/ui/sidebar/sidebar.component.ts b/dmp-frontend/src/app/ui/sidebar/sidebar.component.ts index c07f1bf35..7f85300d9 100644 --- a/dmp-frontend/src/app/ui/sidebar/sidebar.component.ts +++ b/dmp-frontend/src/app/ui/sidebar/sidebar.component.ts @@ -23,6 +23,11 @@ export const DMP_ROUTES: RouteInfo[] = [ { path: '/datasets', title: 'SIDE-BAR.MY-DATASET-DESC', icon: 'library_books' }, { path: '/projects', title: 'SIDE-BAR.MY-PROJECTS', icon: 'work_outline' } ]; +export const ADMIN_ROUTES: RouteInfo[] = [ + { path: '/dmp-templates', title: 'SIDE-BAR.DMP-TEMPLATES', icon: 'library_books' }, + { path: '/dataset-templates', title: 'SIDE-BAR.DATASET-TEMPLATES', icon: 'library_books' }, + { path: '/users', title: 'SIDE-BAR.USERS', icon: 'people' } +]; // export const HISTORY_ROUTES: RouteInfo[] = [ // { path: '/typography', title: 'SIDE-BAR.HISTORY-VISITED', icon: 'visibility'}, // { path: '/icons', title: 'SIDE-BAR.HISTORY-EDITED', icon: 'edit'} @@ -40,6 +45,7 @@ export const PUBLIC_ROUTES: RouteInfo[] = [ export class SidebarComponent implements OnInit { generalItems: GroupMenuItem; dmpItems: GroupMenuItem; + adminItems: GroupMenuItem; // historyItems: GroupMenuItem; publicItems: GroupMenuItem; groupMenuItems: GroupMenuItem[] = []; @@ -61,6 +67,13 @@ export class SidebarComponent implements OnInit { } this.groupMenuItems.push(this.dmpItems); + this.adminItems = { + title: 'SIDE-BAR.ADMIN', + routes: ADMIN_ROUTES, + requiresAuthentication: true + } + this.groupMenuItems.push(this.adminItems); + // this.historyItems = { // title: 'SIDE-BAR.HISTORY', // routes: HISTORY_ROUTES diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index 455acac50..ad5932508 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -69,7 +69,11 @@ "PUBLIC": "PUBLIC", "PUBLIC-DMPS": "PUBLIC DMPs", "PUBLIC-DESC": "PUBLIC DATASET DESCRIPTIONS", - "ACCOUNT": "ACCOUNT" + "ACCOUNT": "ACCOUNT", + "ADMIN": "ADMIN", + "DATASET-TEMPLATES": "Dataset templates", + "DMP-TEMPLATES": "DMP templates", + "USERS": "Users" }, "DATASET-PROFILE-EDITOR": { "TITLE": {