LP#1626157 global search holdings fix
authorBill Erickson <berickxx@gmail.com>
Fri, 16 Mar 2018 18:00:04 +0000 (18:00 +0000)
committerBill Erickson <berickxx@gmail.com>
Fri, 16 Mar 2018 18:00:04 +0000 (18:00 +0000)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/core/store.ts
Open-ILS/src/eg2/src/app/staff/catalog/record/copies.component.ts
Open-ILS/src/eg2/src/app/staff/resolver.service.ts

index 2b3522b..218ad83 100644 (file)
@@ -10,7 +10,9 @@ export class EgStoreService {
     
     // Base path for cookie-based storage.
     // Useful for limiting cookies to subsections of the application.
-    loginSessionBasePath: string;
+    // Store cookies globally by default.
+    // Note cookies shared with /eg/staff must be stored at "/"
+    loginSessionBasePath: string = '/';
 
     // Set of keys whose values should disappear at logout.
     loginSessionKeys: string[] = [
index a8e9417..b8e05f0 100644 (file)
@@ -46,12 +46,19 @@ export class CopiesComponent implements OnInit {
 
     fetchCopies(): void {
         this.copies = [];
+
+        // "Show Result from All Libraries" i.e. global search displays
+        // copies from all branches, sorted by search/pref libs.
+        let copy_depth = this.staffCat.searchContext.global ?
+            this.org.root().ou_type().depth() :
+            this.staffCat.searchContext.searchOrg.ou_type().depth(); 
+
         this.net.request(
             'open-ils.search',
             'open-ils.search.bib.copies.staff',
             this.recId,
             this.staffCat.searchContext.searchOrg.id(),
-            this.staffCat.searchContext.searchOrg.ou_type().depth(), // TODO
+            copy_depth,
             this.pager.limit,
             this.pager.offset,
             this.staffCat.prefOrg ? this.staffCat.prefOrg.id() : null 
index d37ca2f..63a86f9 100644 (file)
@@ -38,7 +38,7 @@ export class EgStaffResolver implements Resolve<Observable<any>> {
         // NOTE: storing session data at '/' so it can be shared by
         // Angularjs apps.
         this.store.loginSessionBasePath = '/';
-            //this.ngLocation.prepareExternalUrl('/staff');
+        // ^-- = this.ngLocation.prepareExternalUrl('/staff');
 
         // Not sure how to get the path without params... using this for now.
         let path = state.url.split('?')[0]