LP1904036 Route dialog repairs
authorBill Erickson <berickxx@gmail.com>
Mon, 3 May 2021 18:31:43 +0000 (14:31 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:34 +0000 (20:13 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts
Open-ILS/src/eg2/src/app/staff/share/circ/route-dialog.component.html
Open-ILS/src/eg2/src/app/staff/share/circ/route-dialog.component.ts

index 53192ba..cf8736c 100644 (file)
@@ -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();
index ec18c50..579e2f7 100644 (file)
@@ -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()}}
     </div>
   </div>
   <div>
index 3cafd9d..52eb795 100644 (file)
@@ -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';