LP1888723 Call number modification repair
authorBill Erickson <berickxx@gmail.com>
Mon, 28 Dec 2020 23:36:01 +0000 (18:36 -0500)
committerBill Erickson <berickxx@gmail.com>
Mon, 28 Dec 2020 23:36:03 +0000 (18:36 -0500)
Fixes an issues where modifying the call number label without modifying
any items would result in modifying the call number for all linked items
instead of the items actually loaded in the volcopy editor.

Also fixes a case where modifying call numbers failed to reflect
correctly in the catalog holdings view.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.ts
Open-ILS/src/eg2/src/app/staff/catalog/record/holdings.component.ts

index 6d09b11..d08c7ff 100644 (file)
@@ -353,6 +353,12 @@ export class VolCopyComponent implements OnInit {
                     return;
                 }
 
+                // Be sure to include copies when the volume is changed
+                // without any changes to the copies.  This ensures the
+                // API knows when we are modifying a subset of the total
+                // copies on a volume, e.g. when changing volume labels
+                if (newVol.ischanged()) { copy.ischanged(true); }
+
                 if (copy.ischanged() || copy.isnew() || copy.isdeleted()) {
                     const copyClone = this.idl.clone(copy);
                     // De-flesh call number
index 5f17c57..814ff77 100644 (file)
@@ -242,8 +242,14 @@ export class HoldingsMaintenanceComponent implements OnInit {
 
         this.broadcaster.listen('eg.holdings.update').subscribe(data => {
             if (data && data.records && data.records.includes(this.recordId)) {
-                this.refreshHoldings = true;
-                this.holdingsGrid.reload();
+                this.hardRefresh();
+                // A hard refresh is needed to accommodate cases where
+                // a new call number is created for a subset of copies.
+                // We may revisit this later and use soft refresh
+                // (below) vs. hard refresh (above) depending on what
+                // specifically is changed.
+                // this.refreshHoldings = true;
+                // this.holdingsGrid.reload();
             }
         });