[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
This commit is contained in:
argiro.kokogiannaki 2020-10-20 15:11:40 +00:00
parent abb24e34cf
commit d575051508
1 changed files with 5 additions and 2 deletions

View File

@ -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++;
}
}