LPXXX Angular Volcopy
authorBill Erickson <berickxx@gmail.com>
Mon, 6 Jul 2020 15:03:21 +0000 (11:03 -0400)
committerBill Erickson <berickxx@gmail.com>
Mon, 6 Jul 2020 15:03:21 +0000 (11:03 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/staff/cat/volcopy/config.component.html
Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts

index 8125e57..031561a 100644 (file)
         </li>
         <li class="list-group-item">
           <div class="form-check form-check-inline">
-            <label class="mr-2" for="statcat_filter" i18n>
-              Stat Cat Library Filter
-            </label>
             <eg-org-select
               domId="statcat_filter"
               placeholder="Stat Cat Filter..." i18n-placeholder
               [initialOrgId]="volcopy.defaults.values.statcat_filter"
               (onChange)="volcopy.defaults.values.statcat_filter = $event ? $event.id() : null">
             </eg-org-select>
+            <label class="ml-2" for="statcat_filter" i18n>
+              Default Stat Cat Library Filter
+            </label>
           </div>
         </li>
       </ul>
index 1b2d109..6bdda44 100644 (file)
@@ -336,11 +336,19 @@ export class CopyAttrsComponent implements OnInit, AfterViewInit {
 
         const entryId = this.statCatValues[catId];
 
+        if (!entryId || !this.volcopy.statCatEntryMap[entryId]) {
+            console.warn(
+                `Attempt to apply stat cat value which does not exist.
+                This is likely the result of a stale copy template.
+                stat_cat=${catId} entry=${entryId}`);
+
+            return;
+        }
+
         this.context.copyList().forEach(copy => {
 
             let entry = copy.stat_cat_entries()
                 .filter(e => e.stat_cat() === catId)[0];
-                console.log('0', entry);
 
             if (entry) {
                 if (entry.id() === entryId) {