From 91c438ce94183d72eb758b6d9307b9dda5979120 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 19 Jun 2019 16:25:51 -0400 Subject: [PATCH] LP1823041 Observable dialogs repairs and cleanup Fixes a few instances where dialog.open() calls did not return Observables. Replace a number of calls to the now deprecated dialog.dismiss() with calls to dialog.close(). Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg --- .../booking/make-bookable-dialog.component.html | 4 +- .../holdings/conjoined-items-dialog.component.html | 6 ++-- .../holdings/copy-alerts-dialog.component.html | 4 +- .../share/holdings/copy-alerts-dialog.component.ts | 21 ++++++++++--------- .../holdings/delete-volcopy-dialog.component.html | 6 ++-- .../holdings/mark-damaged-dialog.component.html | 6 ++-- .../holdings/mark-damaged-dialog.component.ts | 13 ++++++++--- .../holdings/mark-missing-dialog.component.html | 6 ++-- .../holdings/replace-barcode-dialog.component.html | 6 ++-- .../holdings/replace-barcode-dialog.component.ts | 10 ++++---- .../staff/share/holds/cancel-dialog.component.html | 6 ++-- .../staff/share/holds/manage-dialog.component.html | 4 +- .../share/holds/retarget-dialog.component.html | 6 ++-- .../share/holds/transfer-dialog.component.html | 6 ++-- .../staff/share/holds/transfer-dialog.component.ts | 5 ++- 15 files changed, 58 insertions(+), 51 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/share/booking/make-bookable-dialog.component.html b/Open-ILS/src/eg2/src/app/staff/share/booking/make-bookable-dialog.component.html index 25ad596..aa77935 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/booking/make-bookable-dialog.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/booking/make-bookable-dialog.component.html @@ -11,7 +11,7 @@ Make Items Bookable @@ -36,7 +36,7 @@ @@ -31,7 +31,7 @@ - \ No newline at end of file + diff --git a/Open-ILS/src/eg2/src/app/staff/share/holdings/copy-alerts-dialog.component.html b/Open-ILS/src/eg2/src/app/staff/share/holdings/copy-alerts-dialog.component.html index 4b3c1ca..039d776 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/holdings/copy-alerts-dialog.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/holdings/copy-alerts-dialog.component.html @@ -13,7 +13,7 @@ @@ -100,7 +100,7 @@ @@ -22,7 +22,7 @@ - \ No newline at end of file + diff --git a/Open-ILS/src/eg2/src/app/staff/share/holdings/mark-damaged-dialog.component.html b/Open-ILS/src/eg2/src/app/staff/share/holdings/mark-damaged-dialog.component.html index ddcf6b1..0c53c9c 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/holdings/mark-damaged-dialog.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/holdings/mark-damaged-dialog.component.html @@ -7,7 +7,7 @@ Mark Item Damaged @@ -90,13 +90,13 @@ @@ -35,10 +35,10 @@ - \ No newline at end of file + diff --git a/Open-ILS/src/eg2/src/app/staff/share/holdings/replace-barcode-dialog.component.html b/Open-ILS/src/eg2/src/app/staff/share/holdings/replace-barcode-dialog.component.html index 562681b..8bca301 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/holdings/replace-barcode-dialog.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/holdings/replace-barcode-dialog.component.html @@ -11,7 +11,7 @@ Replace Item Barcode @@ -39,7 +39,7 @@ - \ No newline at end of file + 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 2d18eb9..2b85d38 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,6 +1,6 @@ import {Component, OnInit, Input, ViewChild, Renderer2} from '@angular/core'; import {Observable, throwError} from 'rxjs'; -import {flatMap, map, tap} from 'rxjs/operators'; +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'; @@ -59,10 +59,10 @@ export class ReplaceBarcodeDialogComponent this.numFailed = 0; return this.getNextCopy() - .pipe(flatMap(() => { - return super.open(args) - .pipe(tap(() => {this.renderer.selectRootElement('#new-barcode-input').focus(); })); - })); + .pipe(switchMap(() => super.open(args))) + .pipe(tap(() => + this.renderer.selectRootElement('#new-barcode-input').focus()) + ); } getNextCopy(): Observable { diff --git a/Open-ILS/src/eg2/src/app/staff/share/holds/cancel-dialog.component.html b/Open-ILS/src/eg2/src/app/staff/share/holds/cancel-dialog.component.html index d7417fa..a2d70cd 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/holds/cancel-dialog.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/holds/cancel-dialog.component.html @@ -9,7 +9,7 @@ Cancel Hold @@ -52,9 +52,9 @@ - \ No newline at end of file + diff --git a/Open-ILS/src/eg2/src/app/staff/share/holds/manage-dialog.component.html b/Open-ILS/src/eg2/src/app/staff/share/holds/manage-dialog.component.html index ac07dd6..1a8cbc3 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/holds/manage-dialog.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/holds/manage-dialog.component.html @@ -7,7 +7,7 @@ @@ -15,4 +15,4 @@ - \ No newline at end of file + diff --git a/Open-ILS/src/eg2/src/app/staff/share/holds/retarget-dialog.component.html b/Open-ILS/src/eg2/src/app/staff/share/holds/retarget-dialog.component.html index 37d349d..b24a63e 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/holds/retarget-dialog.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/holds/retarget-dialog.component.html @@ -9,7 +9,7 @@ Retarget Hold @@ -33,9 +33,9 @@ - \ No newline at end of file + diff --git a/Open-ILS/src/eg2/src/app/staff/share/holds/transfer-dialog.component.html b/Open-ILS/src/eg2/src/app/staff/share/holds/transfer-dialog.component.html index 80728ca..9046836 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/holds/transfer-dialog.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/holds/transfer-dialog.component.html @@ -11,7 +11,7 @@ Transfer Hold(s) To Marked Target @@ -35,9 +35,9 @@ - \ No newline at end of file + diff --git a/Open-ILS/src/eg2/src/app/staff/share/holds/transfer-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/share/holds/transfer-dialog.component.ts index 58b8200..796aa10 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/holds/transfer-dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/holds/transfer-dialog.component.ts @@ -53,8 +53,9 @@ export class HoldTransferDialogComponent if (!this.transferTarget) { this.targetNeeded.current() - .then((msg) => this.toast.warning(msg)) - .then(() => throwError('Transfer Target Required')); + .then((msg) => this.toast.warning(msg)); + + return throwError('Transfer Target Required'); } return super.open(args); -- 1.7.2.5