From cdf5861aaa865ea7152fa6a2e78143a365128c91 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 14 Oct 2019 11:04:17 -0400 Subject: [PATCH] LP1842763 Vandelay allow targeted import w/o action Allow the user to process selected queued records, which may or may not have an overlay target selected, without requiring an import action be selected. In the case of records with overlay targets, the import action (overlay selected target) is implicit, so there's no need to select an action. Additionally, when an import selection has been defined, change the action button from "Upload" to "Import", since we're past the upload stage at this point. Signed-off-by: Bill Erickson --- .../app/staff/cat/vandelay/import.component.html | 5 ++++- .../src/app/staff/cat/vandelay/import.component.ts | 26 +++++++++++++++------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.html b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.html index 2882bc55d8..93f237ac8e 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.html +++ b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.html @@ -285,7 +285,10 @@
+ (click)="upload()"> + Import + Upload +
diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.ts index 08f795d84f..549254e9c2 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.ts @@ -323,7 +323,8 @@ export class ImportComponent implements OnInit, AfterViewInit, OnDestroy { // Required form data varies depending on context. hasNeededData(): boolean { if (this.vandelay.importSelection) { - return this.importActionSelected(); + // No additional form data required + return true; } else { return this.selectedQueue && Boolean(this.recordType) && Boolean(this.selectedFile); @@ -502,16 +503,25 @@ export class ImportComponent implements OnInit, AfterViewInit, OnDestroy { importRecords(): Promise { - if (!this.importActionSelected()) { - return Promise.resolve(); - } - const selection = this.vandelay.importSelection; - if (selection && !selection.importQueue) { - return this.importRecordQueue(selection.recordIds); - } else { + if (selection) { + // Additional import actions are optional + + if (selection.importQueue) { + return this.importRecordQueue(); + + } else { + // Import selected records only + return this.importRecordQueue(selection.recordIds); + } + + } else if (this.importActionSelected()) { + // Importing a new queue requires at least one import action. + return this.importRecordQueue(); + } else { + return Promise.resolve(); } } -- 2.11.0