Add safety check in the case tag calculation failed

This commit is contained in:
Pieter Vander Vennet 2022-10-11 01:28:47 +02:00
parent d562e7fd7c
commit deea498b9b

View file

@ -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)}"