From 35d6db8745a350691f8c41d0d124eea994e49c5c Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 11 May 2021 11:31:33 -0400 Subject: [PATCH] LP1904036 Print service emits when queued Signed-off-by: Bill Erickson --- Open-ILS/src/eg2/src/app/share/print/print.component.ts | 5 ++++- Open-ILS/src/eg2/src/app/share/print/print.service.ts | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/eg2/src/app/share/print/print.component.ts b/Open-ILS/src/eg2/src/app/share/print/print.component.ts index bf0fb3a6d7..e8b0b96481 100644 --- a/Open-ILS/src/eg2/src/app/share/print/print.component.ts +++ b/Open-ILS/src/eg2/src/app/share/print/print.component.ts @@ -98,7 +98,10 @@ export class PrintComponent implements OnInit { this.applyTemplate(printReq).then(() => { // Give templates a chance to render before printing setTimeout(() => { - this.dispatchPrint(printReq).then(__ => this.reset()); + this.dispatchPrint(printReq).then(__ => { + this.reset(); + this.printer.printJobQueued$.emit(printReq); + }); }); }); }); diff --git a/Open-ILS/src/eg2/src/app/share/print/print.service.ts b/Open-ILS/src/eg2/src/app/share/print/print.service.ts index 25ef20606e..ccd539f6e8 100644 --- a/Open-ILS/src/eg2/src/app/share/print/print.service.ts +++ b/Open-ILS/src/eg2/src/app/share/print/print.service.ts @@ -31,12 +31,18 @@ export class PrintService { onPrintRequest$: EventEmitter; + // Emitted after a print request has been delivered to Hatch or + // window.print() has completed. Note window.print() returning + // is not necessarily an indication the job has completed. + printJobQueued$: EventEmitter; + constructor( private locale: LocaleService, private auth: AuthService, private store: StoreService ) { this.onPrintRequest$ = new EventEmitter(); + this.printJobQueued$ = new EventEmitter(); } print(printReq: PrintRequest) { -- 2.11.0