LP1888723 Avoid defaulting CN labels for existing CN's
authorBill Erickson <berickxx@gmail.com>
Wed, 3 Mar 2021 17:27:51 +0000 (12:27 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Sun, 15 Aug 2021 23:56:33 +0000 (19:56 -0400)
When a call number is loaded in the editor whose label is an empty
string, avoid applying a default values to the label so it's clear in
the UI that the call number label is blank.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Ruth Frasur <rfrasur@library.in.gov>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.ts
Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.service.ts

index 4fb93a1..5b28baa 100644 (file)
@@ -92,7 +92,10 @@ export class VolEditComponent implements OnInit {
         this.volcopy.fetchRecordVolLabels(this.context.recordId)
         .then(labels => this.recordVolLabels = labels)
         .then(_ => this.volcopy.fetchBibParts(this.context.getRecordIds()))
-        .then(_ => this.addStubCopies());
+        .then(_ => this.addStubCopies())
+        // It's possible the loaded data is not strictly allowed,
+        // e.g. empty string call number labels
+        .then(_ => this.emitSaveChange());
     }
 
     copyStatLabel(copy: IdlObject): string {
index 46d9b39..4c37cbd 100644 (file)
@@ -312,6 +312,11 @@ export class VolCopyService {
             // in a previous iteration of this loop.
             if (vol.label()) { return; }
 
+            // Avoid applying call number labels to existing call numbers
+            // that don't already have a label.  This allows the user to
+            // see that an action needs to be taken on the volume.
+            if (!vol.isnew()) { return; }
+
             promise = promise.then(_ => {
                 return this.net.request(
                     'open-ils.cat',