forked from MapComplete/MapComplete
		
	Disable feature box if the feature has changed upstream and no longer matches the layer definition
This commit is contained in:
		
							parent
							
								
									ac90379499
								
							
						
					
					
						commit
						cae8854dbe
					
				
					 2 changed files with 12 additions and 1 deletions
				
			
		|  | @ -27,6 +27,7 @@ | |||
|             "selectReason": "Please, select why this feature should be deleted", | ||||
|             "softDelete": "This feature will be updated and hidden from this application. <span class='subtle'>{reason}</span>" | ||||
|         }, | ||||
|         "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.", | ||||
|  |  | |||
|  | @ -17,6 +17,12 @@ | |||
|   export let tags: UIEventSource<Record<string, string>> = 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<string, string> | ||||
|   onDestroy( | ||||
|  | @ -35,7 +41,11 @@ | |||
|   ) | ||||
| </script> | ||||
| 
 | ||||
| {#if $tags._deleted === "yes"} | ||||
| {#if !$stillMatches} | ||||
|   <div class="alert"  aria-live="assertive"> | ||||
|     <Tr t={Translations.t.delete.isChanged}/> | ||||
|   </div> | ||||
| {:else if $tags._deleted === "yes"} | ||||
|   <div aria-live="assertive"> | ||||
|     <Tr t={Translations.t.delete.isDeleted} /> | ||||
|   </div> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue