1 |
59507
|
konstantin
|
import {Component, OnInit} from '@angular/core';
|
2 |
|
|
import {MenuItem, RootMenuItem} from './openaireLibrary/sharedComponents/menu';
|
3 |
|
|
import {EnvProperties} from './openaireLibrary/utils/properties/env-properties';
|
4 |
|
|
import {User} from './openaireLibrary/login/utils/helper.class';
|
5 |
|
|
import {properties} from '../environments/environment';
|
6 |
|
|
import {LayoutService} from './services/layout.service';
|
7 |
59594
|
k.triantaf
|
import {Header} from './openaireLibrary/sharedComponents/navigationBar.component';
|
8 |
59507
|
konstantin
|
|
9 |
|
|
@Component({
|
10 |
|
|
selector: 'app',
|
11 |
|
|
templateUrl: './app.component.html',
|
12 |
|
|
})
|
13 |
|
|
|
14 |
|
|
export class AppComponent implements OnInit {
|
15 |
59551
|
k.triantaf
|
title = 'OpenAIRE - Research Graph';
|
16 |
59507
|
konstantin
|
userMenuItems: MenuItem[] = [];
|
17 |
|
|
menuItems: RootMenuItem [] = [];
|
18 |
|
|
logInUrl = null;
|
19 |
|
|
logOutUrl = null;
|
20 |
|
|
properties: EnvProperties = properties;
|
21 |
|
|
showMenu: boolean = false;
|
22 |
|
|
user: User;
|
23 |
59594
|
k.triantaf
|
header: Header;
|
24 |
|
|
logoPath: string = 'assets/common-assets/';
|
25 |
59507
|
konstantin
|
|
26 |
|
|
constructor(private layoutService: LayoutService) {}
|
27 |
|
|
|
28 |
|
|
ngOnInit() {
|
29 |
|
|
this.logInUrl = this.properties.loginUrl;
|
30 |
|
|
this.logOutUrl = this.properties.logoutUrl;
|
31 |
|
|
this.showMenu = true;
|
32 |
59594
|
k.triantaf
|
this.header = {
|
33 |
|
|
route: "/",
|
34 |
|
|
url: null,
|
35 |
|
|
title: 'graph',
|
36 |
|
|
logoUrl: this.logoPath + 'logo-large-graph.png',
|
37 |
|
|
logoSmallUrl:this.logoPath + 'logo-small-graph.png',
|
38 |
|
|
position:'left',
|
39 |
|
|
badge:true
|
40 |
|
|
};
|
41 |
59507
|
konstantin
|
this.layoutService.isHome.subscribe(isHome => {
|
42 |
|
|
this.buildMenu(isHome);
|
43 |
|
|
});
|
44 |
|
|
}
|
45 |
|
|
|
46 |
|
|
buildMenu(isHome) {
|
47 |
|
|
this.menuItems = [
|
48 |
|
|
{
|
49 |
|
|
rootItem: new MenuItem("about", "About", "", "/about", false, [], null, {}),
|
50 |
|
|
items: [
|
51 |
59534
|
konstantin
|
new MenuItem("overview", "Overview", "", "/about", false, [], null, {}),
|
52 |
|
|
new MenuItem("architecture", "Architecture", "", "/about", false, [], null, {}, null, 'architecture'),
|
53 |
|
|
new MenuItem("metrics", "Data and Metrics", "", "/about", false, [], null, {}, null, 'metrics'),
|
54 |
|
|
new MenuItem("infrastructure", "Infrastructure", "", "/about", false, [], null, {}, null, 'infrastructure'),
|
55 |
|
|
new MenuItem("team", "Team", "", "/about", false, [], null, {}, null, 'team')
|
56 |
59507
|
konstantin
|
]
|
57 |
|
|
},
|
58 |
|
|
{
|
59 |
|
|
rootItem: new MenuItem("resources", "Resources", "", "/resources", false, [], null, {}),
|
60 |
|
|
items: [
|
61 |
60442
|
argiro.kok
|
// new MenuItem("api", "API", "", "/resources", false, [], null, {}),
|
62 |
|
|
// new MenuItem("schema", "Metadata Schema", "", "/resources", false, [], null, {}, null, "schema"),
|
63 |
59534
|
konstantin
|
// new MenuItem("sources", "Sources", "", "/resources", false, [], null, {}, null, "sources"),
|
64 |
59507
|
konstantin
|
]
|
65 |
|
|
},
|
66 |
|
|
{
|
67 |
|
|
rootItem: new MenuItem("contact", "Support", "", "/support", false, [], null, {}),
|
68 |
59534
|
konstantin
|
items: [
|
69 |
59539
|
konstantin
|
// new MenuItem("contact", "Contact", "", "/support", false, [], null, {}),
|
70 |
|
|
// new MenuItem("documentation", "Documentation", "", "/support", false, [], null, {}, null, "documentation"),
|
71 |
|
|
// new MenuItem("faq", "FAQs", "", "/support", false, [], null, {}, null, "faq"),
|
72 |
59534
|
konstantin
|
]
|
73 |
59507
|
konstantin
|
}
|
74 |
|
|
];
|
75 |
|
|
if(!isHome) {
|
76 |
|
|
this.menuItems = [{
|
77 |
|
|
rootItem: new MenuItem("home", "Home", "", "/", false, [], null, {}),
|
78 |
|
|
items: []
|
79 |
|
|
}].concat(this.menuItems);
|
80 |
|
|
}
|
81 |
|
|
}
|
82 |
|
|
}
|