From f304a02c46575d067206958f589350456a6c4b9c Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Mon, 2 Sep 2024 10:29:01 +0200 Subject: [PATCH] Make 'allowMove' obligatory --- assets/themes/bag/bag.json | 12 ++++++++---- assets/themes/buurtnatuur/buurtnatuur.json | 9 ++++++--- assets/themes/grb/grb.json | 12 ++++++++---- .../ThemeConfig/Conversion/CreateNoteImportLayer.ts | 1 + .../ThemeConfig/Conversion/PrevalidateLayer.ts | 10 ++++++++++ 5 files changed, 33 insertions(+), 11 deletions(-) diff --git a/assets/themes/bag/bag.json b/assets/themes/bag/bag.json index eb526b223..31d9afaf1 100644 --- a/assets/themes/bag/bag.json +++ b/assets/themes/bag/bag.json @@ -149,7 +149,8 @@ ] } } - ] + ], + "allowMove": false }, { "id": "osm_adresses", @@ -187,7 +188,8 @@ "render": 1 } } - ] + ], + "allowMove": false }, { "id": "bag_pand", @@ -394,7 +396,8 @@ "render": 1 } } - ] + ], + "allowMove": false }, { "id": "bag_verblijfsobject", @@ -452,7 +455,8 @@ "render": 1 } } - ] + ], + "allowMove": false } ] } diff --git a/assets/themes/buurtnatuur/buurtnatuur.json b/assets/themes/buurtnatuur/buurtnatuur.json index 841f84390..c4fc208d4 100644 --- a/assets/themes/buurtnatuur/buurtnatuur.json +++ b/assets/themes/buurtnatuur/buurtnatuur.json @@ -137,7 +137,8 @@ }, "width": "5" } - ] + ], + "allowMove": false }, { "id": "parks", @@ -241,7 +242,8 @@ }, "width": "5" } - ] + ], + "allowMove": false }, { "id": "forest", @@ -364,7 +366,8 @@ }, "width": "5" } - ] + ], + "allowMove": false }, "viewpoint" ], diff --git a/assets/themes/grb/grb.json b/assets/themes/grb/grb.json index 20a85d809..7795edc20 100644 --- a/assets/themes/grb/grb.json +++ b/assets/themes/grb/grb.json @@ -274,7 +274,8 @@ ] } } - ] + ], + "allowMove": false }, { "id": "grb", @@ -539,7 +540,8 @@ ] } } - ] + ], + "allowMove": false }, { "id": "service_ways", @@ -556,7 +558,8 @@ "width": 4, "color": "#888888" } - ] + ], + "allowMove": false }, { "id": "generic_osm_object", @@ -602,7 +605,8 @@ "width": "1", "fill": "no" } - ] + ], + "allowMove": false }, "address", { diff --git a/src/Models/ThemeConfig/Conversion/CreateNoteImportLayer.ts b/src/Models/ThemeConfig/Conversion/CreateNoteImportLayer.ts index d477e1c95..feb5578ad 100644 --- a/src/Models/ThemeConfig/Conversion/CreateNoteImportLayer.ts +++ b/src/Models/ThemeConfig/Conversion/CreateNoteImportLayer.ts @@ -203,6 +203,7 @@ export default class CreateNoteImportLayer extends Conversion { } } + if(json.allowMove === undefined){ + if (!Constants.priviliged_layers.find((x) => x == json.id)) { + context.err( + "Layer " + + json.id + + " does not have an explicit 'allowMove'" + ) + } + } + if (context.hasErrors()) { return undefined }