[open-ils-commits] [GIT] Evergreen ILS branch rel_3_3 updated. 2d611ec3bfd4fcca70781a50b1b367effb452bb0

Evergreen Git git at git.evergreen-ils.org
Fri Dec 6 10:29:03 EST 2019


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_3_3 has been updated
       via  2d611ec3bfd4fcca70781a50b1b367effb452bb0 (commit)
       via  af4ec1c037b482a60ec902890fc06015a127cc88 (commit)
       via  e52ade3eda336bbe71da95202313528a2ac40b37 (commit)
       via  8ca85d2afe3c3f8688ae80ea37df9003700944bd (commit)
      from  5cb87b57b5253bf1e98a6184eba6581ff6e9f2b7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2d611ec3bfd4fcca70781a50b1b367effb452bb0
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Wed Dec 4 17:41:38 2019 -0500

    LP#1830923: do not show Enhanced MARC editor tab when editing in-place
    
    As the the AngularJS side does not currently offer a path
    for directly editing a queued record, the enhancd editor tab
    serves no purpose in this context.
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.html b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.html
index 659e070027..ce057e192d 100644
--- a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.html
+++ b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.html
@@ -41,7 +41,7 @@
 <div class="row">
   <div class="col-lg-12">
     <ngb-tabset [activeId]="editorTab">
-      <ngb-tab title="Enhanced MARC Editor" i18n-title id="rich">
+      <ngb-tab title="Enhanced MARC Editor" i18n-title id="rich" *ngIf="!inPlaceMode">
         <ng-template ngbTabContent>
           <div class="alert alert-info mt-3" i18n>
           Enhanced MARC Editor is not yet implemented.

