LP1904036 Penalty dialog resets after each use
authorBill Erickson <berickxx@gmail.com>
Mon, 7 Feb 2022 16:41:58 +0000 (11:41 -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/messages.component.ts
Open-ILS/src/eg2/src/app/staff/share/patron/penalty-dialog.component.ts

index 203b2ba..1fed8df 100644 (file)
@@ -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(_ => {
index ec0717f..2131e2c 100644 (file)
@@ -71,6 +71,8 @@ export class PatronPenaltyDialogComponent
     init(): Observable<any> {
         this.dataLoaded = false;
 
+        this.penaltyTypeFromButton = 0;
+        this.penaltyTypeFromSelect = '';
         this.initials = '';
         this.noteText = '';