lp1779158 Vandelay Authority Import Tweaks
authorKyle Huckins <khuckins@catalyte.io>
Tue, 27 Nov 2018 21:07:35 +0000 (21:07 +0000)
committerDan Wells <dbw2@calvin.edu>
Tue, 19 Feb 2019 22:56:28 +0000 (17:56 -0500)
- 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 <khuckins@catalyte.io>
 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 <berickxx@gmail.com>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.ts
Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue.component.ts
Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.service.ts

index 74341b9..cd51da6 100644 (file)
@@ -371,7 +371,7 @@ export class ImportComponent implements OnInit, AfterViewInit, OnDestroy {
     // Extract selected queue ID or create a new queue when requested.
     resolveQueue(): Promise<number> {
 
-        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(
index a6f67c3..034f39a 100644 (file)
@@ -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 => {
index 7a6d640..45d1de5 100644 (file)
@@ -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';
         }