LP19800544 Import all holdings templates
authorAdam Woolford <adam.woolford@hotmail.com>
Fri, 6 Jan 2023 20:13:53 +0000 (15:13 -0500)
committerMichele Morgan <mmorgan@noblenet.org>
Mon, 23 Jan 2023 17:02:09 +0000 (12:02 -0500)
Adds loop to importTemplate function so that the whole file will import

Signed-off-by: Adam Woolford <adam.woolford@hotmail.com>
Signed-off-by: Jessica Woolford <jwoolford@biblio.org>
Signed-off-by: Beth Willis <willis@noblenet.org>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts

index e5f08be..5841b32 100644 (file)
@@ -686,9 +686,12 @@ export class CopyAttrsComponent implements OnInit, AfterViewInit {
 
             try {
                 const template = JSON.parse(reader.result as string);
-                const name = Object.keys(template)[0];
-                this.volcopy.templates[name] = template[name];
-            } catch (E) {
+                var theKeys = Object.keys(template);
+                for(let i = 0; i < theKeys.length; i++){
+                    var name = theKeys[i];
+                    this.volcopy.templates[name]=template[name];
+                };
+                        } catch (E) {
                 console.error('Invalid Item Attribute template', E);
                 return;
             }