LP1956986 Copy alerts consistently set ack_staff
authorBill Erickson <berickxx@gmail.com>
Wed, 13 Jul 2022 15:51:57 +0000 (11:51 -0400)
committerBill Erickson <berickxx@gmail.com>
Wed, 27 Jul 2022 20:36:02 +0000 (16:36 -0400)
Moves the logic of when to apply a value for ack_staff into the copy
alerts dialog.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Elaine Hardy <ehardy@georgialibraries.org>
Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts
Open-ILS/src/eg2/src/app/staff/share/holdings/copy-alerts-dialog.component.ts

index ecd0e86..35a08ed 100644 (file)
@@ -452,9 +452,7 @@ export class CopyAttrsComponent implements OnInit, AfterViewInit {
                         existing.alert_type(alert.alert_type());
                         existing.temp(alert.temp());
                         existing.ack_time(alert.ack_time());
-                        if (alert.ack_time() === 'now') {
-                            existing.ack_staff(this.auth.user().id());
-                        }
+                        existing.ack_staff(alert.ack_staff());
                         copy.ischanged(true);
                     }
                 });
index 8ae114c..04eb9d5 100644 (file)
@@ -179,6 +179,13 @@ export class CopyAlertsDialogComponent
         const changedAlerts = this.copy ?
             this.copy.copy_alerts().filter(a => a.ischanged()) :
             [];
+
+        changedAlerts.forEach(alrt => {
+            if (alrt.ack_time() === 'now') {
+                alrt.ack_staff(this.auth.user().id());
+            }
+        });
+
         if (this.inPlaceCreateMode) {
             this.close({ newAlerts: this.newAlerts, changedAlerts: changedAlerts });
             return;