0 || !loadPaging )"
class="uk-alert uk-margin-small-top ">
@@ -399,4 +391,3 @@
-
diff --git a/searchPages/searchUtils/newSearchPage.component.ts b/searchPages/searchUtils/newSearchPage.component.ts
index 96aa3e20..ee6c4bf9 100644
--- a/searchPages/searchUtils/newSearchPage.component.ts
+++ b/searchPages/searchUtils/newSearchPage.component.ts
@@ -138,11 +138,9 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
//Dashboard
filterToggle = false;
- customFilterEnabled: boolean = false;
//stickyform
@Input() stickyForm: boolean = false;
- @ViewChild('removeCustomFilter') removeCustomFilter: AlertModal;
currentValueToRemove;
currentFilterToRemove;
public indexUpdateDate: Date;
@@ -185,7 +183,6 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
if (params['page'] && params['page'] != 1) {
HelperFunctions.scrollToId("searchForm");
}
- this.customFilterEnabled = params['cf'] && params['cf'] == "true";
if (this.basicMetaDescription.length == 0) {
if (this.entityType == "result") {
this.basicMetaDescription = [OpenaireEntities.RESULTS, "Discover" + (this.properties.adminToolsCommunity == 'openaire' ? " over 100 million of" : "") + " "+OpenaireEntities.RESULTS+" ", "categorized by research type, year range, funder, languages, "+OpenaireEntities.COMMUNITY+" and "+OpenaireEntities.DATASOURCES+"."];
@@ -644,10 +641,6 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
public removeFilter(value: Value, filter: Filter, forceRemove: boolean = false) {
this.currentValueToRemove = value;
this.currentFilterToRemove = filter;
- if (!forceRemove && this.customFilter && this.customFilter.queryFieldName == filter.filterId && this.customFilter.valueId == value.id && this.customFilter.promptToAddFilter) {
- this.openRemoveCustomFilterModal();
- return;
- }
filter.countSelectedValues--;
this.selectedFilters--;
if (value.selected == true) {
@@ -661,20 +654,7 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
// }
this.goTo(1);
}
-
- public openRemoveCustomFilterModal() {
- this.removeCustomFilter.alertTitle = 'Remove filter';
- this.removeCustomFilter.message = 'You are about to see results that are not related to ' + this.customFilter.valueName + '. Do you want to proceed?';
- this.removeCustomFilter.okButtonText = 'Yes';
- this.removeCustomFilter.cancelButtonText = 'No';
- this.removeCustomFilter.open();
- }
-
- closeCustomFilterModal() {
- this.customFilterEnabled = false;
- this.removeFilter(this.currentValueToRemove, this.currentFilterToRemove, true);
- }
-
+
public removeRangeFilter(filter: RangeFilter) {
filter.selectedFromValue = null;
filter.selectedToValue = null;
@@ -718,42 +698,7 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
}
}*/
- /**
- * Set selected the value of the custom filter.
- */
- addCustomFilter() {
- this.customFilter.selected = true;
- this.customFilterEnabled = true;
- if (this.refineFields.indexOf(this.customFilter.queryFieldName) != -1) {
- let found = false;
- for (let filter of this.filters) {
- if (this.customFilter.queryFieldName == filter.filterId) {
- for (let value of filter.values) {
- if (value.id == this.customFilter.valueId) {
- value.selected = true;
- filter.countSelectedValues++;
- found = true;
- break;
- }
- }
- //add filter when field exist in refine but not in the refine values
- if (!found) {
- filter.countSelectedValues++;
- filter.values.push({
- selected: true,
- name: this.customFilter.valueName,
- id: this.customFilter.valueId,
- number: 0
- });
- }
- break;
- }
- }
- }
- this.filterChanged(null);
-
- }
-
+
// for loading
public openLoading() {
this.loading.open();
@@ -1112,8 +1057,7 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
allFqs += fq;
}
}
- this.customFilterEnabled = URLparams["cf"] == "true";
- if (this.customFilter && (this.customFilter.isHiddenFilter || this.customFilterEnabled)) {
+ if (this.customFilter && (this.customFilter.isHiddenFilter)) {
allFqs += "&fq=" + StringUtils.URIEncode(this.customFilter.queryFieldName + " exact " + StringUtils.quote((this.customFilter.valueId)));
}
@@ -1455,12 +1399,7 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
this.parameterNames.push("keyword");
this.parameterValues.push(this.searchUtils.keyword);
}
-
-
- if (this.customFilterEnabled) {
- this.parameterNames.push("cf");
- this.parameterValues.push("true");
- }
+
// if (this.searchUtils.size != this.resultsPerPage) {
// // allLimits += ((allLimits.length == 0) ? '?' : '&') + 'size=' + this.searchUtils.size;
// this.parameterNames.push("size");
diff --git a/searchPages/searchUtils/searchUtils.class.ts b/searchPages/searchUtils/searchUtils.class.ts
index f3cc2ace..da049a3f 100644
--- a/searchPages/searchUtils/searchUtils.class.ts
+++ b/searchPages/searchUtils/searchUtils.class.ts
@@ -27,7 +27,6 @@ export class SearchCustomFilter{
valueName:string; // Greece
isHiddenFilter:boolean;
selected:boolean;
- promptToAddFilter:boolean;
constructor( fieldName:string, queryFieldName:string, valueId:string, valueName:string ){
if(valueId == "test" && properties.environment == "development"){
valueId = "covid-19";
@@ -38,7 +37,6 @@ export class SearchCustomFilter{
this.valueId = valueId;
this.valueName = valueName;
this.selected = null;
- this.promptToAddFilter = false;
}
public getParameters(params={}){