From: Bill Erickson <berickxx@gmail.com>
Date: Mon, 7 Feb 2022 16:41:58 +0000 (-0500)
Subject: LP1904036 Penalty dialog resets after each use
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=99e60525c588b781fb9aa557a5abcc0f3e086c98;p=evergreen%2Ftadl.git

LP1904036 Penalty dialog resets after each use

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/messages.component.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/messages.component.ts
index 203b2baa62..1fed8df694 100644
--- a/Open-ILS/src/eg2/src/app/staff/circ/patron/messages.component.ts
+++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/messages.component.ts
@@ -121,8 +121,12 @@ export class PatronMessagesComponent implements OnInit {
     }
 
     applyPenalty() {
-        this.penaltyDialog.open().subscribe(changes => {
-            if (changes) { this.mainGrid.reload(); }
+        this.penaltyDialog.penalty = null;
+        this.penaltyDialog.open({size: 'lg'}).subscribe(changes => {
+            if (changes) {
+                this.context.refreshPatron()
+                .then(_ => this.mainGrid.reload());
+            }
         });
     }
 
@@ -147,7 +151,7 @@ export class PatronMessagesComponent implements OnInit {
         let modified = false;
         from(penalties).pipe(concatMap(penalty => {
             this.penaltyDialog.penalty = penalty;
-            return this.penaltyDialog.open().pipe(tap(changed => {
+            return this.penaltyDialog.open({size: 'lg'}).pipe(tap(changed => {
                 if (changed) { modified = true; }
             }));
         })).toPromise().then(_ => {
diff --git a/Open-ILS/src/eg2/src/app/staff/share/patron/penalty-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/share/patron/penalty-dialog.component.ts
index ec0717f839..2131e2c49b 100644
--- a/Open-ILS/src/eg2/src/app/staff/share/patron/penalty-dialog.component.ts
+++ b/Open-ILS/src/eg2/src/app/staff/share/patron/penalty-dialog.component.ts
@@ -71,6 +71,8 @@ export class PatronPenaltyDialogComponent
     init(): Observable<any> {
         this.dataLoaded = false;
 
+        this.penaltyTypeFromButton = 0;
+        this.penaltyTypeFromSelect = '';
         this.initials = '';
         this.noteText = '';