From decba8f2150ffed6ad06bda53f4d2d1d77cae8af Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Fri, 25 Jan 2019 08:39:15 -0500 Subject: [PATCH] Fix cycleway field to appear if "cycleway" tag present but not "cycleway:left" nor "cycleway:right" (close #5756) --- data/presets.yaml | 2 +- data/presets/fields.json | 2 +- data/presets/fields/cycleway.json | 2 +- data/taginfo.json | 7 +++++++ modules/ui/fields/cycleway.js | 3 ++- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/data/presets.yaml b/data/presets.yaml index 9eaddc314..3300bc040 100644 --- a/data/presets.yaml +++ b/data/presets.yaml @@ -412,7 +412,7 @@ en: # cycle_network=* label: Network cycleway: - # 'cycleway:left=*, cycleway:right=*' + # 'cycleway=*, cycleway:left=*, cycleway:right=*' label: Bike Lanes options: # lane=yes diff --git a/data/presets/fields.json b/data/presets/fields.json index 106bcf550..89362966f 100644 --- a/data/presets/fields.json +++ b/data/presets/fields.json @@ -75,7 +75,7 @@ "currency_multi": {"key": "currency:", "type": "multiCombo", "label": "Currency Types"}, "cutting": {"key": "cutting", "type": "typeCombo", "label": "Type", "placeholder": "Default"}, "cycle_network": {"key": "cycle_network", "type": "networkCombo", "label": "Network"}, - "cycleway": {"keys": ["cycleway:left", "cycleway:right"], "reference": {"key": "cycleway"}, "type": "cycleway", "label": "Bike Lanes", "placeholder": "none", "strings": {"types": {"cycleway:left": "Left side", "cycleway:right": "Right side"}, "options": {"none": {"title": "None", "description": "No bike lane"}, "lane": {"title": "Standard bike lane", "description": "A bike lane separated from auto traffic by a painted line"}, "shared_lane": {"title": "Shared bike lane", "description": "A bike lane with no separation from auto traffic"}, "track": {"title": "Bike track", "description": "A bike lane separated from traffic by a physical barrier"}, "share_busway": {"title": "Bike lane shared with bus", "description": "A bike lane shared with a bus lane"}, "opposite_lane": {"title": "Opposite bike lane", "description": "A bike lane that travels in the opposite direction of traffic"}, "opposite": {"title": "Contraflow bike lane", "description": "A bike lane that travels in both directions on a one-way street"}}}}, + "cycleway": {"keys": ["cycleway", "cycleway:left", "cycleway:right"], "reference": {"key": "cycleway"}, "type": "cycleway", "label": "Bike Lanes", "placeholder": "none", "strings": {"types": {"cycleway:left": "Left side", "cycleway:right": "Right side"}, "options": {"none": {"title": "None", "description": "No bike lane"}, "lane": {"title": "Standard bike lane", "description": "A bike lane separated from auto traffic by a painted line"}, "shared_lane": {"title": "Shared bike lane", "description": "A bike lane with no separation from auto traffic"}, "track": {"title": "Bike track", "description": "A bike lane separated from traffic by a physical barrier"}, "share_busway": {"title": "Bike lane shared with bus", "description": "A bike lane shared with a bus lane"}, "opposite_lane": {"title": "Opposite bike lane", "description": "A bike lane that travels in the opposite direction of traffic"}, "opposite": {"title": "Contraflow bike lane", "description": "A bike lane that travels in both directions on a one-way street"}}}}, "dance/style": {"key": "dance:style", "type": "semiCombo", "label": "Dance Styles"}, "date": {"key": "date", "type": "check", "label": "Date"}, "delivery": {"key": "delivery", "type": "check", "label": "Delivery"}, diff --git a/data/presets/fields/cycleway.json b/data/presets/fields/cycleway.json index e011b0566..07a687a90 100644 --- a/data/presets/fields/cycleway.json +++ b/data/presets/fields/cycleway.json @@ -1,5 +1,5 @@ { - "keys": ["cycleway:left", "cycleway:right"], + "keys": ["cycleway", "cycleway:left", "cycleway:right"], "reference": {"key": "cycleway"}, "type": "cycleway", "label": "Bike Lanes", diff --git a/data/taginfo.json b/data/taginfo.json index d68b660e3..c059765a7 100644 --- a/data/taginfo.json +++ b/data/taginfo.json @@ -1153,6 +1153,13 @@ {"key": "currency:", "description": "🄵 Currency Types"}, {"key": "cutting", "description": "🄵 Type, 🄵 Structure"}, {"key": "cycle_network", "description": "🄵 Network"}, + {"key": "cycleway", "value": "none", "description": "🄵 Bike Lanes"}, + {"key": "cycleway", "value": "lane", "description": "🄵 Bike Lanes"}, + {"key": "cycleway", "value": "shared_lane", "description": "🄵 Bike Lanes"}, + {"key": "cycleway", "value": "track", "description": "🄵 Bike Lanes"}, + {"key": "cycleway", "value": "share_busway", "description": "🄵 Bike Lanes"}, + {"key": "cycleway", "value": "opposite_lane", "description": "🄵 Bike Lanes"}, + {"key": "cycleway", "value": "opposite", "description": "🄵 Bike Lanes"}, {"key": "cycleway:left", "value": "none", "description": "🄵 Bike Lanes"}, {"key": "cycleway:left", "value": "lane", "description": "🄵 Bike Lanes"}, {"key": "cycleway:left", "value": "shared_lane", "description": "🄵 Bike Lanes"}, diff --git a/modules/ui/fields/cycleway.js b/modules/ui/fields/cycleway.js index db10edfca..da596784b 100644 --- a/modules/ui/fields/cycleway.js +++ b/modules/ui/fields/cycleway.js @@ -34,9 +34,10 @@ export function uiFieldCycleway(field, context) { .attr('class', 'labeled-inputs') .merge(div); + var keys = ['cycleway:left', 'cycleway:right']; items = div.selectAll('li') - .data(field.keys); + .data(keys); var enter = items.enter() .append('li')