From 4a57fee6576e6aad8d0bd4a3d5d83d30f2d2e1c2 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 12 Jul 2021 12:02:58 -0400 Subject: [PATCH] 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 --- .../src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts | 7 +++++++ Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.html | 8 ++++---- Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.ts | 2 ++ 3 files changed, 13 insertions(+), 4 deletions(-) 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[] = []; -- 2.11.0