LP#1806087 Browse/search form work continued
authorBill Erickson <berickxx@gmail.com>
Tue, 11 Dec 2018 14:09:05 +0000 (09:09 -0500)
committerBill Erickson <berickxx@gmail.com>
Mon, 7 Jan 2019 14:58:44 +0000 (09:58 -0500)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/share/catalog/catalog-url.service.ts
Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts
Open-ILS/src/eg2/src/app/share/catalog/search-context.ts

index ff1d773..60c3128 100644 (file)
@@ -3,7 +3,7 @@ import {ParamMap} from '@angular/router';
 import {OrgService} from '@eg/core/org.service';
 import {CatalogSearchContext, CatalogBrowseContext, CatalogMarcContext, 
    CatalogTermContext, FacetFilter} from './search-context';
-import {CATALOG_CCVM_FILTERS} from './catalog.service';
+import {CATALOG_CCVM_FILTERS} from './search-context';
 
 @Injectable()
 export class CatalogUrlService {
index 22a6744..93eb964 100644 (file)
@@ -11,21 +11,7 @@ import {PcrudService} from '@eg/core/pcrud.service';
 import {CatalogSearchContext, CatalogSearchState} from './search-context';
 import {BibRecordService, BibRecordSummary} from './bib-record.service';
 import {BasketService} from './basket.service';
-
-// CCVM's we care about in a catalog context
-// Don't fetch them all because there are a lot.
-export const CATALOG_CCVM_FILTERS = [
-    'item_type',
-    'item_form',
-    'item_lang',
-    'audience',
-    'audience_group',
-    'vr_format',
-    'bib_level',
-    'lit_form',
-    'search_format',
-    'icon_format'
-];
+import {CATALOG_CCVM_FILTERS} from './search-context';
 
 @Injectable()
 export class CatalogService {
index 64698a4..9e4bf91 100644 (file)
@@ -3,6 +3,21 @@ import {IdlObject} from '@eg/core/idl.service';
 import {Pager} from '@eg/share/util/pager';
 import {Params} from '@angular/router';
 
+// CCVM's we care about in a catalog context
+// Don't fetch them all because there are a lot.
+export const CATALOG_CCVM_FILTERS = [
+    'item_type',
+    'item_form',
+    'item_lang',
+    'audience',
+    'audience_group',
+    'vr_format',
+    'bib_level',
+    'lit_form',
+    'search_format',
+    'icon_format'
+];
+
 export enum CatalogSearchState {
     PENDING,
     SEARCHING,
@@ -118,7 +133,6 @@ export class CatalogTermContext {
         this.fieldClass  = ['keyword'];
         this.matchOp = ['contains'];
         this.joinOp = [''];
-        this.ccvmFilters = {};
         this.facetFilters = [];
         this.copyLocations = [''];
         this.format = '';
@@ -126,6 +140,10 @@ export class CatalogTermContext {
         this.date1 = null;
         this.date2 = null;
         this.dateOp = 'is';
+
+        // Apply empty string values for each ccvm filter
+        this.ccvmFilters = {};
+        CATALOG_CCVM_FILTERS.forEach(code => this.ccvmFilters[code] = ['']);
     }
 
     isSearchable(): boolean {