LP1904036 Patron search Clear Form clears visible results/summary
authorBill Erickson <berickxx@gmail.com>
Mon, 28 Feb 2022 21:18:37 +0000 (16:18 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:41 +0000 (20:13 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>

Open-ILS/src/eg2/src/app/staff/circ/patron/patron.component.html
Open-ILS/src/eg2/src/app/staff/circ/patron/patron.component.ts
Open-ILS/src/eg2/src/app/staff/share/patron/search.component.ts

index 823af65..a0d6ca3 100644 (file)
                 [patronIds]="recentPatronIds()"
                 [startWithSearch]="context.lastPatronSearch"
                 (searchFired)="patronSearchFired($event)"
+                (formCleared)="patronSearchCleared()"
                 (selectionChange)="patronSelectionChange($event)"
                 (patronsActivated)="patronsActivated($event)">
               </eg-patron-search> 
index d476cbf..60703cd 100644 (file)
@@ -358,5 +358,10 @@ export class PatronComponent implements OnInit, AfterViewInit {
             return 0;
         }
     }
+
+    patronSearchCleared() {
+        this.context.summary = null;
+        this.patronId = null;
+    }
 }
 
index d3b9da7..aee0148 100644 (file)
@@ -73,6 +73,9 @@ export class PatronSearchComponent implements OnInit, AfterViewInit {
     // any searches run as a result of @Input() startWithSearch.
     @Output() searchFired: EventEmitter<PatronSearch>;
 
+    // Fired when the search form is cleared via the Clear Form button.
+    @Output() formCleared: EventEmitter<void> = new EventEmitter<void>();
+
     search: any = {};
     searchOrg: IdlObject;
     expandForm: boolean;
@@ -159,6 +162,8 @@ export class PatronSearchComponent implements OnInit, AfterViewInit {
 
     clear() {
         this.search = {profile: null};
+        this.searchGrid.reload();
+        this.formCleared.emit();
     }
 
     getRows(pager: Pager, sort: any[]): Observable<any> {