123 |
123 |
@ViewChild('removeCustomFilter') removeCustomFilter: AlertModal;
|
124 |
124 |
currentValueToRemove;
|
125 |
125 |
currentFilterToRemove;
|
126 |
|
isCustomFilterSelected:boolean = true;
|
127 |
126 |
constructor(private route: ActivatedRoute,
|
128 |
127 |
private location: Location,
|
129 |
128 |
private _meta: Meta,
|
... | ... | |
624 |
623 |
}
|
625 |
624 |
|
626 |
625 |
closeCustomFilterModal() {
|
|
626 |
this.customFilterEnabled = false;
|
627 |
627 |
this.removeFilter(this.currentValueToRemove, this.currentFilterToRemove, true);
|
628 |
|
this.isCustomFilterSelected = false;
|
629 |
628 |
}
|
630 |
629 |
|
631 |
630 |
public removeRangeFilter(filter: RangeFilter) {
|
... | ... | |
675 |
674 |
*/
|
676 |
675 |
addCustomFilter() {
|
677 |
676 |
this.customFilter.selected = true;
|
678 |
|
if(this.refineFields.indexOf(this.customFilter.queryFieldName) == -1 ){
|
679 |
|
this.customFilterEnabled = true;
|
680 |
|
}else {
|
|
677 |
this.customFilterEnabled = true;
|
|
678 |
if(this.refineFields.indexOf(this.customFilter.queryFieldName) != -1 ){
|
|
679 |
let found = false;
|
681 |
680 |
for (let filter of this.filters) {
|
682 |
681 |
if (this.customFilter.queryFieldName == filter.filterId) {
|
683 |
682 |
for (let value of filter.values) {
|
684 |
683 |
if (value.id == this.customFilter.valueId) {
|
685 |
684 |
value.selected = true;
|
686 |
685 |
filter.countSelectedValues++;
|
|
686 |
found = true;
|
|
687 |
break;
|
687 |
688 |
}
|
688 |
689 |
}
|
|
690 |
//add filter when field exist in refine but not in the refine values
|
|
691 |
if(!found){
|
|
692 |
filter.countSelectedValues ++ ;
|
|
693 |
filter.values.push({selected : true, name: this.customFilter.valueName, id: this.customFilter.valueId, number:0});
|
|
694 |
}
|
|
695 |
break;
|
689 |
696 |
}
|
690 |
697 |
}
|
691 |
698 |
}
|
... | ... | |
1015 |
1022 |
}
|
1016 |
1023 |
}
|
1017 |
1024 |
this.customFilterEnabled = URLparams["cf"] == "true";
|
1018 |
|
if(this.customFilter && (this.customFilter.isHiddenFilter || (this.refineFields.indexOf(this.customFilter.queryFieldName) == -1 && this.customFilterEnabled))){
|
|
1025 |
if(this.customFilter && (this.customFilter.isHiddenFilter || this.customFilterEnabled)){
|
1019 |
1026 |
allFqs += "&fq=" + StringUtils.URIEncode(this.customFilter.queryFieldName + " exact " + StringUtils.quote((this.customFilter.valueId)));
|
1020 |
1027 |
}
|
1021 |
1028 |
|
[Library|Trunk]
- Search page - custom filter: add filter value when the custom filter doesn't exists in refine values - this allows to remove it if there are no results
- quick selections: add check for aggregator