From 7be97877c661c6bd24427daa1aa4990adbb8d370 Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Thu, 11 Jan 2018 15:20:43 +0000 Subject: [PATCH] parameterize menu items & login/out urls git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@50286 d315682c-612b-4755-9ff5-7f18f6832af3 --- login/userMini.component.ts | 38 +++-- sharedComponents/navigationBar.component.html | 61 +++++--- sharedComponents/navigationBar.component.ts | 137 ++++++++++++++++++ 3 files changed, 201 insertions(+), 35 deletions(-) diff --git a/login/userMini.component.ts b/login/userMini.component.ts index f667c138..02bf1c6f 100644 --- a/login/userMini.component.ts +++ b/login/userMini.component.ts @@ -15,20 +15,26 @@ declare var logoutClicked;
- +
diff --git a/sharedComponents/navigationBar.component.ts b/sharedComponents/navigationBar.component.ts index 4a3ef65a..0a9c25fa 100644 --- a/sharedComponents/navigationBar.component.ts +++ b/sharedComponents/navigationBar.component.ts @@ -15,6 +15,142 @@ export class NavigationBarComponent { @Input() onlyTop ; @Input() logoPath:string = "assets/"; @Input() userMenu; + @Input() logInUrl; + @Input() logOutUrl; + @Input() userMenuItems = [ + + {title: "My profile", + url:"", + route:"", + needsAuthorization:false}, + {title: "My claims", + url:"", + route:"/myclaims", + needsAuthorization:false}, + {title: "Manage all claims", + url:"", + route:"/claims", + needsAuthorization:true + } + + ]; + + @Input() menuItems = [ + {rootItem:{ + title: "Search", + url:"", + route:"/search/find" + + },items:[ + {title: "Publications", + url:"", + route:"/search/find/publications", + entitiesRequired:["publication"], + routeRequired:["/search/find/publications"]}, + {title: "Research Data", + url:"", + route:"/search/find/datasets", + entitiesRequired:["dataset"], + routeRequired:["/search/find/datasets"]}, + {title: "Software", + url:"", + route:"/search/find/software", + entitiesRequired:["software"], + routeRequired:["/search/find/software"]}, + {title: "Projects", + url:"", + route:"/search/find/projects", + entitiesRequired:["projects"], + routeRequired:["/search/find/projects"]}, + {title: "Content Providers", + url:"", + route:"/search/find/dataproviders", + entitiesRequired:["projects"], + routeRequired:["/search/find/projects"]}, + {title: "Organizations", + url:"", + route:"/search/find/organizations", + entitiesRequired:["projects"], + routeRequired:["/search/find/projects"]}, + ] + }, + {rootItem:{ + title: "Share", + url:"", + route:"" + + },items:[ + {title: "Publications", + url:"", + route:"/participate/deposit-publications", + entitiesRequired:["publication"], + routeRequired:["/participate/deposit-publications"]}, + {title: "Research Data", + url:"", + route:"/participate/deposit-datasets", + entitiesRequired:["dataset"], + routeRequired:["/participate/deposit-datasets"]} + ] +}, + +{rootItem:{ + title: "Link", + url:"", + route:"/participate/claim", + entitiesRequired:[], + routeRequired:["/participate/claim"] + +},items:[] +}, +{rootItem:{ + title: "Content Providers", + url:"", + route:"" + + +},items:[ + {title: "Data Policies", + url:"https://beta.openaire.eu/oa-policies-mandates", + route:"", + entitiesRequired:[], + routeRequired:[]}, + {title: "Repositories", + url:"", + route:"/search/content-providers", + entitiesRequired:[], + routeRequired:["/search/content-providers"]}, + {title: "Journals", + url:"", + route:"/search/journals", + entitiesRequired:[], + routeRequired:["/search/journals"]}, + {title: "Registries", + url:"", + route:"/search/entity-registries", + entitiesRequired:[], + routeRequired:["/search/entity-registries"]}, + {title: "Browse all", + url:"", + route:"/search/find/dataproviders", + entitiesRequired:[], + routeRequired:["/search/find/dataproviders"]} +] +} + + ]; + /* + + +
  • + Content Providers + +
  • */ public isAuthorized: boolean = false; sub:any; isClient:boolean = false; @@ -34,6 +170,7 @@ export class NavigationBarComponent { constructor( private router: Router, private route: ActivatedRoute, private config: ConfigurationService) {} ngOnInit() { + console.log(this.menuItems); if (typeof document !== 'undefined') { try{ this.isClient = true;