[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[] { public getSelectedFilters(): string[] {
var selected: 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++) { for (var i = 0; i < filters.length; i++) {
var filter: Filter = filters[i]; var filter: Filter = filters[i];
if (filter.countSelectedValues > 0) { if (filter.countSelectedValues > 0) {
@ -1324,8 +1324,10 @@ public static createRangeFilterQuery(rangeField,selectedFromValue, selectedToVal
if (this.resultTypes && (this.entityType == 'publication' || this.entityType == 'dataset' || this.entityType == 'software' || this.entityType == 'other' || this.entityType == "result")) { if (this.resultTypes && (this.entityType == 'publication' || this.entityType == 'dataset' || this.entityType == 'software' || this.entityType == 'other' || this.entityType == "result")) {
let values = []; let values = [];
for(let value of this.resultTypes.values){ for(let value of this.resultTypes.values){
if(value.selected) {
values.push(value.id); values.push(value.id);
} }
}
this.selectedTypesNum = 0; this.selectedTypesNum = 0;
if (values.length > 0 && values.length != 4) { if (values.length > 0 && values.length != 4) {
this.parameterNames.push("type"); this.parameterNames.push("type");
@ -1410,6 +1412,7 @@ public static createRangeFilterQuery(rangeField,selectedFromValue, selectedToVal
for(let type of types){ for(let type of types){
if(["publications", "datasets","software", "other"].indexOf(StringUtils.unquote(type))!=-1 && this.resultTypeOptions[StringUtils.unquote(type)]){ 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.values.push({name: this.resultTypeOptions[StringUtils.unquote(type)].name , id:StringUtils.unquote(type),selected:true, number:0});
this.resultTypes.countSelectedValues++;
} }
} }