From df706d2f9780b383e74da7df279629b5331e4582 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Mon, 4 Apr 2022 05:12:14 +0200 Subject: [PATCH] Small fixes, add filters to shops --- Models/ThemeConfig/Json/FilterConfigJson.ts | 3 ++ UI/BigComponents/ExtraLinkButton.ts | 2 +- assets/layers/shops/shops.json | 28 +++++++++++++++++++ .../mapcomplete-changes.json | 3 +- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/Models/ThemeConfig/Json/FilterConfigJson.ts b/Models/ThemeConfig/Json/FilterConfigJson.ts index 493bf74c9..bd03200f3 100644 --- a/Models/ThemeConfig/Json/FilterConfigJson.ts +++ b/Models/ThemeConfig/Json/FilterConfigJson.ts @@ -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" }[] diff --git a/UI/BigComponents/ExtraLinkButton.ts b/UI/BigComponents/ExtraLinkButton.ts index 102204e8d..4e4dbb0a2 100644 --- a/UI/BigComponents/ExtraLinkButton.ts +++ b/UI/BigComponents/ExtraLinkButton.ts @@ -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() } diff --git a/assets/layers/shops/shops.json b/assets/layers/shops/shops.json index 69df31c5a..9f5a32dce 100644 --- a/assets/layers/shops/shops.json +++ b/assets/layers/shops/shops.json @@ -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}" + } + }]} ] } \ No newline at end of file diff --git a/assets/themes/mapcomplete-changes/mapcomplete-changes.json b/assets/themes/mapcomplete-changes/mapcomplete-changes.json index 478d968ef..da73732b3 100644 --- a/assets/themes/mapcomplete-changes/mapcomplete-changes.json +++ b/assets/themes/mapcomplete-changes/mapcomplete-changes.json @@ -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"