[open-ils-commits] [GIT] Evergreen ILS branch rel_3_4 updated. 93976c74fa188d73606173ba510c384c994c425b

Evergreen Git git at git.evergreen-ils.org
Fri Dec 6 10:20:08 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_4 has been updated
       via  93976c74fa188d73606173ba510c384c994c425b (commit)
       via  bef2ededd4c0e57fe1325a13d2de9dacc2149854 (commit)
       via  00ca24c8920b077f62ef36d0581c78ac1f49094c (commit)
       via  3db73a2ab3ca0d90c436f1e3b263ff2b7c51ef04 (commit)
       via  e458e609445e18f9558b181ef0469839c8a33f93 (commit)
       via  d9f9938456af1e0065112c154ae30d177012e533 (commit)
      from  56842b5af1ca749088b31b403b58e39f1e46a2f4 (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 93976c74fa188d73606173ba510c384c994c425b
Author: Bill Erickson <berickxx at gmail.com>
Date:   Thu Dec 5 10:08:48 2019 -0500

    LP1830923 Replace some pesky tabs
    
    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 35b983175a..ed643d90a0 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
@@ -10,14 +10,14 @@
 </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="Edit Record" i18n-title id="edit">
-		<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()"
           [recordSource]="queuedRecord.bib_source()"
@@ -27,18 +27,18 @@
           (recordSaved)="handleMarcRecordSaved($event)"
           *ngIf="queueType !== 'bib'"></eg-marc-editor>
       </ng-container>
-		</ng-template>
-	</ngb-tab>
-	<ngb-tab title="Record Matches" i18n-title id="matches">
-		<ng-template ngbTabContent>
+    </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>

commit bef2ededd4c0e57fe1325a13d2de9dacc2149854
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 0489ddd38d..55c5af69ea 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.  See the

commit 00ca24c8920b077f62ef36d0581c78ac1f49094c
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 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);

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

    LP1830923 Vandelay queued record editing
    
    This patch adds MARC record editing the the Angular
    Vandelay interface using the Angular MARC editor
    component, which as of the date of this patch offers
    a flat-text mode.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
    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..ceb70a1704 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
@@ -16,6 +16,15 @@
       </eg-marc-html>
 		</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()" 
+          [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">
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..f0705a719d 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,8 @@
 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';
 
 @Component({
   templateUrl: 'queued-record.component.html'
@@ -11,16 +13,21 @@ export class QueuedRecordComponent {
     queueType: string;
     recordId: number;
     recordTab: string;
+    queuedRecord: IdlObject;
 
     constructor(
         private router: Router,
-        private route: ActivatedRoute) {
+        private route: ActivatedRoute,
+        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 +45,21 @@ 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 => {
+                console.log('response = ', response);
+            }
+        );
+    }
 }
 
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 0f394285e3..5b01400a33 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
@@ -25,6 +25,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: [
@@ -52,6 +53,7 @@ import {RecentImportsComponent} from './recent-imports.component';
     StaffCommonModule,
     FmRecordEditorModule,
     AdminPageModule,
+    MarcEditModule,
     CatalogCommonModule,
     VandelayRoutingModule,
     HttpClientModule,

commit e458e609445e18f9558b181ef0469839c8a33f93
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.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
    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..0489ddd38d 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()" 
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..8c3935753e 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.
@@ -38,15 +42,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 +73,7 @@ export class MarcEditorComponent implements OnInit {
         private toast: ToastService
     ) {
         this.sources = [];
-        this.recordSaved = new EventEmitter<string>();
+        this.recordSaved = new EventEmitter<MarcSavedEvent>();
     }
 
     ngOnInit() {
@@ -79,6 +87,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 +98,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 +128,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 +176,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 +198,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()}));
             });
         });
     }

commit d9f9938456af1e0065112c154ae30d177012e533
Author: Bill Erickson <berickxx at gmail.com>
Date:   Thu Oct 17 17:44:40 2019 -0400

    LP1830923 Combobox LP1844812 regression fix
    
    Allow a combobox to start with an empty array that is later filled by
    the caller.  This was broken due to changes which prevented the combobox
    from seeing an empty/stub array as being different from its
    initialization array, thus ignoring empty array as a duplicate.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts b/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts
index cd33e65187..34d428358f 100644
--- a/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts
+++ b/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts
@@ -214,7 +214,7 @@ export class ComboboxComponent implements ControlValueAccessor, OnInit {
     }
 
     // Returns true if the 2 entries are equivalent.
-    entriesMatches(e1: ComboboxEntry, e2: ComboboxEntry): boolean {
+    entriesMatch(e1: ComboboxEntry, e2: ComboboxEntry): boolean {
         return (
             e1 && e2 &&
             e1.id === e2.id &&
@@ -225,12 +225,18 @@ export class ComboboxComponent implements ControlValueAccessor, OnInit {
 
     // Returns true if the 2 lists are equivalent.
     entrylistMatches(el: ComboboxEntry[]): boolean {
+        if (el.length === 0 && this.entrylist.length === 0) {
+            // Empty arrays are only equivalent if they are the same array,
+            // since the caller may provide an array that starts empty, but
+            // is later populated.
+            return el === this.entrylist;
+        }
         if (el.length !== this.entrylist.length) {
             return false;
         }
         for (let i = 0; i < el.length; i++) {
             const mine = this.entrylist[i];
-            if (!mine || !this.entriesMatches(mine, el[i])) {
+            if (!mine || !this.entriesMatch(mine, el[i])) {
                 return false;
             }
         }

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

Summary of changes:
 .../src/app/share/combobox/combobox.component.ts   | 10 ++++--
 .../cat/vandelay/queued-record.component.html      | 37 ++++++++++++-------
 .../staff/cat/vandelay/queued-record.component.ts  | 27 +++++++++++++-
 .../src/app/staff/cat/vandelay/vandelay.module.ts  |  2 ++
 .../staff/share/marc-edit/editor.component.html    |  6 ++--
 .../app/staff/share/marc-edit/editor.component.ts  | 41 ++++++++++++++++------
 6 files changed, 94 insertions(+), 29 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list