From cae8854dbeff20ee11593a50ac68b0a59d21e3a8 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 20 Feb 2024 23:47:49 +0100 Subject: [PATCH] Disable feature box if the feature has changed upstream and no longer matches the layer definition --- langs/en.json | 1 + src/UI/BigComponents/SelectedElementView.svelte | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/langs/en.json b/langs/en.json index 16759ffab4..12d6a14ae6 100644 --- a/langs/en.json +++ b/langs/en.json @@ -27,6 +27,7 @@ "selectReason": "Please, select why this feature should be deleted", "softDelete": "This feature will be updated and hidden from this application. {reason}" }, + "isChanged": "This feature has been changed and no longer matches this layer", "isDeleted": "This feature is deleted", "isntAPoint": "Only nodes can be deleted, the selected feature is a way, area or relation.", "loading": "Inspecting properties to check if this feature can be deleted.", diff --git a/src/UI/BigComponents/SelectedElementView.svelte b/src/UI/BigComponents/SelectedElementView.svelte index 3bf1df98d1..bdc3701991 100644 --- a/src/UI/BigComponents/SelectedElementView.svelte +++ b/src/UI/BigComponents/SelectedElementView.svelte @@ -17,6 +17,12 @@ export let tags: UIEventSource> = state.featureProperties.getStore( selectedElement.properties.id ) + + + let stillMatches = tags.map(tags => { + console.log("Tags are now:",tags, layer.source.osmTags?.matchesProperties(tags)) + return !layer.source?.osmTags || layer.source.osmTags?.matchesProperties(tags) + }) let _metatags: Record onDestroy( @@ -35,7 +41,11 @@ ) -{#if $tags._deleted === "yes"} +{#if !$stillMatches} +
+ +
+{:else if $tags._deleted === "yes"}