From c5599f0d812dcbdc648f0790d9242ea7a9cfc053 Mon Sep 17 00:00:00 2001 From: Adam Woolford Date: Fri, 6 Jan 2023 15:13:53 -0500 Subject: [PATCH] LP19800544 Import all holdings templates Adds loop to importTemplate function so that the whole file will import Signed-off-by: Adam Woolford Signed-off-by: Jessica Woolford Signed-off-by: Beth Willis Signed-off-by: Michele Morgan --- .../src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts index e5f08bebdf..5841b32c7b 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts @@ -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; } -- 2.11.0