fix issue with selected types filter

This commit is contained in:
argirok 2022-04-21 16:35:34 +03:00
parent 020a947687
commit fc2fbb5ba0
1 changed files with 17 additions and 15 deletions

View File

@ -1468,11 +1468,16 @@ export class NewSearchPageComponent {
}*/ }*/
if ((this.entityType == 'publication' || this.entityType == 'dataset' || this.entityType == 'software' || this.entityType == 'other' || this.entityType == "result")) { if ((this.entityType == 'publication' || this.entityType == 'dataset' || this.entityType == 'software' || this.entityType == 'other' || this.entityType == "result")) {
this.resultTypes = {values:[],filterId:"type", countSelectedValues: 0, filterType: 'checkbox', originalFilterId: "", valueIsExact: true, title: "Type",filterOperator:"or"}; this.resultTypes = {values:[],filterId:"type", countSelectedValues: 0, filterType: 'checkbox', originalFilterId: "", valueIsExact: true, title: "Type",filterOperator:"or"};
if (URLparams["type"]) { for (let typeOption of Object.keys(this.resultTypeOptions)) {
let types = URLparams["type"]; let type = typeOption;
types = Array.isArray(types) ? types.join(',').split(",") : types.split(","); if ( URLparams["type"] && URLparams["type"].indexOf(type)==-1 || !URLparams["type"]) {
for (let type of types) { this.resultTypes.values.push({
if (["publications", "datasets", "software", "other"].indexOf(StringUtils.unquote(type)) != -1 && this.resultTypeOptions[StringUtils.unquote(type)]) { name: this.resultTypeOptions[StringUtils.unquote(type)].name,
id: StringUtils.unquote(type),
selected: false,
number: 0
});
}else{
this.resultTypes.values.push({ this.resultTypes.values.push({
name: this.resultTypeOptions[StringUtils.unquote(type)].name, name: this.resultTypeOptions[StringUtils.unquote(type)].name,
id: StringUtils.unquote(type), id: StringUtils.unquote(type),
@ -1482,9 +1487,6 @@ export class NewSearchPageComponent {
this.resultTypes.countSelectedValues++; this.resultTypes.countSelectedValues++;
} }
} }
}
} }
this.URLCreatedFilters = filters; this.URLCreatedFilters = filters;