diff --git a/sharedComponents/menu.ts b/sharedComponents/menu.ts index 528cf5d6..7af41976 100644 --- a/sharedComponents/menu.ts +++ b/sharedComponents/menu.ts @@ -1,25 +1,33 @@ export class MenuItem { - id:string = ""; // for root menu in order to close the dropdown when clicked - title: string = ""; - url:string = ""; // external url - route:string = ""; // internal url - using angular routing and components - needsAuthorization:boolean = false; // needs admin rights - mainly for user menu at this point - entitiesRequired:string[] = []; // openaire entities used in page "publication, dataset, organization, software, project, datasource" - routeRequired:string[] = []; // the routes that if aren't enable the menu item doesn't make sense - params:any = {}; - constructor(id:string, title:string, url:string, route:string, needsAuthorization:boolean, entitiesRequired:string[],routeRequired:string[], params){ - this.id = id; - this.title = title; - this.url = url; - this.route = route; - this.needsAuthorization = needsAuthorization; - this.entitiesRequired = entitiesRequired; - this.routeRequired = routeRequired; - this.params = params; - } + id: string = ""; // for root menu in order to close the dropdown when clicked + title: string = ""; + url: string = ""; // external url + route: string = ""; // internal url - using angular routing and components + needsAuthorization: boolean = false; // needs admin rights - mainly for user menu at this point + entitiesRequired: string[] = []; // openaire entities used in page "publication, dataset, organization, software, project, datasource" + routeRequired: string[] = []; // the routes that if aren't enable the menu item doesn't make sense + params: any = {}; + constructor(id: string, title: string, url: string, route: string, needsAuthorization: boolean, entitiesRequired: string[], routeRequired: string[], params) { + this.id = id; + this.title = title; + this.url = url; + this.route = route; + this.needsAuthorization = needsAuthorization; + this.entitiesRequired = entitiesRequired; + this.routeRequired = routeRequired; + this.params = params; } - export class RootMenuItem { - rootItem:MenuItem; - items:MenuItem[]=[]; - } + +} + +export class RootMenuItem { + rootItem: MenuItem; + items: MenuItem[] = []; +} + +export class SideMenuItem { + rootItem: MenuItem; + items: RootMenuItem[] = []; + ukIcon: string = ''; +} diff --git a/sharedComponents/sidebar/sideBar.component.html b/sharedComponents/sidebar/sideBar.component.html new file mode 100644 index 00000000..3699c92e --- /dev/null +++ b/sharedComponents/sidebar/sideBar.component.html @@ -0,0 +1,36 @@ + diff --git a/sharedComponents/sidebar/sideBar.component.ts b/sharedComponents/sidebar/sideBar.component.ts new file mode 100644 index 00000000..5d32346c --- /dev/null +++ b/sharedComponents/sidebar/sideBar.component.ts @@ -0,0 +1,13 @@ +import {Component, Input} from '@angular/core'; +import {SideMenuItem} from "../menu"; + +@Component({ + selector: 'sidebar', + templateUrl: 'sideBar.component.html' +}) +export class SideBarComponent { + @Input() communityId: string = ''; + @Input() menuItems: SideMenuItem[] = []; + + constructor() {} +} diff --git a/sharedComponents/sidebar/sideBar.module.ts b/sharedComponents/sidebar/sideBar.module.ts new file mode 100644 index 00000000..4f17e096 --- /dev/null +++ b/sharedComponents/sidebar/sideBar.module.ts @@ -0,0 +1,22 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; + +import {RouterModule} from "@angular/router"; + +import {SideBarComponent} from './sideBar.component'; + +@NgModule({ + imports: [ + CommonModule, + RouterModule + ], + declarations: [ + SideBarComponent + ], + providers: [], + exports: [ + SideBarComponent + ] +}) +export class SideBarModule { +}