LP1889694 catalog record summary condensed WIP user/berick/lpxxx-staffcat-copy-counts
authorBill Erickson <berickxx@gmail.com>
Fri, 31 Jul 2020 17:23:32 +0000 (13:23 -0400)
committerBill Erickson <berickxx@gmail.com>
Fri, 31 Jul 2020 17:23:32 +0000 (13:23 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts

index 4fe389e..805a0bb 100644 (file)
@@ -142,6 +142,7 @@ export class CatalogService {
             }, fullQuery, true
         ).toPromise()
         .then(result => this.applyResultData(ctx, result))
+        .then(_ => this.fetchFieldHighlights(ctx))
         .then(_ => {
             ctx.searchState = CatalogSearchState.COMPLETE;
             this.onSearchComplete.emit(ctx);
@@ -238,13 +239,9 @@ export class CatalogService {
             // them to bib IDs for highlighting.
             ids = ctx.currentResultIds();
             if (ctx.termSearch.groupByMetarecord) {
-                // TODO: at this point in loading we don't yet
-                // have result records to comb through
-                /*
-                ids = ids.map(mrId =>
-                    ctx.result.records.filter(r => mrId === r.metabibId)[0].id
-                );
-                */
+                // The 4th slot in the result ID reports the master record
+                // for the metarecord in question.  Sometimes it's null?
+                ids = ctx.result.ids.map(id => id[4]).filter(id => id !== null);
             }
         }