LPXXX Angular Volcopy
authorBill Erickson <berickxx@gmail.com>
Thu, 2 Jul 2020 20:56:52 +0000 (16:56 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 2 Jul 2020 20:56:52 +0000 (16:56 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts
Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.ts

index cf4e98a..818edef 100644 (file)
@@ -459,14 +459,11 @@ export class CopyAttrsComponent implements OnInit, AfterViewInit {
             template = this.volcopy.templates[name];
         }
 
-        // Changes will have applied to all items.
-        const copy = this.context.copyList()[0];
-
         this.batchAttrs.forEach(comp => {
             if (!comp.hasChanged) { return; }
 
-            const value = copy[comp.name]();
             const name = comp.name;
+            const value = this.values[name];
 
             if (value === null) {
                 delete template[name];
@@ -481,9 +478,8 @@ export class CopyAttrsComponent implements OnInit, AfterViewInit {
 
             } else {
 
-                // some values are fleshed.
-                // this assumes fleshed objects have an 'id' value,
-                // which is true so far.
+                // Some values are fleshed. this assumes fleshed objects
+                // have an 'id' value, which is true so far.
                 template[name] =
                     typeof value === 'object' ?  value.id() : value;
             }
index d16abb3..4c4505f 100644 (file)
@@ -393,9 +393,9 @@ export class VolCopyComponent implements OnInit {
 
             const evt = this.evt.parse(copyIds);
 
-            // TODO: confirm / handle overrides
-
+            // TODO: handle overrides?
             if (evt) {
+                this.loading = false;
                 alert(evt);
                 return;
             }