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",
 | 
					            "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>"
 | 
					            "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",
 | 
					        "isDeleted": "This feature is deleted",
 | 
				
			||||||
        "isntAPoint": "Only nodes can be deleted, the selected feature is a way, area or relation.",
 | 
					        "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.",
 | 
					        "loading": "Inspecting properties to check if this feature can be deleted.",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,6 +18,12 @@
 | 
				
			||||||
    selectedElement.properties.id
 | 
					    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>
 | 
					  let _metatags: Record<string, string>
 | 
				
			||||||
  onDestroy(
 | 
					  onDestroy(
 | 
				
			||||||
    state.userRelatedState.preferencesAsTags.addCallbackAndRun((tags) => {
 | 
					    state.userRelatedState.preferencesAsTags.addCallbackAndRun((tags) => {
 | 
				
			||||||
| 
						 | 
					@ -35,7 +41,11 @@
 | 
				
			||||||
  )
 | 
					  )
 | 
				
			||||||
</script>
 | 
					</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">
 | 
					  <div aria-live="assertive">
 | 
				
			||||||
    <Tr t={Translations.t.delete.isDeleted} />
 | 
					    <Tr t={Translations.t.delete.isDeleted} />
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue