hide the filter when it's cleared.

This commit is contained in:
jonaswinkler 2020-12-03 15:02:27 +01:00
parent 802e389198
commit 20fc065567
3 changed files with 10 additions and 2 deletions

View File

@ -70,7 +70,7 @@
<div class="card w-100 mb-3" [hidden]="!showFilter">
<div class="card-body">
<h5 class="card-title">Filter</h5>
<app-filter-editor [(filterRules)]="filterRules" (apply)="applyFilterRules()"></app-filter-editor>
<app-filter-editor [(filterRules)]="filterRules" (apply)="applyFilterRules()" (clear)="clearFilterRules()"></app-filter-editor>
</div>
</div>

View File

@ -66,6 +66,11 @@ export class DocumentListComponent implements OnInit {
this.list.filterRules = this.filterRules
}
clearFilterRules() {
this.list.filterRules = this.filterRules
this.showFilter = false
}
loadViewConfig(config: SavedViewConfig) {
this.filterRules = cloneFilterRules(config.filterRules)
this.list.load(config)

View File

@ -18,6 +18,9 @@ export class FilterEditorComponent implements OnInit {
constructor(private documentTypeService: DocumentTypeService, private tagService: TagService, private correspondentService: CorrespondentService) { }
@Output()
clear = new EventEmitter()
@Input()
filterRules: FilterRule[] = []
@ -48,7 +51,7 @@ export class FilterEditorComponent implements OnInit {
clearClicked() {
this.filterRules.splice(0,this.filterRules.length)
this.apply.next()
this.clear.next()
}
ngOnInit(): void {