connect/src/app/searchPages/find/search.component.ts

33 lines
1.2 KiB
TypeScript
Raw Normal View History

import {Component} from '@angular/core';
import {PiwikHelper} from '../../utils/piwikHelper';
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {properties} from "../../../environments/environment";
import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties";
@Component({
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;
customFilter: SearchCustomFilter = null;
piwikSiteId = null;
properties: EnvProperties = properties;
constructor() {
}
ngOnInit() {
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);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.communityId, "");
}
}
}