1
|
import {Component} from '@angular/core';
|
2
|
import {PiwikHelper} from '../../utils/piwikHelper';
|
3
|
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
|
4
|
import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
|
5
|
import {properties} from "../../../environments/environment";
|
6
|
import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties";
|
7
|
|
8
|
@Component({
|
9
|
selector: 'openaire-search-find',
|
10
|
template: `
|
11
|
<search-all logoURL="/assets/common-assets/logo-small-explore.png" name="OpenAIRE Connect"
|
12
|
[customFilter]=customFilter [piwikSiteId]="piwikSiteId"></search-all>
|
13
|
`,
|
14
|
})
|
15
|
export class OpenaireSearchComponent {
|
16
|
communityId: string;
|
17
|
customFilter: SearchCustomFilter = null;
|
18
|
piwikSiteId = null;
|
19
|
properties: EnvProperties = properties;
|
20
|
|
21
|
constructor() {
|
22
|
}
|
23
|
|
24
|
ngOnInit() {
|
25
|
let communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
26
|
if (communityId) {
|
27
|
this.communityId = communityId;
|
28
|
this.piwikSiteId = PiwikHelper.getSiteId(communityId, this.properties.environment);
|
29
|
this.customFilter = new SearchCustomFilter("Community", "communityId", this.communityId, "");
|
30
|
}
|
31
|
}
|
32
|
}
|