RED-8748 - added hidden property to filter model
This commit is contained in:
parent
590ebcbae2
commit
f24e5dbb82
@ -110,19 +110,21 @@
|
||||
@if (filter.children?.length && filter.expanded) {
|
||||
<div>
|
||||
@for (child of filter.children; track child) {
|
||||
<div class="padding-left mat-mdc-menu-item" iqserStopPropagation>
|
||||
<mat-checkbox
|
||||
(click)="filterCheckboxClicked(child, filterGroup, filter)"
|
||||
[checked]="child.checked"
|
||||
iqserStopPropagation
|
||||
>
|
||||
<ng-container
|
||||
[ngTemplateOutletContext]="{ filter: child }"
|
||||
[ngTemplateOutlet]="filterGroup.filterTemplate ?? defaultFilterLabelTemplate"
|
||||
></ng-container>
|
||||
</mat-checkbox>
|
||||
<ng-container [ngTemplateOutletContext]="{ filter: child }" [ngTemplateOutlet]="actionsTemplate"></ng-container>
|
||||
</div>
|
||||
@if (!child.hidden) {
|
||||
<div class="padding-left mat-mdc-menu-item" iqserStopPropagation>
|
||||
<mat-checkbox
|
||||
(click)="filterCheckboxClicked(child, filterGroup, filter)"
|
||||
[checked]="child.checked"
|
||||
iqserStopPropagation
|
||||
>
|
||||
<ng-container
|
||||
[ngTemplateOutletContext]="{ filter: child }"
|
||||
[ngTemplateOutlet]="filterGroup.filterTemplate ?? defaultFilterLabelTemplate"
|
||||
></ng-container>
|
||||
</mat-checkbox>
|
||||
<ng-container [ngTemplateOutletContext]="{ filter: child }" [ngTemplateOutlet]="actionsTemplate"></ng-container>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
@ -41,6 +41,11 @@ export class FilterService {
|
||||
this.showResetFilters$ = this._showResetFilters$;
|
||||
}
|
||||
|
||||
get noAnnotationsFilterChecked() {
|
||||
const filterGroup = this.filterGroups.find(g => g.slug === 'primaryFilters');
|
||||
return !!filterGroup?.filters[0]?.children.find(f => f.id === 'no-annotations-filter' && f.checked);
|
||||
}
|
||||
|
||||
get filterGroups(): IFilterGroup[] {
|
||||
return Object.values(this.#filterGroups$.getValue());
|
||||
}
|
||||
|
||||
@ -10,5 +10,6 @@ export interface IFilter {
|
||||
readonly required?: boolean;
|
||||
readonly disabled?: boolean;
|
||||
readonly helpModeKey?: string;
|
||||
readonly hidden?: boolean;
|
||||
readonly metadata?: Record<string, any>;
|
||||
}
|
||||
|
||||
@ -10,6 +10,7 @@ export class Filter implements IFilter, IListable {
|
||||
readonly checker?: (obj?: unknown) => boolean;
|
||||
readonly skipTranslation?: boolean;
|
||||
readonly metadata?: Record<string, any>;
|
||||
readonly hidden?: boolean;
|
||||
|
||||
checked: boolean;
|
||||
matches?: number;
|
||||
@ -25,6 +26,7 @@ export class Filter implements IFilter, IListable {
|
||||
this.required = !!filter.required;
|
||||
this.skipTranslation = !!filter.skipTranslation;
|
||||
this.metadata = filter.metadata;
|
||||
this.hidden = !!filter.hidden;
|
||||
}
|
||||
|
||||
get searchKey(): string {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user