diff --git a/searchPages/searchResearchResults.component.ts b/searchPages/searchResearchResults.component.ts
index f4f03fa7..cd49aead 100644
--- a/searchPages/searchResearchResults.component.ts
+++ b/searchPages/searchResearchResults.component.ts
@@ -71,7 +71,15 @@ export class SearchResearchResultsComponent {
public loadPaging: boolean = true;
public oldTotalResults: number = 0;
@Input() openaireLink: string = null;
- @Input() customFilter: SearchCustomFilter = null;
+ @Input() customFilters: SearchCustomFilter[] = null;
+ @Input()
+ set customFilter(customFilter: SearchCustomFilter | SearchCustomFilter[]) {
+ if(!Array.isArray(customFilter)) {
+ this.customFilters = [customFilter];
+ }else{
+ this.customFilters = customFilter;
+ }
+ }
public pagingLimit: number = 0;
properties: EnvProperties = properties;
public openaireEntities = OpenaireEntities;
@@ -167,7 +175,7 @@ export class SearchResearchResultsComponent {
}
this.selectedFields = [];
- this.searchPage.prepareSearchPage(this.fieldIds, this.selectedFields, this.refineFields, this.rangeFields, this.fieldIdsMap,this.customFilter,params, this.resultType, this.quickFilter);
+ this.searchPage.prepareSearchPage(this.fieldIds, this.selectedFields, this.refineFields, this.rangeFields, this.fieldIdsMap,this.customFilters,params, this.resultType, this.quickFilter);
if(refine) {
this._getFilters(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), this.searchUtils.page, 0, "", true, this.searchPage.getSearchAPIQueryForRangeFields(params)+this.searchPage.getSearchAPIQueryForRefineFields(params, firstLoad));
} else {
diff --git a/searchPages/searchUtils/newSearchPage.component.html b/searchPages/searchUtils/newSearchPage.component.html
index f3f37221..b2880400 100644
--- a/searchPages/searchUtils/newSearchPage.component.html
+++ b/searchPages/searchUtils/newSearchPage.component.html
@@ -4,13 +4,15 @@
-
+
+
-
{{customFilter.valueName}}
+
0">
@@ -42,7 +44,7 @@
0">
- -
-
@@ -207,7 +209,7 @@
[advancedSearchLinkParameters]="this.routerHelper.createQueryParams(this.parameterNames, this.parameterValues)"
[simpleView]="simpleView" [formPlaceholderText]="formPlaceholderText" [isMobile]="mobile"
[resultTypes]="resultTypes" [quickFilter]="quickFilter" [entitiesSelection]="entitiesSelection"
- [showSwitchSearchLink]="showSwitchSearchLink" [customFilter]="customFilter"
+ [showSwitchSearchLink]="showSwitchSearchLink" [customFilter]="customFilters[0]"
>
@@ -270,12 +272,13 @@
-
0 || !loadPaging )"
class="uk-alert uk-margin-small-top ">
-
The following results are related to
+ The following results are related to {{customFilter.valueName}}.
+
Are you interested to view more results? Visit
{
+ this.subscriptions.push(this.helper.getPageHelpContents(this.properties, (this.customFilters && this.customFilters[0].queryFieldName == "communityId") ? this.customFilters[0].valueId : this.properties.adminToolsCommunity, this.router.url).subscribe(contents => {
this.pageContents = contents;
}));
}
private getDivContents() {
- this.subscriptions.push(this.helper.getDivHelpContents(this.properties, (this.customFilter && this.customFilter.queryFieldName == "communityId") ? this.customFilter.valueId : this.properties.adminToolsCommunity, this.router.url).subscribe(contents => {
+ this.subscriptions.push(this.helper.getDivHelpContents(this.properties, (this.customFilters && this.customFilters[0].queryFieldName == "communityId") ? this.customFilters[0].valueId : this.properties.adminToolsCommunity, this.router.url).subscribe(contents => {
this.divContents = contents;
}));
}
@@ -450,8 +458,12 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
*/
public checkSelectedFilters(filters: Filter[]) {
this.filters = filters;
- if (this.customFilter && !this.customFilter.isHiddenFilter) {
- this.customFilter.selected = null;
+ if (this.customFilters) {
+ for (let customFilter of this.customFilters) {
+ if (!customFilter.isHiddenFilter) {
+ customFilter.selected = null;
+ }
+ }
}
for (var i = 0; i < filters.length; i++) {
var filter: Filter = filters[i];
@@ -467,8 +479,10 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
}
}
- if (this.customFilter) {
- this.customFilter.selected = this.customFilter.queryFieldName == filter.filterId && values.indexOf(StringUtils.quote(this.customFilter.valueId)) != -1;
+ if (this.customFilters) {
+ for (let customFilter of this.customFilters) {
+ customFilter.selected = customFilter.queryFieldName == filter.filterId && values.indexOf(StringUtils.quote(customFilter.valueId)) != -1;
+ }
}
// } else if (this.quickFilter && this.quickFilter.filterId == filter.filterId && this.quickFilter.selected) {
// for (let filterValue of filter.values) {
@@ -488,11 +502,6 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
// this.quickFilter.filter = filter;
// }
}
- if (this.parameterNames.indexOf("cf") != -1 && this.parameterValues[this.parameterNames.indexOf("cf")] == "true") {
- this.customFilter.selected = true;
- } else if (this.customFilter && this.customFilter.selected == null) {
- this.customFilter.selected = false;
- }
this.filterFilterValues(this.filters);
if (!this.includeOnlyResultsAndFilter) {
this.updateMeta(this.pageTitle);
@@ -1057,8 +1066,12 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
allFqs += fq;
}
}
- if (this.customFilter && (this.customFilter.isHiddenFilter)) {
- allFqs += "&fq=" + StringUtils.URIEncode(this.customFilter.queryFieldName + " exact " + StringUtils.quote((this.customFilter.valueId)));
+ if (this.customFilters) {
+ for (let customFilter of this.customFilters) {
+ if (customFilter.isHiddenFilter) {
+ allFqs += "&fq=" + StringUtils.URIEncode(customFilter.queryFieldName + " exact " + StringUtils.quote((customFilter.valueId)));
+ }
+ }
}
/* if (this.quickFilter && this.entityType == "result") {
diff --git a/searchPages/searchUtils/searchUtils.class.ts b/searchPages/searchUtils/searchUtils.class.ts
index da049a3f..083f7750 100644
--- a/searchPages/searchUtils/searchUtils.class.ts
+++ b/searchPages/searchUtils/searchUtils.class.ts
@@ -27,10 +27,12 @@ export class SearchCustomFilter{
valueName:string; // Greece
isHiddenFilter:boolean;
selected:boolean;
- constructor( fieldName:string, queryFieldName:string, valueId:string, valueName:string ){
+ showFilterMessage:boolean;
+ constructor( fieldName:string, queryFieldName:string, valueId:string, valueName:string, showFilterMessage:boolean = true ){
if(valueId == "test" && properties.environment == "development"){
valueId = "covid-19";
}
+ this.showFilterMessage = showFilterMessage;
this.isHiddenFilter = true;
this.fieldName = fieldName;
this.queryFieldName = queryFieldName;