1 |
49060
|
argiro.kok
|
/**
|
2 |
|
|
* Created by stefania on 3/21/16.
|
3 |
|
|
*/
|
4 |
|
|
|
5 |
|
|
import { Component } from '@angular/core';
|
6 |
50287
|
argiro.kok
|
import {Properties} from './utils/properties';
|
7 |
50764
|
argiro.kok
|
import{MenuItem, RootMenuItem} from './openaireLibrary/sharedComponents/menu';
|
8 |
50682
|
argiro.kok
|
import {ActivatedRoute} from '@angular/router';
|
9 |
|
|
|
10 |
49060
|
argiro.kok
|
@Component({
|
11 |
51074
|
argiro.kok
|
selector: 'app',
|
12 |
49060
|
argiro.kok
|
templateUrl: './app.component.html',
|
13 |
|
|
})
|
14 |
|
|
|
15 |
|
|
export class AppComponent {
|
16 |
|
|
title = 'Metadata Registry Service';
|
17 |
50287
|
argiro.kok
|
isClient:boolean = false;
|
18 |
|
|
|
19 |
|
|
|
20 |
50608
|
argiro.kok
|
userMenuItems:MenuItem[] = [ new MenuItem("","My profile","","",false,[],[],{})];
|
21 |
|
|
|
22 |
|
|
menuItems:RootMenuItem [] = [];
|
23 |
|
|
|
24 |
|
|
// menuItems:RootMenuItem [] = [
|
25 |
|
|
// {rootItem: new MenuItem("search","Search","","/search/find",false,[],["/search/find"],{}),
|
26 |
|
|
// items: [new MenuItem("","Publications","","/search/find/publications",false,["publication"],["/search/find/publications"],{}),
|
27 |
|
|
// new MenuItem("","Research Data","","/search/find/datasets",false,["dataset"],["/search/find/datasets"],{}),
|
28 |
|
|
// new MenuItem("","Software","","/search/find/software",false,["software"],["/search/find/software"],{}),
|
29 |
|
|
// new MenuItem("","Projects","","/search/find/projects/",false,["project"],["/search/find/projects"],{}),
|
30 |
|
|
// new MenuItem("","Content Providers","","/search/find/dataproviders",false,["datasource"],["/search/find/dataproviders"],{}),
|
31 |
|
|
// new MenuItem("","Organizations","","/search/find/organizations/",false,["organization"],["/search/find/organizations"],{})
|
32 |
|
|
// ]}
|
33 |
|
|
//
|
34 |
|
|
// ];
|
35 |
|
|
logInUrl = null;
|
36 |
|
|
logOutUrl = null;
|
37 |
50682
|
argiro.kok
|
community: {id:string, name:string, logoUrl:string};
|
38 |
50287
|
argiro.kok
|
|
39 |
50682
|
argiro.kok
|
constructor( private route: ActivatedRoute) {}
|
40 |
|
|
|
41 |
50287
|
argiro.kok
|
ngOnInit() {
|
42 |
50682
|
argiro.kok
|
this.route.queryParams.subscribe(data => {
|
43 |
|
|
|
44 |
|
|
if(data['community'] && data['community']!=""){
|
45 |
|
|
this.community = {id: data['community'], name: "Egi Federation", logoUrl:"https:\/\/egi.eu/wp-content/uploads/2016/05/cropped-logo_site-1-300x300.png"};
|
46 |
|
|
|
47 |
|
|
|
48 |
|
|
}else{
|
49 |
|
|
this.community = null;
|
50 |
|
|
|
51 |
|
|
}
|
52 |
|
|
|
53 |
|
|
});
|
54 |
50608
|
argiro.kok
|
this.logInUrl = Properties.getLoginURL();
|
55 |
|
|
this.logOutUrl = Properties.getLogoutURL();
|
56 |
|
|
console.log("login url "+this.logInUrl)
|
57 |
50287
|
argiro.kok
|
if (typeof document !== 'undefined') {
|
58 |
|
|
try{
|
59 |
|
|
this.isClient = true;
|
60 |
|
|
}catch (e) {
|
61 |
|
|
}
|
62 |
|
|
}
|
63 |
|
|
}
|
64 |
49060
|
argiro.kok
|
}
|