From 433564aafaa99e11d571a06b9f45abd8b7d17f58 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 3 May 2021 14:31:43 -0400 Subject: [PATCH] LP1904036 Route dialog repairs Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- .../eg2/src/app/staff/share/circ/circ.service.ts | 22 +++++++++++++++++++++- .../staff/share/circ/route-dialog.component.html | 6 +++--- .../app/staff/share/circ/route-dialog.component.ts | 2 +- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts b/Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts index 53192ba6b5..cf8736c282 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts @@ -713,10 +713,30 @@ export class CircService { const copy = result.copy; const volume = result.volume; const circ = result.circ; - const parent_circ = result.parent_circ; + const hold = result.hold; + const nonCatCirc = (result as CheckoutResult).nonCatCirc; let promise = Promise.resolve(); + if (!result.patron) { + let patronId; + if (hold) { + patronId = hold.usr(); + } else if (circ) { + patronId = circ.usr(); + } else if (nonCatCirc) { + patronId = nonCatCirc.patron(); + } + + if (patronId) { + promise = promise.then(_ => { + return this.pcrud.retrieve('au', patronId) + .toPromise().then(p => result.patron = p); + }); + } + } + + if (result.record) { result.title = result.record.title(); result.author = result.record.author(); diff --git a/Open-ILS/src/eg2/src/app/staff/share/circ/route-dialog.component.html b/Open-ILS/src/eg2/src/app/staff/share/circ/route-dialog.component.html index ec18c50958..579e2f7d15 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/circ/route-dialog.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/circ/route-dialog.component.html @@ -18,9 +18,9 @@ || checkin.patron.pref_first_given_name() || checkin.patron.pref_second_given_name()"> Preferred name: - {{checkin.patron.pref_family_name || checkin.patron.family_name}}, - {{checkin.patron.pref_first_given_name || checkin.patron.first_given_name}} - {{checkin.patron.pref_second_given_name}} + {{checkin.patron.pref_family_name() || checkin.patron.family_name()}}, + {{checkin.patron.pref_first_given_name() || checkin.patron.first_given_name()}} + {{checkin.patron.pref_second_given_name()}}
diff --git a/Open-ILS/src/eg2/src/app/staff/share/circ/route-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/share/circ/route-dialog.component.ts index 3cafd9df9b..52eb795a64 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/circ/route-dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/circ/route-dialog.component.ts @@ -1,6 +1,6 @@ import {Component, OnInit, Output, Input, ViewChild, EventEmitter} from '@angular/core'; import {empty, of, from, Observable} from 'rxjs'; -import {concatMap} from 'rxjs/operators'; +import {tap, concatMap} from 'rxjs/operators'; import {IdlService, IdlObject} from '@eg/core/idl.service'; import {PcrudService} from '@eg/core/pcrud.service'; import {OrgService} from '@eg/core/org.service'; -- 2.11.0