// Display the Exclude Electronic checkbox
showExcludeElectronic = false;
+ // Advanced search filters to display
+ searchFilters: string[];
+
+ // TODO: does unapi support pref-lib for result-page copy counts?
prefOrg: IdlObject;
// Default search tab
import {CatalogService} from '@eg/share/catalog/catalog.service';
import {StaffCatalogService} from './catalog.service';
import {BasketService} from '@eg/share/catalog/basket.service';
+import {CATALOG_CCVM_FILTERS} from '@eg/share/catalog/search-context';
@Injectable()
'eg.staff.catalog.results.show_more',
'circ.staff_placed_holds_fallback_to_ws_ou',
'opac.staff.jump_to_details_on_single_hit',
+ 'eg.staffcat.search_filters'
]).then(settings => {
this.staffCat.defaultSearchOrg =
this.org.get(settings['eg.search.search_lib']);
settings['eg.staffcat.exclude_electronic'] === true;
this.staffCat.jumpOnSingleHit =
settings['opac.staff.jump_to_details_on_single_hit'] === true;
+ this.staffCat.searchFilters =
+ settings['eg.staffcat.search_filters'] || CATALOG_CCVM_FILTERS;
});
}
}
</div>
</div>
<div class="row mt-3" *ngIf="showFilters()">
- <div class="col-lg-3">
+ <div class="col-lg-3" *ngIf="searchFilters().includes('item_type')">
<select class="form-control" multiple="true"
[(ngModel)]="context.termSearch.ccvmFilters.item_type">
<option value='' i18n>All Item Types</option>
</ng-container>
</select>
</div>
- <div class="col-lg-3">
+ <div class="col-lg-3" *ngIf="searchFilters().includes('item_form')">
<select class="form-control" multiple="true"
[(ngModel)]="context.termSearch.ccvmFilters.item_form">
<option value='' i18n>All Item Forms</option>
</ng-container>
</select>
</div>
- <div class="col-lg-3">
+ <div class="col-lg-3" *ngIf="searchFilters().includes('item_lang')">
<select class="form-control"
[(ngModel)]="context.termSearch.ccvmFilters.item_lang" multiple="true">
<option value='' i18n>All Languages</option>
</ng-container>
</select>
</div>
- <div class="col-lg-3">
+ <div class="col-lg-3" *ngIf="searchFilters().includes('audience')">
<select class="form-control"
[(ngModel)]="context.termSearch.ccvmFilters.audience" multiple="true">
<option value='' i18n>All Audiences</option>
</div>
</div>
<div class="row mt-3" *ngIf="showFilters()">
- <div class="col-lg-3">
+ <div class="col-lg-3" *ngIf="searchFilters().includes('vr_format')">
<select class="form-control"
[(ngModel)]="context.termSearch.ccvmFilters.vr_format" multiple="true">
<option value='' i18n>All Video Formats</option>
</ng-container>
</select>
</div>
- <div class="col-lg-3">
+ <div class="col-lg-3" *ngIf="searchFilters().includes('bib_level')">
<select class="form-control"
[(ngModel)]="context.termSearch.ccvmFilters.bib_level" multiple="true">
<option value='' i18n>All Bib Levels</option>
</ng-container>
</select>
</div>
- <div class="col-lg-3">
+ <div class="col-lg-3" *ngIf="searchFilters().includes('lit_form')">
<select class="form-control"
[(ngModel)]="context.termSearch.ccvmFilters.lit_form" multiple="true">
<option value='' i18n>All Literary Forms</option>
showExcludeElectronic(): boolean {
return this.staffCat.showExcludeElectronic;
}
+ searchFilters(): string[] {
+ return this.staffCat.searchFilters;
+ }
}
'string'
);
+INSERT INTO config.org_unit_setting_type
+( name, grp, label, description, datatype )
+VALUES
+( 'eg.staffcat.search_filters', 'gui',
+ oils_i18n_gettext(
+ 'eg.staffcat.search_filters',
+ 'Staff Catalog Search Filters',
+ 'coust', 'label'),
+ oils_i18n_gettext(
+ 'eg.staffcat.search_filters',
+ 'Array of advanced search filters to display, e.g. ["item_lang","audience","lit_form"]',
+ 'coust', 'description'),
+ 'array' );
+
+
--- /dev/null
+BEGIN;
+
+--SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+INSERT INTO config.org_unit_setting_type
+( name, grp, label, description, datatype )
+VALUES
+( 'eg.staffcat.search_filters', 'gui',
+ oils_i18n_gettext(
+ 'eg.staffcat.search_filters',
+ 'Staff Catalog Search Filters',
+ 'coust', 'label'),
+ oils_i18n_gettext(
+ 'eg.staffcat.search_filters',
+ 'Array of advanced search filters to display, e.g. ["item_lang","audience","lit_form"]',
+ 'coust', 'description'),
+ 'array' );
+
+COMMIT;
+
+
+