From: Bill Erickson Date: Mon, 12 Jul 2021 16:02:58 +0000 (-0400) Subject: LP1888723 Angular volcopy Apply All actions X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4a57fee6576e6aad8d0bd4a3d5d83d30f2d2e1c2;p=evergreen%2Ftadl.git LP1888723 Angular volcopy Apply All actions Replace Save and SAve & Exit buttons in the Angular holdings editor with 'Apply All & Save' and 'Apply All, Save & Exit' buttons. With this, staff are not required to click Apply on every change. 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/copy-attrs.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts index 1967a77445..6e7b67d07c 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 @@ -651,6 +651,13 @@ export class CopyAttrsComponent implements OnInit, AfterViewInit { hasActiveInput(): boolean { return this.batchAttrs.filter(attr => attr.editing).length > 0; } + + applyPendingChanges() { + // If a user has left any changes in the 'editing' state, this + // will go through and apply the values so they do not have to + // click Apply for every one. + this.batchAttrs.filter(attr => attr.editing).forEach(attr => attr.save()); + } } diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.html b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.html index 2f4ac1f002..bfa92177f2 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.html +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.html @@ -94,12 +94,12 @@
- - + + [disabled]="isNotSaveable()" i18n>Apply All, Save & Exit diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.ts index d08c7ff5da..6d2a0b6824 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.ts @@ -336,6 +336,8 @@ export class VolCopyComponent implements OnInit { save(close?: boolean): Promise { this.loading = true; + this.copyAttrs.applyPendingChanges(); + // Volume update API wants volumes fleshed with copies, instead // of the other way around, which is what we have here. const volumes: IdlObject[] = [];