From 48576fe0d0a648bee37de68fc7beba3585cbe7dc Mon Sep 17 00:00:00 2001 From: Kyle Huckins Date: Tue, 27 Nov 2018 21:07:35 +0000 Subject: [PATCH] lp1779158 Vandelay Authority Import Tweaks - Check for "Auth" string - Dummy rec.import_items when record is not bib - Teach resolveQueue() to assume startQueueId unless a queue is selected already Signed-off-by: Kyle Huckins Changes to be committed: modified: Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.ts modified: Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue.component.ts modified: Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.service.ts Signed-off-by: Bill Erickson Signed-off-by: Dan Wells --- .../eg2/src/app/staff/cat/vandelay/import.component.ts | 10 +++++++--- .../eg2/src/app/staff/cat/vandelay/queue.component.ts | 9 +++++++-- .../eg2/src/app/staff/cat/vandelay/vandelay.service.ts | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) 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 74341b929a..cd51da658d 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 @@ -371,7 +371,7 @@ export class ImportComponent implements OnInit, AfterViewInit, OnDestroy { // Extract selected queue ID or create a new queue when requested. resolveQueue(): Promise { - if (this.selectedQueue.freetext) { + if (this.selectedQueue && this.selectedQueue.freetext) { // Free text queue selector means create a new entry. // TODO: first check for name dupes @@ -384,7 +384,9 @@ export class ImportComponent implements OnInit, AfterViewInit, OnDestroy { ); } else { - return Promise.resolve(this.selectedQueue.id); + var queue_id = this.startQueueId; + if (this.selectedQueue) queue_id = this.selectedQueue.id; + return Promise.resolve(queue_id); } } @@ -434,8 +436,10 @@ export class ImportComponent implements OnInit, AfterViewInit, OnDestroy { // Nothing to enqueue when processing pre-queued records return Promise.resolve(); } + var spoolType = this.recordType; + if (this.recordType == 'authority') spoolType = 'auth' - const method = `open-ils.vandelay.${this.recordType}.process_spool`; + const method = `open-ils.vandelay.${spoolType}.process_spool`; return new Promise((resolve, reject) => { this.net.request( diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue.component.ts index a6f67c34d1..034f39acb5 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue.component.ts @@ -163,11 +163,16 @@ export class QueueComponent implements OnInit, AfterViewInit { error_detail: rec.error_detail(), import_time: rec.import_time(), imported_as: rec.imported_as(), - import_items: rec.import_items(), - error_items: rec.import_items().filter(i => i.import_error()), + import_items: [], + error_items: [], matches: rec.matches() }; + if (this.queueType === 'bib') { + recHash.import_items = rec.import_items(); + recHash.error_items = rec.import_items().filter(i => i.import_error()); + } + // Link the record attribute values to the root record // object so the grid can find them. rec.attributes().forEach(attr => { diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.service.ts b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.service.ts index 7a6d6405e4..45d1de556d 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.service.ts @@ -244,7 +244,7 @@ export class VandelayService { const method = `open-ils.vandelay.${recordType}_queue.create`; let qType = recordType; - if (recordType.match(/acq/)) { + if (recordType.match(/bib_acq/)) { let qType = 'acq'; } -- 2.43.2