From deea498b9b987ea8ce884daa0a0a239a0459e388 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 11 Oct 2022 01:28:47 +0200 Subject: [PATCH] Add safety check in the case tag calculation failed --- assets/themes/bag_import/bag.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/assets/themes/bag_import/bag.json b/assets/themes/bag_import/bag.json index c4934eb7d..331163286 100644 --- a/assets/themes/bag_import/bag.json +++ b/assets/themes/bag_import/bag.json @@ -196,6 +196,18 @@ "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)}", "mappings": [ + { + "#": "Something went wrong calculating the tags - don't show an import button", + "if": { + "or": [ + "_bag_obj:building=", + "_bag_obj:ref:bag" + ] + }, + "then": { + "en": "Didn't calculate the correct values yet. Refresh this page" + } + }, { "if": "_overlaps_with!=", "then": "{conflate_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, Replace the geometry in OpenStreetMap, , _osm_obj:id)}"