From d57505150838762b2ddba3587f886bbdcb07ceb4 Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Tue, 20 Oct 2020 15:11:40 +0000 Subject: [PATCH] [Library|Trunk] Search - fix issues after filters as href - keep result types when page, sort, size changes git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@59653 d315682c-612b-4755-9ff5-7f18f6832af3 --- searchPages/searchUtils/newSearchPage.component.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/searchPages/searchUtils/newSearchPage.component.ts b/searchPages/searchUtils/newSearchPage.component.ts index 9bcd78f6..34b740f7 100644 --- a/searchPages/searchUtils/newSearchPage.component.ts +++ b/searchPages/searchUtils/newSearchPage.component.ts @@ -342,7 +342,7 @@ export class NewSearchPageComponent { */ public getSelectedFilters(): string[] { var selected: string[] = []; - var filters= (this.filters.length > 0)?this.filters:this.URLCreatedFilters; + var filters= this.URLCreatedFilters; for (var i = 0; i < filters.length; i++) { var filter: Filter = filters[i]; if (filter.countSelectedValues > 0) { @@ -1324,7 +1324,9 @@ public static createRangeFilterQuery(rangeField,selectedFromValue, selectedToVal if (this.resultTypes && (this.entityType == 'publication' || this.entityType == 'dataset' || this.entityType == 'software' || this.entityType == 'other' || this.entityType == "result")) { let values = []; for(let value of this.resultTypes.values){ - values.push(value.id); + if(value.selected) { + values.push(value.id); + } } this.selectedTypesNum = 0; if (values.length > 0 && values.length != 4) { @@ -1410,6 +1412,7 @@ public static createRangeFilterQuery(rangeField,selectedFromValue, selectedToVal for(let type of types){ if(["publications", "datasets","software", "other"].indexOf(StringUtils.unquote(type))!=-1 && this.resultTypeOptions[StringUtils.unquote(type)]){ this.resultTypes.values.push({name: this.resultTypeOptions[StringUtils.unquote(type)].name , id:StringUtils.unquote(type),selected:true, number:0}); + this.resultTypes.countSelectedValues++; } }