diff --git a/data/deprecated.json b/data/deprecated.json index f1905cecc..ed3ebae6b 100644 --- a/data/deprecated.json +++ b/data/deprecated.json @@ -230,23 +230,23 @@ }, { "old": {"cuisine": "gluten-free"}, - "replace": {"diet:gluten_free": "yes"} + "replace": {"diet:gluten_free": "*"} }, { "old": {"cuisine": "halal"}, - "replace": {"diet:halal": "yes"} + "replace": {"diet:halal": "*"} }, { "old": {"cuisine": "kosher"}, - "replace": {"diet:kosher": "yes"} + "replace": {"diet:kosher": "*"} }, { "old": {"cuisine": "vegan"}, - "replace": {"diet:vegan": "yes"} + "replace": {"diet:vegan": "*"} }, { "old": {"cuisine": "vegetarian"}, - "replace": {"diet:vegetarian": "yes"} + "replace": {"diet:vegetarian": "*"} }, { "old": {"curb": "*"}, diff --git a/data/taginfo.json b/data/taginfo.json index 0df194178..26cf4433d 100644 --- a/data/taginfo.json +++ b/data/taginfo.json @@ -1802,11 +1802,11 @@ {"key": "craft", "value": "glass", "description": "🄳 ➜ craft=glaziery"}, {"key": "craft", "value": "catering", "description": "🄳 ➜ craft=caterer"}, {"key": "craft", "value": "sculpter", "description": "🄳 ➜ craft=sculptor"}, - {"key": "cuisine", "value": "gluten-free", "description": "🄳 ➜ diet:gluten_free=yes"}, - {"key": "cuisine", "value": "halal", "description": "🄳 ➜ diet:halal=yes"}, - {"key": "cuisine", "value": "kosher", "description": "🄳 ➜ diet:kosher=yes"}, - {"key": "cuisine", "value": "vegan", "description": "🄳 ➜ diet:vegan=yes"}, - {"key": "cuisine", "value": "vegetarian", "description": "🄳 ➜ diet:vegetarian=yes"}, + {"key": "cuisine", "value": "gluten-free", "description": "🄳 ➜ diet:gluten_free=*"}, + {"key": "cuisine", "value": "halal", "description": "🄳 ➜ diet:halal=*"}, + {"key": "cuisine", "value": "kosher", "description": "🄳 ➜ diet:kosher=*"}, + {"key": "cuisine", "value": "vegan", "description": "🄳 ➜ diet:vegan=*"}, + {"key": "cuisine", "value": "vegetarian", "description": "🄳 ➜ diet:vegetarian=*"}, {"key": "curb", "description": "🄳 ➜ kerb=*"}, {"key": "drinkable", "description": "🄳 ➜ drinking_water=*"}, {"key": "dropped_kerb", "description": "🄳 ➜ kerb=lowered"}, diff --git a/modules/actions/upgrade_tags.js b/modules/actions/upgrade_tags.js index 418050c56..92bf48e2e 100644 --- a/modules/actions/upgrade_tags.js +++ b/modules/actions/upgrade_tags.js @@ -30,9 +30,8 @@ export function actionUpgradeTags(entityId, oldTags, replaceTags) { for (var replaceKey in replaceTags) { var replaceValue = replaceTags[replaceKey]; if (replaceValue === '*') { - if (tags[replaceKey]) { - // any value is okay and there already - // is one, so don't update it + if (tags[replaceKey] && tags[replaceKey] !== 'no') { + // allow any pre-existing value except `no` (troll tag) continue; } else { // otherwise assume `yes` is okay diff --git a/test/spec/actions/upgrade_tags.js b/test/spec/actions/upgrade_tags.js index 4a1af78d2..b5b8fe44b 100644 --- a/test/spec/actions/upgrade_tags.js +++ b/test/spec/actions/upgrade_tags.js @@ -64,6 +64,14 @@ describe('iD.actionUpgradeTags', function () { expect(graph.entity(entity.id).tags).to.eql({ shop: 'supermarket', name: 'Foo' }); }); + it('upgrades a tag with a wildcard replacement and replaces the exisiting "no" value', function () { + var oldTags = { amenity: 'shop' }, + newTags = { shop: '*' }, + entity = iD.Entity({ tags: { amenity: 'shop', shop: 'no', name: 'Foo' }}), + graph = iD.actionUpgradeTags(entity.id, oldTags, newTags)(iD.coreGraph([entity])); + expect(graph.entity(entity.id).tags).to.eql({ shop: 'yes', name: 'Foo' }); + }); + it('upgrades a tag from a semicolon-delimited list that has one other value', function () { var oldTags = { cuisine: 'vegan' }, newTags = { 'diet:vegan': 'yes' },