forked from MapComplete/MapComplete
Fix: actually search for keywords in theme view
This commit is contained in:
parent
821c1fabd7
commit
cdc1e05499
9 changed files with 193 additions and 95 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue