|
|
|
@ -1,14 +1,14 @@
|
|
|
|
|
import { Location } from '@angular/common';
|
|
|
|
|
import { HttpClient } from '@angular/common/http';
|
|
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
|
import { MatDialog } from '@angular/material/dialog';
|
|
|
|
|
import { Router } from '@angular/router';
|
|
|
|
|
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
|
|
|
import { TranslateService } from '@ngx-translate/core';
|
|
|
|
|
import { AuthService } from '../../core/services/auth/auth.service';
|
|
|
|
|
import { UserDialogComponent } from '../navbar/user-dialog/user-dialog.component';
|
|
|
|
|
import { AppRole } from '../../core/common/enum/app-role';
|
|
|
|
|
import { Router } from '@angular/router';
|
|
|
|
|
import { Location } from '@angular/common';
|
|
|
|
|
import { AuthService } from '../../core/services/auth/auth.service';
|
|
|
|
|
import { LanguageDialogComponent } from '../language/dialog/language-dialog.component';
|
|
|
|
|
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
|
|
|
import { HttpClient } from '@angular/common/http';
|
|
|
|
|
import { UserDialogComponent } from '../navbar/user-dialog/user-dialog.component';
|
|
|
|
|
|
|
|
|
|
declare interface RouteInfo {
|
|
|
|
|
path: string;
|
|
|
|
@ -31,7 +31,6 @@ export const GENERAL_ROUTES: RouteInfo[] = [
|
|
|
|
|
export const DMP_ROUTES: RouteInfo[] = [
|
|
|
|
|
{ path: '/plans', title: 'SIDE-BAR.MY-DMPS', icon: 'library_books' },
|
|
|
|
|
{ path: '/descriptions', title: 'SIDE-BAR.MY-DESCRIPTIONS', icon: 'dns' },
|
|
|
|
|
// { path: '/plans/new', title: 'SIDE-BAR.ADD-EXPERT', icon: 'playlist_add' }
|
|
|
|
|
];
|
|
|
|
|
export const DATASETS_ROUTES: RouteInfo[] = [
|
|
|
|
|
{ path: '/explore-plans', title: 'SIDE-BAR.PUBLIC-DMPS', icon: 'library_books' },
|
|
|
|
@ -43,15 +42,11 @@ export const PUBLIC_ROUTES: RouteInfo[] = [
|
|
|
|
|
{ path: '/explore-descriptions', title: 'SIDE-BAR.PUBLIC-DESC', icon: 'dns' }
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
// export const GRANTS_ROUTES: RouteInfo[] = [
|
|
|
|
|
// { path: '/grants', title: 'SIDE-BAR.MY-GRANTS', icon: 'work_outline' }
|
|
|
|
|
// ];
|
|
|
|
|
|
|
|
|
|
export const ADMIN_ROUTES: RouteInfo[] = [
|
|
|
|
|
{ path: '/dmp-blueprints', title: 'SIDE-BAR.DMP-BLUEPRINTS', icon: 'library_books' },
|
|
|
|
|
{ path: '/description-templates', title: 'SIDE-BAR.DESCRIPTION-TEMPLATES', icon: 'description' },
|
|
|
|
|
{ path: '/description-template-type', title: 'SIDE-BAR.DESCRIPTION-TEMPLATE-TYPES', icon: 'stack' },
|
|
|
|
|
{ path: '/entity-locks', title: 'SIDE-BAR.ENTITY-LOCKS', icon: 'build'},
|
|
|
|
|
{ path: '/entity-locks', title: 'SIDE-BAR.ENTITY-LOCKS', icon: 'build' },
|
|
|
|
|
{ path: '/references', title: 'SIDE-BAR.REFERENCES', icon: 'dataset_linked' },
|
|
|
|
|
{ path: '/reference-type', title: 'SIDE-BAR.REFERENCE-TYPES', icon: 'add_link' },
|
|
|
|
|
{ path: '/prefilling-sources', title: 'SIDE-BAR.PREFILLING-SOURCES', icon: 'add_link' },
|
|
|
|
@ -59,9 +54,9 @@ export const ADMIN_ROUTES: RouteInfo[] = [
|
|
|
|
|
{ path: '/users', title: 'SIDE-BAR.USERS', icon: 'people' },
|
|
|
|
|
{ path: '/languages', title: 'SIDE-BAR.LANGUAGES', icon: 'language' },
|
|
|
|
|
{ path: '/supportive-material', title: 'SIDE-BAR.SUPPORTIVE-MATERIAL', icon: 'dataset_linked' },
|
|
|
|
|
{ path: '/notification-templates', title: 'SIDE-BAR.NOTIFICATION-TEMPLATES', icon: 'build'},
|
|
|
|
|
{ path: '/notifications', title: 'SIDE-BAR.NOTIFICATIONS', icon: 'build'},
|
|
|
|
|
{ path: '/index-managment', title: 'SIDE-BAR.MAINTENANCE', icon: 'build'}
|
|
|
|
|
{ path: '/notification-templates', title: 'SIDE-BAR.NOTIFICATION-TEMPLATES', icon: 'build' },
|
|
|
|
|
{ path: '/notifications', title: 'SIDE-BAR.NOTIFICATIONS', icon: 'build' },
|
|
|
|
|
{ path: '/index-managment', title: 'SIDE-BAR.MAINTENANCE', icon: 'build' }
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
export const DATASET_TEMPLATE_ROUTES: RouteInfo[] = [
|
|
|
|
@ -74,11 +69,6 @@ export const INFO_ROUTES: RouteInfo[] = [
|
|
|
|
|
{ path: '/feedback', title: 'SIDE-BAR.FEEDBACK', icon: 'feedback', url: 'https://docs.google.com/forms/d/12RSCrUjdSDp2LZLpjDKOi44cN1fLDD2q1-F66SqZIis/viewform?edit_requested=true' }
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
// export const HISTORY_ROUTES: RouteInfo[] = [
|
|
|
|
|
// { path: '/typography', title: 'SIDE-BAR.HISTORY-VISITED', icon: 'visibility'},
|
|
|
|
|
// { path: '/icons', title: 'SIDE-BAR.HISTORY-EDITED', icon: 'edit'}
|
|
|
|
|
// ];
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-sidebar',
|
|
|
|
|
templateUrl: './sidebar.component.html',
|
|
|
|
@ -106,7 +96,7 @@ export class SidebarComponent implements OnInit {
|
|
|
|
|
private location: Location,
|
|
|
|
|
private httpClient: HttpClient,
|
|
|
|
|
private matomoService: MatomoService
|
|
|
|
|
) {
|
|
|
|
|
) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
@ -139,16 +129,6 @@ export class SidebarComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
this.groupMenuItems.push(this.datasetItems);
|
|
|
|
|
|
|
|
|
|
// ----------- UNCOMMENT TO ADD AGAIN GRANTS --------
|
|
|
|
|
// this.grantItems = {
|
|
|
|
|
// title: 'SIDE-BAR.GRANTS',
|
|
|
|
|
// routes: GRANTS_ROUTES,
|
|
|
|
|
// requiresAuthentication: true,
|
|
|
|
|
// requiresAdmin: false,
|
|
|
|
|
// isGeneral: false
|
|
|
|
|
// }
|
|
|
|
|
// this.groupMenuItems.push(this.grantItems);
|
|
|
|
|
|
|
|
|
|
this.adminItems = {
|
|
|
|
|
title: 'SIDE-BAR.ADMIN',
|
|
|
|
|
routes: ADMIN_ROUTES,
|
|
|
|
@ -187,12 +167,6 @@ export class SidebarComponent implements OnInit {
|
|
|
|
|
this.groupMenuItems.push(this.infoItems);
|
|
|
|
|
|
|
|
|
|
this.router.events.subscribe((event) => this.currentRoute = this.router.url);
|
|
|
|
|
|
|
|
|
|
// this.historyItems = {
|
|
|
|
|
// title: 'SIDE-BAR.HISTORY',
|
|
|
|
|
// routes: HISTORY_ROUTES
|
|
|
|
|
// }
|
|
|
|
|
// this.groupMenuItems.push(this.historyItems);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public principalHasAvatar(): boolean {
|
|
|
|
|