1
|
/**
|
2
|
* Created by stefania on 3/21/16.
|
3
|
*/
|
4
|
|
5
|
import { Component } from '@angular/core';
|
6
|
import {Properties} from './utils/properties';
|
7
|
import{MenuItem, RootMenuItem} from './openaireLibrary/sharedComponents/menu';
|
8
|
import {ActivatedRoute} from '@angular/router';
|
9
|
|
10
|
@Component({
|
11
|
selector: 'app',
|
12
|
templateUrl: './app.component.html',
|
13
|
})
|
14
|
|
15
|
export class AppComponent {
|
16
|
title = 'Metadata Registry Service';
|
17
|
isClient:boolean = false;
|
18
|
|
19
|
|
20
|
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
|
community: {id:string, name:string, logoUrl:string};
|
38
|
|
39
|
constructor( private route: ActivatedRoute) {}
|
40
|
|
41
|
ngOnInit() {
|
42
|
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
|
this.logInUrl = Properties.getLoginURL();
|
55
|
this.logOutUrl = Properties.getLogoutURL();
|
56
|
console.log("login url "+this.logInUrl)
|
57
|
if (typeof document !== 'undefined') {
|
58
|
try{
|
59
|
this.isClient = true;
|
60
|
}catch (e) {
|
61
|
}
|
62
|
}
|
63
|
}
|
64
|
}
|