Skip to content

Commit

Permalink
fix fast filter
Browse files Browse the repository at this point in the history
  • Loading branch information
amirbashan committed Dec 16, 2024
1 parent 4c99a68 commit 46ca2b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ <h3>סינון מהיר:</h3>
<div class='items'>
@for (item of filtersState.staticFilters; track item.key) {
@if (item.key?.indexOf('human_situation') === 0 && item.key && filtersState.situationsMap[item.key]) {
<div *ngIf='getCount(item) > 5' class='item' [class.checked]='checkedSituation(item)'
<div *ngIf='getIsShowOption(item)' class='item' [class.checked]='checkedSituation(item)'
(click)='filtersState.toggleSituation(filtersState.situationsMap[item.key])'
>
<div class='checkbox'></div>
<span class='name'>{{filtersState.situationsMap[item.key].name}}</span>
<span class='count'>{{count((filtersState.allFilteredSituations || []).indexOf(item.key) > -1 ? null : item)}}</span>
</div>
} @else if (item.key?.indexOf('human_service') === 0 && item.key && filtersState.responsesMap[item.key]) {
<div *ngIf='getCount(item) > 5' class='item' [class.checked]='checkedResponse(item)'
<div *ngIf='getIsShowOption(item)' class='item' [class.checked]='checkedResponse(item)'
(click)='filtersState.toggleResponse(filtersState.responsesMap[item.key])'
>
<div class='checkbox'></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export class SrpStaticFiltersComponent implements OnChanges {
return (this.filtersState.currentSearchParams?.filter_responses || []).indexOf(item.key || '') > -1
}

getCount(item: any): number {
return parseInt(this.count((this.filtersState.currentSearchParams?.filter_responses || []).indexOf(item.key) > -1 ? null : item));
getIsShowOption(item: any): boolean {
if (this.checkedSituation(item) || this.checkedResponse(item)) return true;
const count = parseInt(this.count((this.filtersState.currentSearchParams?.filter_responses || []).indexOf(item.key) > -1 ? null : item));
return count > 5
}
}

0 comments on commit 46ca2b6

Please sign in to comment.