From d5c058d99a2ee04b276120f7b47e6f82fa301125 Mon Sep 17 00:00:00 2001
From: Galen Charlton <gmc@equinoxinitiative.org>
Date: Wed, 4 Dec 2019 17:34:45 -0500
Subject: [PATCH] LP#1830923: add support for editing queued authority records

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
---
 .../eg2/src/app/staff/cat/vandelay/queued-record.component.html   | 8 ++++++--
 .../src/eg2/src/app/staff/cat/vandelay/queued-record.component.ts | 6 ++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queued-record.component.html b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queued-record.component.html
index ceb70a1704..35b983175a 100644
--- a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queued-record.component.html
+++ b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queued-record.component.html
@@ -19,9 +19,13 @@
 	<ngb-tab title="Edit Record" i18n-title id="edit">
 		<ng-template ngbTabContent>
       <ng-container *ngIf="queuedRecord">
-        <eg-marc-editor [inPlaceMode]="true" [recordXml]="queuedRecord.marc()" 
+        <eg-marc-editor [inPlaceMode]="true" [recordXml]="queuedRecord.marc()"
           [recordSource]="queuedRecord.bib_source()"
-          (recordSaved)="handleMarcRecordSaved($event)"></eg-marc-editor>   
+          (recordSaved)="handleMarcRecordSaved($event)"
+          *ngIf="queueType === 'bib'"></eg-marc-editor>
+        <eg-marc-editor [inPlaceMode]="true" [recordXml]="queuedRecord.marc()"
+          (recordSaved)="handleMarcRecordSaved($event)"
+          *ngIf="queueType !== 'bib'"></eg-marc-editor>
       </ng-container>
 		</ng-template>
 	</ngb-tab>
diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queued-record.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queued-record.component.ts
index f0705a719d..84e705345a 100644
--- a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queued-record.component.ts
+++ b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queued-record.component.ts
@@ -48,13 +48,15 @@ export class QueuedRecordComponent {
 
     loadRecord() {
         this.queuedRecord = null;
-        this.pcrud.retrieve('vqbr', this.recordId)
+        this.pcrud.retrieve((this.queueType === 'bib' ? 'vqbr' : 'vqar'), this.recordId)
         .subscribe(rec => this.queuedRecord = rec);
     }
 
     handleMarcRecordSaved(saveEvent: any) {
         this.queuedRecord.marc(saveEvent.marcXml);
-        this.queuedRecord.bib_source(saveEvent.bibSource);
+        if (this.queueType === 'bib') {
+            this.queuedRecord.bib_source(saveEvent.bibSource);
+        }
         this.pcrud.update(this.queuedRecord).subscribe(
             response => {
                 console.log('response = ', response);
-- 
2.11.0