2019-06-03 15:20:36 +02:00
|
|
|
import { Component, Directive, ElementRef, Renderer2, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';
|
2017-12-19 13:53:46 +01:00
|
|
|
import { ConfigurationService } from './utils/configuration/configuration.service';
|
2019-06-03 15:20:36 +02:00
|
|
|
import {Observable} from 'rxjs';
|
2018-02-05 14:14:59 +01:00
|
|
|
import { EnvProperties } from './utils/properties/env-properties';
|
|
|
|
import {ActivatedRoute} from '@angular/router';
|
|
|
|
import{EnvironmentSpecificService} from './utils/properties/environment-specific.service';
|
|
|
|
import{MenuItem,RootMenuItem} from './sharedComponents/menu';
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
//changeDetection: ChangeDetectionStrategy.Default,
|
|
|
|
//encapsulation: ViewEncapsulation.Emulated,
|
|
|
|
selector: 'app-root',
|
|
|
|
styles: [`
|
|
|
|
`],
|
|
|
|
template: `
|
2018-02-05 14:14:59 +01:00
|
|
|
|
2019-06-12 10:59:10 +02:00
|
|
|
<navbar *ngIf= "properties" portal="explore" [properties]=properties [onlyTop]=false [userMenu]=true [communityId]="properties.adminToolsCommunity" [userMenuItems]=userMenuItems [menuItems]=menuItems ></navbar>
|
2018-01-11 11:55:54 +01:00
|
|
|
<h1>Openaire Lib Component</h1>
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
<!--div id="tm-main" class=" uk-section uk-margin-large-top tm-middle custom-main-content" >
|
|
|
|
<div uk-grid uk-grid>
|
|
|
|
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first "-->
|
|
|
|
<div class="custom-main-content" >
|
|
|
|
<main>
|
|
|
|
<router-outlet></router-outlet>
|
|
|
|
|
|
|
|
</main>
|
|
|
|
</div>
|
|
|
|
<!--/div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div-->
|
2018-05-11 16:38:05 +02:00
|
|
|
<!--feedback *ngIf= "isClient"></feedback-->
|
2017-12-19 13:53:46 +01:00
|
|
|
<cookie-law *ngIf= "isClient" position="bottom">
|
|
|
|
OpenAIRE uses cookies in order to function properly.<br>
|
|
|
|
Cookies are small pieces of data that websites store in your browser to allow us to give you the best browsing experience possible.
|
2018-09-05 14:37:47 +02:00
|
|
|
By using the OpenAIRE portal you accept our use of cookies. <a href="http://ec.europa.eu/ipg/basics/legal/cookies/index_en.htm" target="_blank"> Read more <span class="uk-icon">
|
2017-12-19 13:53:46 +01:00
|
|
|
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="chevron-right" ratio="1"><polyline fill="none" stroke="#000" stroke-width="1.03" points="7 4 13 10 7 16"></polyline></svg>
|
|
|
|
</span></a>
|
|
|
|
</cookie-law>
|
2019-06-12 10:59:10 +02:00
|
|
|
<bottom *ngIf= "isClient && properties" [assetsPath]=assetsPath [properties]=properties></bottom>
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
`
|
|
|
|
|
|
|
|
})
|
|
|
|
export class AppComponent {
|
|
|
|
isClient:boolean = false;
|
2018-02-05 14:14:59 +01:00
|
|
|
public properties:EnvProperties = null;
|
|
|
|
|
|
|
|
constructor(private config: ConfigurationService, private route: ActivatedRoute, private propertiesService:EnvironmentSpecificService) {
|
|
|
|
}
|
|
|
|
|
2018-05-11 16:38:05 +02:00
|
|
|
assetsPath = "assets/";
|
2018-02-05 14:14:59 +01:00
|
|
|
userMenuItems:MenuItem[] = [ new MenuItem("","My profile","","",false,[],[],{}),
|
|
|
|
new MenuItem("","My claims","","/myclaims",false,[],["/myclaims"],{}),
|
|
|
|
new MenuItem("","Manage all claims","","/claims",true,[],["/claims"],{})]
|
|
|
|
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2018-02-05 14:14:59 +01:00
|
|
|
menuItems:RootMenuItem [] = [
|
|
|
|
{rootItem: new MenuItem("search","Search","","/search/find",false,[],["/search/find"],{}),
|
|
|
|
items: [new MenuItem("","Publications","","/search/find/publications",false,["publication"],["/search/find/publications"],{}),
|
|
|
|
new MenuItem("","Research Data","","/search/find/datasets",false,["dataset"],["/search/find/datasets"],{}),
|
|
|
|
new MenuItem("","Software","","/search/find/software",false,["software"],["/search/find/software"],{}),
|
2018-07-25 15:27:22 +02:00
|
|
|
new MenuItem("","Other Research Products","","/search/find/other",false,["orp"],["/search/find/other"],{}),
|
2018-02-05 14:14:59 +01:00
|
|
|
new MenuItem("","Projects","","/search/find/projects/",false,["project"],["/search/find/projects"],{}),
|
|
|
|
new MenuItem("","Content Providers","","/search/find/dataproviders",false,["datasource"],["/search/find/dataproviders"],{}),
|
|
|
|
new MenuItem("","Organizations","","/search/find/organizations/",false,["organization"],["/search/find/organizations"],{})
|
|
|
|
]},
|
|
|
|
{
|
|
|
|
rootItem: new MenuItem("share","Share","","",false,[],["/participate/deposit-publications","/participate/deposit-datasets"],{}),
|
|
|
|
items: [new MenuItem("","Publications","","/participate/deposit-publications",false,["publication"],["/participate/deposit-publications"],{}),
|
|
|
|
new MenuItem("","Research Data","","/participate/deposit-datasets",false,["dataset"],["/participate/deposit-datasets"],{})]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
rootItem: new MenuItem("link","Link","","/participate/claim",false,[],["/participate/claim"],{}),
|
|
|
|
items: []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
rootItem: new MenuItem("datasources","Content Providers","","",false,["datasource"],[],{}),
|
|
|
|
items: [new MenuItem("","Data Policies","https://beta.openaire.eu/oa-policies-mandates","",false,["datasource"],[],{}),
|
|
|
|
new MenuItem("","Repositories","","/search/content-providers",false,["datasource"],["/search/content-providers"],{}),
|
|
|
|
new MenuItem("","Journals","","/search/journals",false,["datasource"],["/search/journals"],{}),
|
|
|
|
new MenuItem("","Registries","","/search/entity-registries",false,["datasource"],["/search/entity-registries"],{}),
|
|
|
|
new MenuItem("","Browse all","","/search/find/dataproviders",false,["datasource"],["/search/find/dataproviders"],{})]
|
|
|
|
}
|
|
|
|
];
|
2017-12-19 13:53:46 +01:00
|
|
|
ngOnInit() {
|
|
|
|
|
2018-02-05 14:14:59 +01:00
|
|
|
this.propertiesService.loadEnvironment()
|
|
|
|
.then(es => {
|
|
|
|
this.propertiesService.setEnvProperties(es);
|
|
|
|
this.properties = this.propertiesService.envSpecific;
|
|
|
|
}, error => {
|
|
|
|
console.log("App couldn't fetch properties");
|
|
|
|
console.log(error);
|
|
|
|
|
|
|
|
});
|
2017-12-19 13:53:46 +01:00
|
|
|
if (typeof document !== 'undefined') {
|
|
|
|
try{
|
|
|
|
this.isClient = true;
|
|
|
|
}catch (e) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-02-05 14:14:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|