From 1c99173f32112b332ce38f926623fa2c27f89ab8 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 30 May 2023 03:22:21 +0200 Subject: [PATCH] Fix: layers now compile again --- UI/Popup/ImportButtons/ImportFlow.ts | 6 +++--- assets/themes/bag/bag.json | 13 ++++++++++++- assets/themes/onwheels/onwheels.json | 1 - .../street_lighting_assen.json | 2 +- assets/themes/uk_addresses/uk_addresses.json | 3 +-- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/UI/Popup/ImportButtons/ImportFlow.ts b/UI/Popup/ImportButtons/ImportFlow.ts index bfcba1cce7..d16085ee2f 100644 --- a/UI/Popup/ImportButtons/ImportFlow.ts +++ b/UI/Popup/ImportButtons/ImportFlow.ts @@ -99,8 +99,8 @@ ${Utils.special_visualizations_importRequirementDocs} * Others (e.g.: snapOnto-layers) are not to be handled here * @param argsRaw */ - public static getLayerDependencies(argsRaw: string[]) { - const args: ImportFlowArguments = Utils.ParseVisArgs(ImportFlowUtils.generalArguments, argsRaw) + public static getLayerDependencies(argsRaw: string[], argSpec?) { + const args: ImportFlowArguments = Utils.ParseVisArgs(argSpec ?? ImportFlowUtils.generalArguments, argsRaw) return [args.targetLayer] } @@ -108,7 +108,7 @@ ${Utils.special_visualizations_importRequirementDocs} name: string, defaultValue?: string }[], argsRaw: string[]): string[] { - const deps = ImportFlowUtils.getLayerDependencies(argsRaw) + const deps = ImportFlowUtils.getLayerDependencies(argsRaw, argSpec) const argsParsed: PointImportFlowArguments = Utils.ParseVisArgs(argSpec, argsRaw) const snapOntoLayers = argsParsed.snap_onto_layers?.split(";")?.map(l => l.trim()) ?? [] deps.push(...snapOntoLayers) diff --git a/assets/themes/bag/bag.json b/assets/themes/bag/bag.json index 17b0c0cb1f..205dcf2529 100644 --- a/assets/themes/bag/bag.json +++ b/assets/themes/bag/bag.json @@ -232,7 +232,18 @@ "tagRenderings": [ { "id": "Import button", - "render": "{import_way_button(osm:buildings, building=$_bag_obj:building; ref:bag=$_bag_obj:ref:bag; source=BAG; source:date=$_bag_obj:source:date; start_date=$_bag_obj:start_date, Upload this building to OpenStreetMap)}", + "render": { + "special": { + "type": "import_way_button", + "targetLayer": "osm:buildings", + "tags": "building=$_bag_obj:building; ref:bag=$_bag_obj:ref:bag; source=BAG; source:date=$_bag_obj:source:date; start_date=$_bag_obj:start_date", + "text": { + "*": "Upload this building to OpenStreetMap" + } + } + }, + + "mappings": [ { "#": "Something went wrong calculating the tags - don't show an import button", diff --git a/assets/themes/onwheels/onwheels.json b/assets/themes/onwheels/onwheels.json index cd12e45537..16318636c7 100644 --- a/assets/themes/onwheels/onwheels.json +++ b/assets/themes/onwheels/onwheels.json @@ -446,7 +446,6 @@ "es": "Importar" }, "icon": "./assets/svg/addSmall.svg", - "location_picker": "photo", "maproulette_id": "mr_taskId" } } diff --git a/assets/themes/street_lighting_assen/street_lighting_assen.json b/assets/themes/street_lighting_assen/street_lighting_assen.json index ad067a8568..86aec47de8 100644 --- a/assets/themes/street_lighting_assen/street_lighting_assen.json +++ b/assets/themes/street_lighting_assen/street_lighting_assen.json @@ -61,7 +61,7 @@ "tagRenderings+": [ { "id": "import", - "render": "{import_button(street_lamps,tags,Import,./assets/svg/addSmall.svg,,,,photo,mr_taskId)}" + "render": "{import_button(street_lamps,tags,Import,./assets/svg/addSmall.svg,,,,mr_taskId)}" } ] } diff --git a/assets/themes/uk_addresses/uk_addresses.json b/assets/themes/uk_addresses/uk_addresses.json index 6452bf776e..0d3a0051fd 100644 --- a/assets/themes/uk_addresses/uk_addresses.json +++ b/assets/themes/uk_addresses/uk_addresses.json @@ -128,8 +128,7 @@ "targetLayer": "address", "tags": "urpn_count=$urpn_count;ref:GB:uprn=$ref:GB:uprn$", "text": "Add this address", - "icon": "./assets/themes/uk_addresses/housenumber_add.svg", - "location_picker": "none" + "icon": "./assets/themes/uk_addresses/housenumber_add.svg" } } }