Values for facet "language" changed to "English" and "Deutsch"

This commit is contained in:
Porras-Bernardez 2024-08-28 10:29:03 +02:00
parent 0126ae9f85
commit 9ad4037c74
4 changed files with 52 additions and 52 deletions

View file

@ -5,8 +5,7 @@ import { Component, Vue, Prop, Emit } from "vue-facing-decorator";
name: "ActiveFacetCategory",
})
export default class ActiveFacetCategory extends Vue {
bar = "";
@Prop({
type: Array<string>,
})
@ -18,6 +17,18 @@ export default class ActiveFacetCategory extends Vue {
})
categoryName!: string;
replacements = new Map<string, string>([
["gis", "GIS"],
["analysisdata", "Analysis Data"],
["models", "Models"],
["monitoring", "Monitoring"],
["measurementdata", "Measurement Data"],
["mixedtype", "Mixed Type"],
["de", "Deutsch"],
["en", "English"]
]);
// @Prop([String])
// alias;
@ -47,18 +58,8 @@ export default class ActiveFacetCategory extends Vue {
* NOTE: This could be corrected directly in the index
*/
filterItemsAlias(categoryAlias: string): string {
if (categoryAlias === "Data Type") {
// console.log("DataType");
const replacements = new Map<string, string>([
["gis", "GIS"],
["analysisdata", "Analysis Data"],
["models", "Models"],
["monitoring", "Monitoring"],
["measurementdata", "Measurement Data"],
["mixedtype", "Mixed Type"]
]);
console.log(categoryAlias);
if (categoryAlias === ("Data Type") || categoryAlias === ("language")) {
/**
* Iterate over the filterItems array using the map method to create a new array (updatedItems).
* For each item in the array, check if the item exists as a key in the replacements map.
@ -67,7 +68,7 @@ export default class ActiveFacetCategory extends Vue {
* The map method returns a new array where each element is either the original item or its replacement.
* */
const updatedItems = this.filterItems.map((item) =>
replacements.get(item) || item
this.replacements.get(item) || item
);
return updatedItems.join(" | ");