Fix: emit warning for invalid suggestions
This commit is contained in:
parent
578f638749
commit
56ba426ab5
6 changed files with 5 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "mapcomplete",
|
||||
"version": "0.42.2",
|
||||
"version": "0.42.3",
|
||||
"repository": "https://github.com/pietervdvn/MapComplete",
|
||||
"description": "A small website to edit OSM easily",
|
||||
"bugs": "https://github.com/pietervdvn/MapComplete/issues",
|
||||
|
|
|
@ -207,6 +207,9 @@ function extractHintsFrom(
|
|||
validators: Validators,
|
||||
Constants: Constants,
|
||||
})
|
||||
if(hints["suggestions"]?.indexOf(null) >= 0){
|
||||
throw "A suggestion generated 'null' for "+path.join(".")+". Check the docstring, specifically 'suggestions'. Pay attention to double commas"
|
||||
}
|
||||
}
|
||||
return hints
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ export default interface PointRenderingConfigJson {
|
|||
/**
|
||||
* question: At what location should this icon be shown?
|
||||
* multianswer: true
|
||||
* suggestions: return [{if: "value=point",then: "Show an icon for point (node) objects"},{if: "value=centroid",then: "Show an icon for line or polygon (way) objects at their centroid location"}, {if: "value=start",then: "Show an icon for line (way) objects at the start"},{if: "value=end",then: "Show an icon for line (way) object at the end"},{if: "value=projected_centerpoint",then: "Show an icon for line (way) object near the centroid location, but moved onto the line. Does not show an item on polygons"}, ,{if: "value=polygon_centroid",then: "Show an icon at a polygon centroid (but not if it is a way)"}]
|
||||
* suggestions: return [{if: "value=point",then: "Show an icon for point (node) objects"},{if: "value=centroid",then: "Show an icon for line or polygon (way) objects at their centroid location"}, {if: "value=start",then: "Show an icon for line (way) objects at the start"},{if: "value=end",then: "Show an icon for line (way) object at the end"},{if: "value=projected_centerpoint",then: "Show an icon for line (way) object near the centroid location, but moved onto the line. Does not show an item on polygons"}, {if: "value=polygon_centroid",then: "Show an icon at a polygon centroid (but not if it is a way)"}]
|
||||
*/
|
||||
location: (
|
||||
| "point"
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
}
|
||||
state.setValueAt(path, values)
|
||||
})
|
||||
|
||||
const config = new TagRenderingConfig(configJson)
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1629,7 +1629,6 @@
|
|||
"if": "value=projected_centerpoint",
|
||||
"then": "Show an icon for line (way) object near the centroid location, but moved onto the line. Does not show an item on polygons"
|
||||
},
|
||||
null,
|
||||
{
|
||||
"if": "value=polygon_centroid",
|
||||
"then": "Show an icon at a polygon centroid (but not if it is a way)"
|
||||
|
|
|
@ -3597,7 +3597,6 @@
|
|||
"if": "value=projected_centerpoint",
|
||||
"then": "Show an icon for line (way) object near the centroid location, but moved onto the line. Does not show an item on polygons"
|
||||
},
|
||||
null,
|
||||
{
|
||||
"if": "value=polygon_centroid",
|
||||
"then": "Show an icon at a polygon centroid (but not if it is a way)"
|
||||
|
@ -23954,7 +23953,6 @@
|
|||
"if": "value=projected_centerpoint",
|
||||
"then": "Show an icon for line (way) object near the centroid location, but moved onto the line. Does not show an item on polygons"
|
||||
},
|
||||
null,
|
||||
{
|
||||
"if": "value=polygon_centroid",
|
||||
"then": "Show an icon at a polygon centroid (but not if it is a way)"
|
||||
|
|
Loading…
Reference in a new issue