Datatype facet improved with user-friendly terms for the different types.

This commit is contained in:
Porras-Bernardez 2024-08-26 16:36:09 +02:00
parent 03a55f6a58
commit 0126ae9f85
7 changed files with 81 additions and 15 deletions

View file

@ -22,9 +22,9 @@ export default class FacetCategory extends Vue {
/**
* 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
* NOTE: This should be corrected directly in the index
*/
get alias(): string {
get categoryAlias(): string {
// console.log("filterName:", this.filterName);
// return this.filterName == "datatype" ? "doctype" : this.filterName;
@ -34,12 +34,38 @@ export default class FacetCategory extends Vue {
case "subjects":
return "keyword";
case "doctype":
return "datatype";
return "Data Type";
default:
return this.filterName;
}
}
/**
* The alias for the items inside the "doctype / Datatype" category will be set manually in order to show user-friendly terms instead of the predefined doctypes in the DB
* NOTE: This could be corrected directly in the index
*/
itemAlias(val: string): string {
// console.log("filterName:", this.filterName);
// return this.filterName == "datatype" ? "doctype" : this.filterName;
switch (val) {
case "gis":
return "GIS";
case "analysisdata":
return "Analysis Data";
case "models":
return "Models";
case "monitoring":
return "Monitoring";
case "measurementdata":
return "Measurement Data";
case "mixedtype":
return "Mixed Type";
default:
return val;
}
}
// get filterItems(): Array<FilterItem> {
// return this.data;
// }