[open-ils-commits] [GIT] Evergreen ILS branch rel_3_3 updated. 7ed4b2540cdfbbc4a0bc820631e9c080e500b575

Evergreen Git git at git.evergreen-ils.org
Fri Jul 19 13:09:52 EDT 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  7ed4b2540cdfbbc4a0bc820631e9c080e500b575 (commit)
      from  6e8a9b1224a48a3c5dd98584a378049eecf22179 (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 7ed4b2540cdfbbc4a0bc820631e9c080e500b575
Author: Jane Sandberg <sandbej at linnbenton.edu>
Date:   Thu Jul 18 08:22:35 2019 -0700

    LP1837067: Fixing unsubscribed Observable in Replace Barcodes dialog
    
    To test:
    1) In the experimental Angular staff catalog, open up a bib record.
    2) Open the Holdings View tab.
    3) Select several items.
    4) Use the Actions for Selected Rows menu to Replace Barcodes
    5) Change the first barcode to something recognizable. Click the
    Replace Barcode button.
    6) Note that the dialog opens again to ask you to replace the
    barcode you just added.
    7) Apply this patch.
    8) Repeat steps 1-5.
    9) Note that the dialog opens again to ask you to replace the next
    barcode.
    
    Also removes some unused imports, and consolidates two RxJS pipes that
    were next to one another.
    
    Bill's Additions:
    
    Removes an unnecessary throwError which was called every time the dialog
    completed.
    
    NOTE: the source of the bug was that the Observable returned by
    pcrud.search(...) was never subscribed-to, so it never fired.  Calling
    .toPromise() forces the observable to execute.
    
    Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
    Signed-off-by: Bill Erickson <berickxx at gmail.com>

diff --git a/Open-ILS/src/eg2/src/app/staff/share/holdings/replace-barcode-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/share/holdings/replace-barcode-dialog.component.ts
index 2b85d38931..e50f5c19e0 100644
--- a/Open-ILS/src/eg2/src/app/staff/share/holdings/replace-barcode-dialog.component.ts
+++ b/Open-ILS/src/eg2/src/app/staff/share/holdings/replace-barcode-dialog.component.ts
@@ -1,12 +1,9 @@
 import {Component, OnInit, Input, ViewChild, Renderer2} from '@angular/core';
-import {Observable, throwError} from 'rxjs';
+import {Observable} from 'rxjs';
 import {switchMap, map, tap} from 'rxjs/operators';
 import {IdlObject} from '@eg/core/idl.service';
-import {NetService} from '@eg/core/net.service';
-import {EventService} from '@eg/core/event.service';
 import {PcrudService} from '@eg/core/pcrud.service';
 import {ToastService} from '@eg/share/toast/toast.service';
-import {AuthService} from '@eg/core/auth.service';
 import {NgbModal, NgbModalOptions} from '@ng-bootstrap/ng-bootstrap';
 import {DialogComponent} from '@eg/share/dialog/dialog.component';
 import {StringComponent} from '@eg/share/string/string.component';
@@ -43,11 +40,8 @@ export class ReplaceBarcodeDialogComponent
     constructor(
         private modal: NgbModal, // required for passing to parent
         private toast: ToastService,
-        private net: NetService,
         private pcrud: PcrudService,
-        private evt: EventService,
-        private renderer: Renderer2,
-        private auth: AuthService) {
+        private renderer: Renderer2) {
         super(modal); // required for subclassing
     }
 
@@ -59,9 +53,9 @@ export class ReplaceBarcodeDialogComponent
         this.numFailed = 0;
 
         return this.getNextCopy()
-        .pipe(switchMap(() => super.open(args)))
-        .pipe(tap(() =>
-            this.renderer.selectRootElement('#new-barcode-input').focus())
+        .pipe(switchMap(() => super.open(args)),
+            tap(() =>
+                this.renderer.selectRootElement('#new-barcode-input').focus())
         );
     }
 
@@ -69,7 +63,6 @@ export class ReplaceBarcodeDialogComponent
 
         if (this.ids.length === 0) {
             this.close(this.numSucceeded > 0);
-            return throwError(false);
         }
 
         this.newBarcode = '';
@@ -96,7 +89,7 @@ export class ReplaceBarcodeDialogComponent
                 async (ok) => {
                     this.numSucceeded++;
                     this.toast.success(await this.successMsg.current());
-                    this.getNextCopy();
+                    return this.getNextCopy().toPromise();
                 },
                 async (err) => {
                     this.numFailed++;

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

Summary of changes:
 .../holdings/replace-barcode-dialog.component.ts      | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list