From: Bill Erickson Date: Wed, 3 Mar 2021 17:27:51 +0000 (-0500) Subject: LP1888723 Avoid defaulting CN labels for existing CN's X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=28154b4e27d2e7f971fe989c2b6143f38ed5b343;p=working%2FEvergreen.git LP1888723 Avoid defaulting CN labels for existing CN's 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 Signed-off-by: Ruth Frasur Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.ts index 4fb93a191e..5b28baafa7 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.ts @@ -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 { diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.service.ts b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.service.ts index 46d9b39dc7..4c37cbd0d3 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.service.ts @@ -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',