Warn on untagged relations

(re #3812)
This commit is contained in:
Bryan Housel
2017-02-01 14:41:41 -05:00
parent 8d191cd34a
commit 3b46f1c83f
3 changed files with 8 additions and 2 deletions
+2
View File
@@ -464,11 +464,13 @@ en:
untagged_point: Untagged point
untagged_line: Untagged line
untagged_area: Untagged area
untagged_relation: Untagged relation
many_deletions: "You're deleting {n} features. 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: "The tag {tag} suggests line should be area, but it is not an area"
untagged_point_tooltip: "Select a feature type that describes what this point is."
untagged_line_tooltip: "Select a feature type that describes what this line is."
untagged_area_tooltip: "Select a feature type that describes what this area is."
untagged_relation_tooltip: "Select a feature type that describes what this relation is."
deprecated_tags: "Deprecated tags: {tags}"
zoom:
in: Zoom In
+2
View File
@@ -571,11 +571,13 @@
"untagged_point": "Untagged point",
"untagged_line": "Untagged line",
"untagged_area": "Untagged area",
"untagged_relation": "Untagged relation",
"many_deletions": "You're deleting {n} features. 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": "The tag {tag} suggests line should be area, but it is not an area",
"untagged_point_tooltip": "Select a feature type that describes what this point is.",
"untagged_line_tooltip": "Select a feature type that describes what this line is.",
"untagged_area_tooltip": "Select a feature type that describes what this area is.",
"untagged_relation_tooltip": "Select a feature type that describes what this relation is.",
"deprecated_tags": "Deprecated tags: {tags}"
},
"zoom": {
+4 -2
View File
@@ -10,12 +10,14 @@ export function validationMissingTag() {
}
var validation = function(changes, graph) {
var warnings = [];
var types = ['point', 'line', 'area', 'relation'],
warnings = [];
for (var i = 0; i < changes.created.length; i++) {
var change = changes.created[i],
geometry = change.geometry(graph);
if ((geometry === 'point' || geometry === 'line' || geometry === 'area') && !hasTags(change, graph)) {
if (types.indexOf(geometry) !== -1 && !hasTags(change, graph)) {
warnings.push({
id: 'missing_tag',
message: t('validations.untagged_' + geometry),