From: Bill Erickson <berickxx@gmail.com>
Date: Mon, 28 Feb 2022 21:18:37 +0000 (-0500)
Subject: LP1904036 Patron search Clear Form clears visible results/summary
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=28b2f8a185685b19f08055b8be620bc7f042fb46;p=evergreen%2Ftadl.git

LP1904036 Patron search Clear Form clears visible results/summary

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
---

diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/patron.component.html b/Open-ILS/src/eg2/src/app/staff/circ/patron/patron.component.html
index 823af65181..a0d6ca335e 100644
--- a/Open-ILS/src/eg2/src/app/staff/circ/patron/patron.component.html
+++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/patron.component.html
@@ -229,6 +229,7 @@
                 [patronIds]="recentPatronIds()"
                 [startWithSearch]="context.lastPatronSearch"
                 (searchFired)="patronSearchFired($event)"
+                (formCleared)="patronSearchCleared()"
                 (selectionChange)="patronSelectionChange($event)"
                 (patronsActivated)="patronsActivated($event)">
               </eg-patron-search> 
diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/patron.component.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/patron.component.ts
index d476cbf0a1..60703cd77f 100644
--- a/Open-ILS/src/eg2/src/app/staff/circ/patron/patron.component.ts
+++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/patron.component.ts
@@ -358,5 +358,10 @@ export class PatronComponent implements OnInit, AfterViewInit {
             return 0;
         }
     }
+
+    patronSearchCleared() {
+        this.context.summary = null;
+        this.patronId = null;
+    }
 }
 
diff --git a/Open-ILS/src/eg2/src/app/staff/share/patron/search.component.ts b/Open-ILS/src/eg2/src/app/staff/share/patron/search.component.ts
index d3b9da7f51..aee014868b 100644
--- a/Open-ILS/src/eg2/src/app/staff/share/patron/search.component.ts
+++ b/Open-ILS/src/eg2/src/app/staff/share/patron/search.component.ts
@@ -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> {