From d9ab9f1c8f79757ef61f19eb60fde60f1fedbc3f Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Mon, 26 Aug 2024 20:43:31 +0200 Subject: [PATCH] Fix build --- assets/layers/shops/shops.json | 5 ++--- scripts/initFiles.sh | 7 ++++--- .../ThemeConfig/Conversion/PrepareLayer.ts | 17 +++++++++-------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/assets/layers/shops/shops.json b/assets/layers/shops/shops.json index bdf5b3801..f8368c1bc 100644 --- a/assets/layers/shops/shops.json +++ b/assets/layers/shops/shops.json @@ -257,7 +257,6 @@ { "builtin": "id_presets.shop_types", "override": { - "id": "shop_types", "labels": [ "description" ], @@ -308,7 +307,8 @@ } ], "condition": "craft=", - "invalidValues": "shop=yes" + "invalidValues": "shop=yes", + "filter": true } }, { @@ -1175,7 +1175,6 @@ ], "filter": [ "open_now", - "shop_types", { "id": "second_hand", "options": [ diff --git a/scripts/initFiles.sh b/scripts/initFiles.sh index 0d0cb04c6..a051043dc 100755 --- a/scripts/initFiles.sh +++ b/scripts/initFiles.sh @@ -2,8 +2,9 @@ # Creates various empty (stub) version of files -mkdir -p ./src/assets/generated/layers; echo {\\\"themes\\\":[]} > ./src/assets/generated/known_themes.json - echo {\\\"layers\\\": []} > ./src/assets/generated/known_layers.json +mkdir -p ./src/assets/generated/layers; +echo '{"themes":[]}' > ./src/assets/generated/known_themes.json + echo '{"layers": []}' > ./src/assets/generated/known_layers.json rm -f ./src/assets/generated/layers/*.json rm -f ./src/assets/generated/themes/*.json cp ./assets/layers/usersettings/usersettings.json ./src/assets/generated/layers/usersettings.json @@ -11,4 +12,4 @@ mkdir -p ./src/assets/generated/layers; echo {\\\"themes\\\":[]} > ./src/assets/ echo '{}' > ./src/assets/generated/layers/summary.json echo '{}' > ./src/assets/generated/layers/last_click.json echo '{}' > ./src/assets/generated/layers/search.json - echo '[]' > ./src/assets/generated/theme_overview.json /theme_overview.json + echo '[]' > ./src/assets/generated/theme_overview.json diff --git a/src/Models/ThemeConfig/Conversion/PrepareLayer.ts b/src/Models/ThemeConfig/Conversion/PrepareLayer.ts index 4f28c3af9..1b1e1a80e 100644 --- a/src/Models/ThemeConfig/Conversion/PrepareLayer.ts +++ b/src/Models/ThemeConfig/Conversion/PrepareLayer.ts @@ -62,9 +62,9 @@ class ExpandFilter extends DesugaringStep { ) } const options = (tr).mappings.map((mapping) => { - let icon : string= mapping.icon?.["path"] ?? mapping.icon + let icon: string = mapping.icon?.["path"] ?? mapping.icon let emoji: string = undefined - if(Utils.isEmoji(icon)){ + if (Utils.isEmoji(icon)) { emoji = icon icon = undefined } @@ -72,7 +72,7 @@ class ExpandFilter extends DesugaringStep { question: mapping.then, osmTags: mapping.if, searchTerms: mapping.searchTerms, - icon, emoji + icon, emoji, }) }) // Add default option @@ -99,8 +99,8 @@ class ExpandFilter extends DesugaringStep { const newFilters: FilterConfigJson[] = [] const filters = <(FilterConfigJson | string)[]>json.filter - function filterExists(filterName: string): boolean{ - return filters.some((existing) => { + function filterExists(filterName: string): boolean { + return filters.some((existing) => { const id: string = existing["id"] ?? existing return ( filterName === id || @@ -118,10 +118,10 @@ class ExpandFilter extends DesugaringStep { continue } if (tagRendering.filter === true) { - if(filterExists(tagRendering["id"])){ - continue + if (filterExists(tagRendering["id"])) { + continue } - filters.push(ExpandFilter.buildFilterFromTagRendering(tagRendering, context.enters("tagRenderings", i, "filter"))) + filters.push(ExpandFilter.buildFilterFromTagRendering(tagRendering, context.enters("tagRenderings", i, "filter"))) continue } for (const filterName of tagRendering.filter ?? []) { @@ -129,6 +129,7 @@ class ExpandFilter extends DesugaringStep { context.enters("tagRenderings", i, "filter").err("Not a string: " + filterName) } if (filterExists(filterName)) { + // This filter has already been added continue } if (!filterName) {