1
|
import {Component} from '@angular/core';
|
2
|
import {ActivatedRoute} from '@angular/router';
|
3
|
import {PiwikHelper} from '../../utils/piwikHelper';
|
4
|
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
|
5
|
|
6
|
@Component({
|
7
|
selector: 'openaire-orp',
|
8
|
template: `
|
9
|
<result-landing type="orp" [piwikSiteId]="piwikSiteId" [communityId]="communityId" [activeTab]="'References'"></result-landing>
|
10
|
`,
|
11
|
})
|
12
|
|
13
|
export class OpenaireOrpComponent {
|
14
|
piwikSiteId = null;
|
15
|
communityId = null;
|
16
|
constructor (private route: ActivatedRoute ) {
|
17
|
this.route.data
|
18
|
.subscribe((data: { envSpecific: any }) => {
|
19
|
this.route.queryParams.subscribe(params => {
|
20
|
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
|
21
|
if (!this.communityId) {
|
22
|
this.communityId = params['communityId'];
|
23
|
}
|
24
|
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, data.envSpecific.environment);
|
25
|
});
|
26
|
});
|
27
|
}
|
28
|
|
29
|
|
30
|
ngOnInit() {
|
31
|
}
|
32
|
|
33
|
}
|