Run deprecated_tag validation on modified as well as created features
This commit is contained in:
Quincy Morgan
2019-01-24 15:09:02 -05:00
parent b21dd1d5d6
commit a259a9acf1
2 changed files with 69 additions and 7 deletions
+64 -1
View File
@@ -76,14 +76,25 @@
"old": {"craft": "optician"},
"replace": {"shop": "optician"}
},
{
"old": {"drinkable": "*"},
"replace": {"drinking_water": "$1"}
},
{
"old": {"escalator": "*"},
"replace": {"highway": "steps", "conveying": "$1"}
},
{
"old": {"fenced": "yes"},
"replace": {"barrier": "fence"}
},
{
"old": {"highway": "ford"},
"replace": {"ford": "*"}
},
{
"old": {"highway": "no"}
},
{
"old": {"highway": "stile"},
"replace": {"barrier": "stile"}
@@ -104,13 +115,37 @@
"old": {"landuse": "farm"},
"replace": {"landuse": "farmland"}
},
{
"old": {"landuse": "field"},
"replace": {"landuse": "farmland"}
},
{
"old": {"landuse": "pond"},
"replace": {"natural": "water", "water": "pond"}
},
{
"old": {"landuse": "wood"},
"replace": {"landuse": "forest", "natural": "wood"}
"replace": {"natural": "wood"}
},
{
"old": {"leisure": "beach"},
"replace": {"natural": "beach"}
},
{
"old": {"leisure": "club"},
"replace": {"club": "*"}
},
{
"old": {"man_made": "jetty"},
"replace": {"man_made": "pier"}
},
{
"old": {"man_made": "water_tank"},
"replace": {"man_made": "storage_tank", "content": "water"}
},
{
"old": {"man_made": "well"},
"replace": {"man_made": "water_well"}
},
{
"old": {"natural": "marsh"},
@@ -120,6 +155,14 @@
"old": {"office": "administrative"},
"replace": {"office": "government"}
},
{
"old": {"place_name": "*"},
"replace": {"name": "$1"}
},
{
"old": {"pole": "transition"},
"replace": {"location:transition": "yes"}
},
{
"old": {"power": "sub_station"},
"replace": {"power": "substation"}
@@ -132,10 +175,18 @@
"old": {"power_rating": "*"},
"replace": {"generator:output": "$1"}
},
{
"old": {"route": "ncn"},
"replace": {"route": "bicycle", "network": "ncn"}
},
{
"old": {"shop": "organic"},
"replace": {"shop": "supermarket", "organic": "only"}
},
{
"old": {"shop": "fish"},
"replace": {"shop": "seafood"}
},
{
"old": {"shop": "fishmonger"},
"replace": {"shop": "seafood"}
@@ -143,6 +194,18 @@
{
"old": {"shop": "furnace"},
"replace": {"shop": "fireplace"}
},
{
"old": {"shop": "gallery"},
"replace": {"shop": "art"}
},
{
"old": {"shop": "perfume"},
"replace": {"shop": "perfumery"}
},
{
"old": {"tourism": "bed_and_breakfast"},
"replace": {"tourism": "guest_house"}
}
]
}
+5 -6
View File
@@ -1,4 +1,3 @@
import _isEmpty from 'lodash-es/isEmpty';
import _clone from 'lodash-es/clone';
import { t } from '../util/locale';
import {
@@ -19,12 +18,12 @@ import {
export function validationDeprecatedTag(context) {
var validation = function(changes) {
var issues = [];
for (var i = 0; i < changes.created.length; i++) {
var change = changes.created[i];
var edited = changes.created.concat(changes.modified),
issues = [];
for (var changeIndex in edited) {
var change = edited[changeIndex];
var deprecatedTagsArray = change.deprecatedTags();
if (!_isEmpty(deprecatedTagsArray)) {
if (deprecatedTagsArray.length > 0) {
for (var deprecatedTagIndex in deprecatedTagsArray) {
var deprecatedTags = deprecatedTagsArray[deprecatedTagIndex];
var tagsLabel = utilTagText({ tags: deprecatedTags.old });