2020-04-03 18:02:40 +02:00
|
|
|
import {Component} from '@angular/core';
|
2018-11-22 16:29:51 +01:00
|
|
|
import {PiwikHelper} from '../../utils/piwikHelper';
|
|
|
|
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
|
2019-06-13 14:32:41 +02:00
|
|
|
import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
|
2020-11-12 16:59:26 +01:00
|
|
|
import {properties} from "../../../environments/environment";
|
|
|
|
import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties";
|
2018-01-26 16:00:07 +01:00
|
|
|
|
|
|
|
@Component({
|
2021-04-01 16:25:15 +02:00
|
|
|
selector: 'openaire-search-find',
|
|
|
|
template: `
|
|
|
|
<search-all logoURL="/assets/common-assets/logo-small-explore.png" name="OpenAIRE Connect"
|
|
|
|
[customFilter]=customFilter [piwikSiteId]="piwikSiteId"></search-all>
|
|
|
|
`,
|
|
|
|
})
|
|
|
|
export class OpenaireSearchComponent {
|
|
|
|
communityId: string;
|
2019-06-13 14:32:41 +02:00
|
|
|
customFilter: SearchCustomFilter = null;
|
2018-11-22 16:29:51 +01:00
|
|
|
piwikSiteId = null;
|
2021-04-01 16:25:15 +02:00
|
|
|
properties: EnvProperties = properties;
|
|
|
|
|
|
|
|
constructor() {
|
2020-11-12 16:59:26 +01:00
|
|
|
}
|
2021-04-01 16:25:15 +02:00
|
|
|
|
2018-01-26 16:00:07 +01:00
|
|
|
ngOnInit() {
|
2021-04-01 16:25:15 +02:00
|
|
|
let communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
|
|
|
if (communityId) {
|
|
|
|
this.communityId = communityId;
|
2022-06-08 13:21:09 +02:00
|
|
|
this.piwikSiteId = PiwikHelper.getSiteId(communityId);
|
2021-04-01 16:25:15 +02:00
|
|
|
this.customFilter = new SearchCustomFilter("Community", "communityId", this.communityId, "");
|
2020-11-12 16:59:26 +01:00
|
|
|
}
|
2018-11-22 16:29:51 +01:00
|
|
|
}
|
2018-01-26 16:00:07 +01:00
|
|
|
}
|