mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 03:16:10 -06:00 
			
		
		
		
	hide the filter when it's cleared.
This commit is contained in:
		@@ -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>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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)
 | 
			
		||||
 
 | 
			
		||||
@@ -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 {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user