mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05: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 w-100 mb-3" [hidden]="!showFilter"> | ||||||
|   <div class="card-body"> |   <div class="card-body"> | ||||||
|     <h5 class="card-title">Filter</h5> |     <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> | ||||||
| </div> | </div> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -66,6 +66,11 @@ export class DocumentListComponent implements OnInit { | |||||||
|     this.list.filterRules = this.filterRules |     this.list.filterRules = this.filterRules | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   clearFilterRules() { | ||||||
|  |     this.list.filterRules = this.filterRules | ||||||
|  |     this.showFilter = false | ||||||
|  |   } | ||||||
|  |  | ||||||
|   loadViewConfig(config: SavedViewConfig) { |   loadViewConfig(config: SavedViewConfig) { | ||||||
|     this.filterRules = cloneFilterRules(config.filterRules) |     this.filterRules = cloneFilterRules(config.filterRules) | ||||||
|     this.list.load(config) |     this.list.load(config) | ||||||
|   | |||||||
| @@ -18,6 +18,9 @@ export class FilterEditorComponent implements OnInit { | |||||||
|  |  | ||||||
|   constructor(private documentTypeService: DocumentTypeService, private tagService: TagService, private correspondentService: CorrespondentService) { } |   constructor(private documentTypeService: DocumentTypeService, private tagService: TagService, private correspondentService: CorrespondentService) { } | ||||||
|  |  | ||||||
|  |   @Output() | ||||||
|  |   clear = new EventEmitter() | ||||||
|  |  | ||||||
|   @Input() |   @Input() | ||||||
|   filterRules: FilterRule[] = [] |   filterRules: FilterRule[] = [] | ||||||
|  |  | ||||||
| @@ -48,7 +51,7 @@ export class FilterEditorComponent implements OnInit { | |||||||
|  |  | ||||||
|   clearClicked() { |   clearClicked() { | ||||||
|     this.filterRules.splice(0,this.filterRules.length) |     this.filterRules.splice(0,this.filterRules.length) | ||||||
|     this.apply.next() |     this.clear.next() | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   ngOnInit(): void { |   ngOnInit(): void { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 jonaswinkler
					jonaswinkler