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

30 lines
1.2 KiB
TypeScript
Raw Normal View History

import {Component} from '@angular/core';
import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {AggregatorInfo, PortalAggregators} from "../../utils/aggregators";
import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper";
import {properties} from "../../../environments/environment";
[Aggregator | new-theme]: Use of properties.errorLink | Link to simple/advanced page dark or not depending on background. 1. directLinking-routing.module.ts & linking-routing.module.ts & myClaims-routing.module.ts & deposit-routing.module.ts & searchDataProviders-routing.module.ts & errorPage.component.ts & dataProvider-routing.module.ts & dataset-routing.module.ts & organization-routing.module.ts & orp-routing.module.ts & project-routing.module.ts & publication-routing.module.ts & result-routing.module.ts & service-routing.module.ts & advancedSearchDataProviders-routing.module.ts & advancedSearchOrganizations-routing.module.ts & advancedSearchProjects-routing.module.ts & advancedSearchServices-routing.module.ts & searchResearchResults-routing.module.ts & searchDataProviders-routing.module.ts & searchOrganizations-routing.module.ts & searchProjects-routing.module.ts & searchResearchResults-routing.module.ts & searchServices-routing.module.ts: Replaced /error path with properties.errorLink. 2. advancedSearchDataProviders.component.ts & advancedSearchOrganizations.component.ts & advancedSearchProjects.component.ts & advancedSearchServices.component.ts & searchResearchResults.component.ts & search.component.ts & searchDataproviders.component.ts & searchOrganizations.component.ts & searchProjects.component.ts & searchResearchResults.component.ts & searchServices.component.ts: Added field searchForm: SearchForm, which sets dark to false for eosc, otherwise true - this is passed to the corresponding search component.
2022-05-18 14:13:42 +02:00
import {SearchForm} from "../../openaireLibrary/searchPages/searchUtils/newSearchPage.component";
@Component({
selector: 'openaire-search-find',
template: `
[Aggregator | new-theme]: Use of properties.errorLink | Link to simple/advanced page dark or not depending on background. 1. directLinking-routing.module.ts & linking-routing.module.ts & myClaims-routing.module.ts & deposit-routing.module.ts & searchDataProviders-routing.module.ts & errorPage.component.ts & dataProvider-routing.module.ts & dataset-routing.module.ts & organization-routing.module.ts & orp-routing.module.ts & project-routing.module.ts & publication-routing.module.ts & result-routing.module.ts & service-routing.module.ts & advancedSearchDataProviders-routing.module.ts & advancedSearchOrganizations-routing.module.ts & advancedSearchProjects-routing.module.ts & advancedSearchServices-routing.module.ts & searchResearchResults-routing.module.ts & searchDataProviders-routing.module.ts & searchOrganizations-routing.module.ts & searchProjects-routing.module.ts & searchResearchResults-routing.module.ts & searchServices-routing.module.ts: Replaced /error path with properties.errorLink. 2. advancedSearchDataProviders.component.ts & advancedSearchOrganizations.component.ts & advancedSearchProjects.component.ts & advancedSearchServices.component.ts & searchResearchResults.component.ts & search.component.ts & searchDataproviders.component.ts & searchOrganizations.component.ts & searchProjects.component.ts & searchResearchResults.component.ts & searchServices.component.ts: Added field searchForm: SearchForm, which sets dark to false for eosc, otherwise true - this is passed to the corresponding search component.
2022-05-18 14:13:42 +02:00
<search-all logoURL = "/assets/common-assets/logo-small-aggregator.png" name="OpenAIRE" [customFilter]="customFilter" [piwikSiteId]="piwikSiteId"
[searchForm]="searchForm"></search-all>
`,
})
export class OpenaireSearchComponent{
customFilter:SearchCustomFilter= null;
piwikSiteId = properties.piwikSiteId;
public searchForm: SearchForm = {class: 'search-form', dark: true};
constructor ( ) {}
ngOnInit() {
let id = ConnectHelper.getCommunityFromDomain(properties.domain);
let agg:AggregatorInfo = PortalAggregators.getFilterInfoByMenuId(id);
this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg);
}
}