LP1908444 Support browse search record result sorting user/berick/lp1908444-ang-browse-sorting
authorBill Erickson <berickxx@gmail.com>
Wed, 16 Dec 2020 21:16:47 +0000 (13:16 -0800)
committerBill Erickson <berickxx@gmail.com>
Wed, 16 Dec 2020 21:16:50 +0000 (13:16 -0800)
Allow users to sort the set of bib records which link to a browse
heading via the existing sort options.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/share/catalog/search-context.ts

index d94e5e2..e089864 100644 (file)
@@ -682,10 +682,17 @@ export class CatalogSearchContext {
                 this.browseSearch.reset();
                 this.identSearch.reset();
                 this.cnBrowseSearch.reset();
-                this.termSearch.hasBrowseEntry = '';
                 this.termSearch.browseEntry = null;
                 this.termSearch.fromMetarecord = null;
                 this.termSearch.facetFilters = [];
+
+                if (this.termSearch.query[0] !== '') {
+                    // If the user has entered a query, it takes precedence
+                    // over the source browse entry or source metarecord.
+                    this.termSearch.hasBrowseEntry = null;
+                    this.termSearch.fromMetarecord = null;
+                }
+
                 break;
 
             case 'ident':