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 16:55:33 +0000 (11:55 -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 729a62e..9629c31 100644 (file)
@@ -685,9 +685,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;
             }