Small fixes, add filters to shops

This commit is contained in:
pietervdvn 2022-04-04 05:12:14 +02:00
parent b119e1ac1d
commit df706d2f97
4 changed files with 33 additions and 3 deletions

View file

@ -16,6 +16,9 @@ export default interface FilterConfigJson {
osmTags?: AndOrTagConfigJson | string,
default?: boolean,
fields?: {
/**
* If name is `search`, use "_first_comment~.*{search}.*" as osmTags
*/
name: string,
type?: string | "string"
}[]

View file

@ -62,7 +62,7 @@ export default class ExtraLinkButton extends UIElement {
let text: Translation
if (c.text === undefined) {
text = Translations.t.general.screenToSmall.Fuse(this.state.layoutToUse.title, "{theme}")
text = Translations.t.general.screenToSmall.Subs({theme: this.state.layoutToUse.title})
} else {
text = c.text.Clone()
}

View file

@ -408,5 +408,33 @@
"render": "8"
}
}
],
"filter": [
{
"id": "shop-type",
"options": [{
"fields": [{
"name": "search",
"type": "string"
}],
"osmTags": "shop~^.*{search}.*$",
"question": {
"en": "Only show shops selling {search}"
}
}
]
},
{
"id": "shop-name",
"options": [{
"fields": [{
"name": "search",
"type": "string"
}],
"osmTags": "name~^.*{search}.*$",
"question": {
"en": "Only show shops with name {search}"
}
}]}
]
}

View file

@ -1,8 +1,7 @@
{
"id": "mapcomplete-changes",
"title": {
"en": "Changes made with MapComplete",
"nl": "Wijzigingen gemaakt met MapComplete"
"en": "Changes made with MapComplete"
},
"shortDescription": {
"en": "Shows changes made by MapComplete"