From: Bill Erickson Date: Mon, 14 Oct 2019 15:04:17 +0000 (-0400) Subject: LP1842763 Vandelay allow targeted import w/o action X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=cdf5861aaa865ea7152fa6a2e78143a365128c91;p=working%2FEvergreen.git 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 --- 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(); } }