mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Merge pull request #226 from paperless-ngx/fix-issue-225-management-page-filtering
Fix issue #225 management page filtering, add esc clearing of filter field
This commit is contained in:
commit
01c1b42319
@ -6,7 +6,7 @@
|
|||||||
<div class="col-md mb-2 mb-xl-0">
|
<div class="col-md mb-2 mb-xl-0">
|
||||||
<div class="form-inline d-flex align-items-center">
|
<div class="form-inline d-flex align-items-center">
|
||||||
<label class="text-muted me-2 mb-0" i18n>Filter by:</label>
|
<label class="text-muted me-2 mb-0" i18n>Filter by:</label>
|
||||||
<input class="form-control form-control-sm flex-fill w-auto" type="text" [(ngModel)]="nameFilter" placeholder="Name" i18n-placeholder>
|
<input class="form-control form-control-sm flex-fill w-auto" type="text" autofocus [(ngModel)]="nameFilter" (keyup)="onNameFilterKeyUp($event)" placeholder="Name" i18n-placeholder>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<div class="col-md mb-2 mb-xl-0">
|
<div class="col-md mb-2 mb-xl-0">
|
||||||
<div class="form-inline d-flex align-items-center">
|
<div class="form-inline d-flex align-items-center">
|
||||||
<label class="text-muted me-2 mb-0" i18n>Filter by:</label>
|
<label class="text-muted me-2 mb-0" i18n>Filter by:</label>
|
||||||
<input class="form-control form-control-sm flex-fill w-auto" type="text" [(ngModel)]="nameFilter" placeholder="Name" i18n-placeholder>
|
<input class="form-control form-control-sm flex-fill w-auto" type="text" autofocus [(ngModel)]="nameFilter" (keyup)="onNameFilterKeyUp($event)" placeholder="Name" i18n-placeholder>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -61,6 +61,7 @@ export abstract class GenericListComponent<T extends ObjectWithId> implements On
|
|||||||
distinctUntilChanged()
|
distinctUntilChanged()
|
||||||
).subscribe(title => {
|
).subscribe(title => {
|
||||||
this._nameFilter = title
|
this._nameFilter = title
|
||||||
|
this.page = 1
|
||||||
this.reloadData()
|
this.reloadData()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -124,4 +125,8 @@ export abstract class GenericListComponent<T extends ObjectWithId> implements On
|
|||||||
set nameFilter(nameFilter: string) {
|
set nameFilter(nameFilter: string) {
|
||||||
this.nameFilterDebounce.next(nameFilter)
|
this.nameFilterDebounce.next(nameFilter)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onNameFilterKeyUp(event: KeyboardEvent) {
|
||||||
|
if (event.code == 'Escape') this.nameFilterDebounce.next(null)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<div class="col-md mb-2 mb-xl-0">
|
<div class="col-md mb-2 mb-xl-0">
|
||||||
<div class="form-inline d-flex align-items-center">
|
<div class="form-inline d-flex align-items-center">
|
||||||
<label class="text-muted me-2 mb-0" i18n>Filter by:</label>
|
<label class="text-muted me-2 mb-0" i18n>Filter by:</label>
|
||||||
<input class="form-control form-control-sm flex-fill w-auto" type="text" [(ngModel)]="nameFilter" placeholder="Name" i18n-placeholder>
|
<input class="form-control form-control-sm flex-fill w-auto" type="text" autofocus [(ngModel)]="nameFilter" (keyup)="onNameFilterKeyUp($event)" placeholder="Name" i18n-placeholder>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user