mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-24 00:54:03 +02:00
Improve message and add tooltip to tag_suggeset_area validation
This commit is contained in:
+2
-1
@@ -1160,7 +1160,8 @@ en:
|
||||
many_deletions:
|
||||
message: "You're deleting {n} features: {p} nodes, {l} lines, {a} areas, {r} relations. Are you sure you want to do this? This will delete them from the map that everyone else sees on openstreetmap.org."
|
||||
tag_suggests_area:
|
||||
message: "The tag {tag} suggests line should be area, but it is not an area."
|
||||
message: 'Feature is a line, but the tag "{tag}" suggests it should be an area.'
|
||||
tip: Areas must have connected endpoints.
|
||||
deprecated_tags:
|
||||
message: '{feature} has outdated tags: {tags}'
|
||||
tip: Some tags become deprecated over time and should be replaced.
|
||||
|
||||
Vendored
+2
-1
@@ -1408,7 +1408,8 @@
|
||||
"message": "You're deleting {n} features: {p} nodes, {l} lines, {a} areas, {r} relations. Are you sure you want to do this? This will delete them from the map that everyone else sees on openstreetmap.org."
|
||||
},
|
||||
"tag_suggests_area": {
|
||||
"message": "The tag {tag} suggests line should be area, but it is not an area."
|
||||
"message": "Feature is a line, but the tag \"{tag}\" suggests it should be an area.",
|
||||
"tip": "Areas must have connected endpoints."
|
||||
},
|
||||
"deprecated_tags": {
|
||||
"message": "{feature} has outdated tags: {tags}",
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
|
||||
// https://github.com/openstreetmap/josm/blob/mirror/src/org/
|
||||
// openstreetmap/josm/data/validation/tests/UnclosedWays.java#L80
|
||||
export function validationTagSuggestsArea() {
|
||||
export function validationTagSuggestsArea(context) {
|
||||
|
||||
function tagSuggestsArea(tags) {
|
||||
if (_isEmpty(tags)) return false;
|
||||
@@ -32,16 +32,17 @@ export function validationTagSuggestsArea() {
|
||||
var validation = function(entitiesToCheck, graph) {
|
||||
var issues = [];
|
||||
for (var i = 0; i < entitiesToCheck.length; i++) {
|
||||
var change = entitiesToCheck[i];
|
||||
var geometry = change.geometry(graph);
|
||||
var suggestion = (geometry === 'line' ? tagSuggestsArea(change.tags) : undefined);
|
||||
var entity = entitiesToCheck[i];
|
||||
var geometry = entity.geometry(graph);
|
||||
var suggestion = (geometry === 'line' ? tagSuggestsArea(entity.tags) : undefined);
|
||||
|
||||
if (suggestion) {
|
||||
issues.push(new validationIssue({
|
||||
type: ValidationIssueType.tag_suggests_area,
|
||||
severity: ValidationIssueSeverity.warning,
|
||||
message: t('issues.tag_suggests_area.message', { tag: suggestion }),
|
||||
entities: [change],
|
||||
tooltip: t('issues.tag_suggests_area.tip'),
|
||||
entities: [entity],
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user