Facet filtering modified:

- Author and Subjects substituted by Creator and Keyword
- Facet labels now separated by "|" instead of comma
This commit is contained in:
Porras-Bernardez 2024-08-09 16:17:30 +02:00
parent cc62df68da
commit 110c2db8bf
6 changed files with 89 additions and 40 deletions

View file

@ -19,9 +19,23 @@ export default class FacetCategory extends Vue {
})
filterName!: string;
/**
* The alias for the Active facet box will be set depending on the name of the category.
* This will allow to display the customised terms "creator" and "keyword" instead of the values currently used in the OpenSearch index: "author" and "subjects"
* TODO: This should be corrected directly in the index
*/
get alias(): string {
// console.log("filterName:", this.filterName);
return this.filterName == "datatype" ? "doctype" : this.filterName;
// return this.filterName == "datatype" ? "doctype" : this.filterName;
switch (this.filterName) {
case "author":
return "creator";
case "subjects":
return "keyword";
default:
return this.filterName;
}
}
// get filterItems(): Array<FilterItem> {
@ -54,8 +68,9 @@ export default class FacetCategory extends Vue {
@Emit("filter")
activateItem(filterItem: FacetItem): FacetItem {
// console.log("ActivateItem");
filterItem.category = this.alias;
console.log("Emit: ActivateItem");
// filterItem.category = this.alias;
filterItem.category = this.filterName;
filterItem.active = true;
// this.$emit("filter", filterItem);
return filterItem;