Fix: actually search for keywords in theme view

This commit is contained in:
Pieter Vander Vennet 2024-08-27 21:33:47 +02:00
parent 821c1fabd7
commit cdc1e05499
9 changed files with 193 additions and 95 deletions

View file

@ -41,14 +41,22 @@ export interface LayerConfigJson {
name?: Translatable
/**
* question: How would you describe the features that are shown on this layer?
*
* A description for the features shown in this layer.
* This often resembles the introduction of the wiki.osm.org-page for this feature.
*
* group: Basic
* question: How would you describe the features that are shown on this layer?
*/
description?: Translatable
/**
* question: What are some other terms used to describe these objects?
*
* This is used in the search functionality
*/
searchTerms?: Record<string, string[]>
/**
* Question: Where should the data be fetched from?
* title: Data Source

View file

@ -29,6 +29,7 @@ export default class LayerConfig extends WithContextLoader {
public readonly id: string
public readonly name: Translation
public readonly description: Translation
public readonly searchTerms: Record<string, string[]>
/**
* Only 'null' for special, privileged layers
*/
@ -113,8 +114,8 @@ export default class LayerConfig extends WithContextLoader {
json.description = undefined
}
}
this.description = Translations.T(json.description, translationContext + ".description")
this.searchTerms = json.searchTerms ?? {}
this.calculatedTags = undefined
if (json.calculatedTags !== undefined) {

View file

@ -25,7 +25,7 @@ export class MinimalLayoutInformation {
definition?: Translatable
mustHaveLanguage?: boolean
hideFromOverview?: boolean
keywords?: (Translatable | TagRenderingConfigJson)[]
keywords?: Record<string, string[]>
}
/**
* Minimal information about a theme