commit af4ec1c037b482a60ec902890fc06015a127cc88
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Wed Dec 4 17:34:45 2019 -0500

    LP#1830923: add support for editing queued authority records
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

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 ebb51b4081..b8fcdec714 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
@@ -21,10 +21,15 @@
   <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()"
           [hideFullEditorLink]="true"
           [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()"
+          [hideFullEditorLink]="true"
+          (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 3b5ba4caf9..87ef08045d 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
@@ -53,13 +53,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 => this.toast.success(this.updateSuccess.text),
             error => {

commit e52ade3eda336bbe71da95202313528a2ac40b37
Author: Bill Erickson <berickxx at gmail.com>
Date:   Thu Oct 17 17:59:08 2019 -0400

    LP1830923 Vandelay queued record MARC edit
    
    Allow editing of Vandelay queued bib records (from the queue
    interface) via the Angular MARC editor.
    
    Note only the flat text editor is currently supportd in the
    Angular MARC editor.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

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 d9e85347e0..ebb51b4081 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
@@ -1,4 +1,6 @@
 
+<eg-string #updateSuccess i18n-text text="Record Update Succeeded"></eg-string>
+
 <div class="row mb-3">
   <div class="col-lg-2">
     <button class="btn btn-info label-with-material-icon"
@@ -10,22 +12,32 @@
 </div>
 
 <ngb-tabset #recordTabs [activeId]="recordTab" (tabChange)="onTabChange($event)">
-	<ngb-tab title="Queued Record MARC" i18n-title id="marc">
-		<ng-template ngbTabContent>
+  <ngb-tab title="Queued Record MARC" i18n-title id="marc">
+    <ng-template ngbTabContent>
       <eg-marc-html [recordId]="recordId" [recordType]="'vandelay-'+queueType">
       </eg-marc-html>
-		</ng-template>
-	</ngb-tab>
-	<ngb-tab title="Record Matches" i18n-title id="matches">
-		<ng-template ngbTabContent>
+    </ng-template>
+  </ngb-tab>
+  <ngb-tab title="Edit Record" i18n-title id="edit">
+    <ng-template ngbTabContent>
+      <ng-container *ngIf="queuedRecord">
+        <eg-marc-editor [inPlaceMode]="true" [recordXml]="queuedRecord.marc()" 
+          [hideFullEditorLink]="true"
+          [recordSource]="queuedRecord.bib_source()"
+          (recordSaved)="handleMarcRecordSaved($event)"></eg-marc-editor>   
+      </ng-container>
+    </ng-template>
+  </ngb-tab>
+  <ngb-tab title="Record Matches" i18n-title id="matches">
+    <ng-template ngbTabContent>
       <eg-queued-record-matches [recordId]="recordId" [queueType]="queueType">
       </eg-queued-record-matches>
-		</ng-template>
-	</ngb-tab>
-	<ngb-tab title="Import Items" i18n-title id="items">
-		<ng-template ngbTabContent>
+    </ng-template>
+  </ngb-tab>
+  <ngb-tab title="Import Items" i18n-title id="items">
+    <ng-template ngbTabContent>
       <eg-queued-record-items [recordId]="recordId">
       </eg-queued-record-items>
-		</ng-template>
-	</ngb-tab>
+    </ng-template>
+  </ngb-tab>
 </ngb-tabset>
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 7bbf5a8d8e..3b5ba4caf9 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
@@ -1,6 +1,10 @@
 import {Component, OnInit, ViewChild} from '@angular/core';
 import {Router, ActivatedRoute, ParamMap} from '@angular/router';
 import {NgbTabset, NgbTabChangeEvent} from '@ng-bootstrap/ng-bootstrap';
+import {PcrudService} from '@eg/core/pcrud.service';
+import {IdlObject} from '@eg/core/idl.service';
+import {ToastService} from '@eg/share/toast/toast.service';
+import {StringComponent} from '@eg/share/string/string.component';
 
 @Component({
   templateUrl: 'queued-record.component.html'
@@ -11,16 +15,24 @@ export class QueuedRecordComponent {
     queueType: string;
     recordId: number;
     recordTab: string;
+    queuedRecord: IdlObject;
+
+    @ViewChild('updateSuccess') updateSuccess: StringComponent;
 
     constructor(
         private router: Router,
-        private route: ActivatedRoute) {
+        private route: ActivatedRoute,
+        private toast: ToastService,
+        private pcrud: PcrudService) {
 
         this.route.paramMap.subscribe((params: ParamMap) => {
             this.queueId = +params.get('id');
             this.recordId = +params.get('recordId');
             this.queueType = params.get('qtype');
             this.recordTab = params.get('recordTab');
+            if (this.recordTab === 'edit') {
+                this.loadRecord();
+            }
         });
     }
 
@@ -38,5 +50,23 @@ export class QueuedRecordComponent {
 
         this.router.navigate([url]);
     }
+
+    loadRecord() {
+        this.queuedRecord = null;
+        this.pcrud.retrieve('vqbr', this.recordId)
+        .subscribe(rec => this.queuedRecord = rec);
+    }
+
+    handleMarcRecordSaved(saveEvent: any) {
+        this.queuedRecord.marc(saveEvent.marcXml);
+        this.queuedRecord.bib_source(saveEvent.bibSource);
+        this.pcrud.update(this.queuedRecord).subscribe(
+            response => this.toast.success(this.updateSuccess.text),
+            error => {
+                console.error(error);
+                this.toast.danger(error);
+            }
+        );
+    }
 }
 
diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.module.ts b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.module.ts
index 9bbfd46a26..1b561c022d 100644
--- a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.module.ts
+++ b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.module.ts
@@ -23,6 +23,7 @@ import {MatchSetExpressionComponent} from './match-set-expression.component';
 import {MatchSetQualityComponent} from './match-set-quality.component';
 import {MatchSetNewPointComponent} from './match-set-new-point.component';
 import {RecentImportsComponent} from './recent-imports.component';
+import {MarcEditModule} from '@eg/staff/share/marc-edit/marc-edit.module';
 
 @NgModule({
   declarations: [
@@ -48,6 +49,7 @@ import {RecentImportsComponent} from './recent-imports.component';
   imports: [
     TreeModule,
     StaffCommonModule,
+    MarcEditModule,
     CatalogCommonModule,
     VandelayRoutingModule,
     HttpClientModule,

commit 8ca85d2afe3c3f8688ae80ea37df9003700944bd
Author: Bill Erickson <berickxx at gmail.com>
Date:   Thu Oct 17 17:57:10 2019 -0400

    LP1830923 Marc edit in-place additions
    
    Improve Angular MARC editor for in-place editing.
    
    * Make inPlaceMode a proper @Input.
    * Allow the caller to pass in the bib source
    * The recordSaved event now reports both the MARC XML and the currently
      selected bib source.
    * Option to hide the link to the AngJS Rich Editor
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.html b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.html
index f8eef36976..659e070027 100644
--- a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.html
+++ b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.html
@@ -29,9 +29,9 @@
 
   <ng-container *ngIf="record && record.id">
     <button *ngIf="!record.deleted" class="btn btn-warning" 
-      (click)="deleteRecord()" i18n>Delete Record</button>
+      [disabled]="inPlaceMode" (click)="deleteRecord()" i18n>Delete Record</button>
     <button *ngIf="record.deleted" class="btn btn-info" 
-      (click)="undeleteRecord()" i18n>Undelete Record</button>
+      [disabled]="inPlaceMode" (click)="undeleteRecord()" i18n>Undelete Record</button>
   </ng-container>
 
   <button class="btn btn-success ml-2" (click)="saveRecord()" 
@@ -44,18 +44,21 @@
       <ngb-tab title="Enhanced MARC Editor" i18n-title id="rich">
         <ng-template ngbTabContent>
           <div class="alert alert-info mt-3" i18n>
-          Enhanced MARC Editor is not yet implemented.  See the
-          <ng-container *ngIf="record && record.id">
-            <a target="_blank"
-              href="/eg/staff/cat/catalog/record/{{record.id}}/marc_edit">
-              AngularJS MARC Editor.
-            </a>
-          </ng-container>
-          <ng-container *ngIf="!record || !record.id">
-            <a target="_blank" href="/eg/staff/cat/catalog/new_bib">
-              AngularJS MARC Editor.
-            </a>
-          </ng-container>
+          Enhanced MARC Editor is not yet implemented.
+            <ng-container *ngIf="!hideFullEditorLink">
+              See the
+              <ng-container *ngIf="record && record.id">
+                <a target="_blank"
+                  href="/eg/staff/cat/catalog/record/{{record.id}}/marc_edit">
+                  AngularJS MARC Editor.
+                </a>
+              </ng-container>
+              <ng-container *ngIf="!record || !record.id">
+                <a target="_blank" href="/eg/staff/cat/catalog/new_bib">
+                  AngularJS MARC Editor.
+                </a>
+              </ng-container>
+            </ng-container>
           </div>
         </ng-template>
       </ngb-tab>
diff --git a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.ts b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.ts
index fa9fbe1259..128e168081 100644
--- a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.ts
+++ b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.ts
@@ -12,6 +12,10 @@ import {ComboboxEntry, ComboboxComponent
   } from '@eg/share/combobox/combobox.component';
 import {ConfirmDialogComponent} from '@eg/share/dialog/confirm.component';
 
+interface MarcSavedEvent {
+    marcXml: string;
+    bibSource?: number;
+}
 
 /**
  * MARC Record editor main interface.
@@ -27,6 +31,7 @@ export class MarcEditorComponent implements OnInit {
     record: MarcRecord;
     editorTab: 'rich' | 'flat';
     sources: ComboboxEntry[];
+    @Input() hideFullEditorLink: boolean;
 
     @Input() set recordId(id: number) {
         if (!id) { return; }
@@ -38,15 +43,19 @@ export class MarcEditorComponent implements OnInit {
         if (xml) { this.fromXml(xml); }
     }
 
+    // Tell us which record source to select by default.
+    // Useful for new records and in-place editing from bare XML.
+    @Input() recordSource: number;
+
     // If true, saving records to the database is assumed to
     // happen externally.  IOW, the record editor is just an
     // in-place MARC modification interface.
-    inPlaceMode: boolean;
+    @Input() inPlaceMode: boolean;
 
     // In inPlaceMode, this is emitted in lieu of saving the record
     // in th database.  When inPlaceMode is false, this is emitted after
     // the record is successfully saved.
-    @Output() recordSaved: EventEmitter<string>;
+    @Output() recordSaved: EventEmitter<MarcSavedEvent>;
 
     @ViewChild('sourceSelector') sourceSelector: ComboboxComponent;
     @ViewChild('confirmDelete') confirmDelete: ConfirmDialogComponent;
@@ -65,7 +74,7 @@ export class MarcEditorComponent implements OnInit {
         private toast: ToastService
     ) {
         this.sources = [];
-        this.recordSaved = new EventEmitter<string>();
+        this.recordSaved = new EventEmitter<MarcSavedEvent>();
     }
 
     ngOnInit() {
@@ -79,6 +88,10 @@ export class MarcEditorComponent implements OnInit {
                 this.sources = this.sources.sort((a, b) =>
                     a.label.toLowerCase() < b.label.toLowerCase() ? -1 : 1
                 );
+
+                if (this.recordSource) {
+                    this.sourceSelector.applyEntryId(this.recordSource);
+                }
             }
         );
     }
@@ -86,21 +99,26 @@ export class MarcEditorComponent implements OnInit {
     saveRecord(): Promise<any> {
         const xml = this.record.toXml();
 
+        let sourceName: string = null;
+        let sourceId: number = null;
+
+        if (this.sourceSelector.selected) {
+            sourceName = this.sourceSelector.selected.label;
+            sourceId = this.sourceSelector.selected.id;
+        }
+
         if (this.inPlaceMode) {
             // Let the caller have the modified XML and move on.
-            this.recordSaved.emit(xml);
+            this.recordSaved.emit({marcXml: xml, bibSource: sourceId});
             return Promise.resolve();
         }
 
-        const source = this.sourceSelector.selected ?
-            this.sourceSelector.selected.label : null; // 'label' not a typo
-
         if (this.record.id) { // Editing an existing record
 
             const method = 'open-ils.cat.biblio.record.marc.replace';
 
             return this.net.request('open-ils.cat', method,
-                this.auth.token(), this.record.id, xml, source
+                this.auth.token(), this.record.id, xml, sourceName
             ).toPromise().then(response => {
 
                 const evt = this.evt.parse(response);
@@ -111,7 +129,7 @@ export class MarcEditorComponent implements OnInit {
                 }
 
                 this.successMsg.current().then(msg => this.toast.success(msg));
-                this.recordSaved.emit(xml);
+                this.recordSaved.emit({marcXml: xml, bibSource: sourceId});
                 return response;
             });
 
@@ -159,7 +177,8 @@ export class MarcEditorComponent implements OnInit {
                     }
                 }
                 return this.fromId(this.record.id)
-                .then(_ => this.recordSaved.emit(this.record.toXml()));
+                .then(_ => this.recordSaved.emit(
+                    {marcXml: this.record.toXml()}));
             });
         });
     }
@@ -180,7 +199,8 @@ export class MarcEditorComponent implements OnInit {
                 if (evt) { console.error(evt); return alert(evt); }
 
                 return this.fromId(this.record.id)
-                .then(_ => this.recordSaved.emit(this.record.toXml()));
+                .then(_ => this.recordSaved.emit(
+                    {marcXml: this.record.toXml()}));
             });
         });
     }

-----------------------------------------------------------------------

Summary of changes:
 .../cat/vandelay/queued-record.component.html      | 41 ++++++++++++++-------
 .../staff/cat/vandelay/queued-record.component.ts  | 34 +++++++++++++++++-
 .../src/app/staff/cat/vandelay/vandelay.module.ts  |  2 ++
 .../staff/share/marc-edit/editor.component.html    | 33 +++++++++--------
 .../app/staff/share/marc-edit/editor.component.ts  | 42 ++++++++++++++++------
 5 files changed, 113 insertions(+), 39 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list