From 8d711981bf85677edd6ed5157e666c1b5246a5e2 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Sun, 12 Aug 2018 11:23:38 -0400 Subject: [PATCH] Change `stars` from integer field to combo, support capital 'S' (closes #5216) --- data/presets/fields.json | 2 +- data/presets/fields/stars.json | 3 +-- modules/services/taginfo.js | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/data/presets/fields.json b/data/presets/fields.json index 0a8b93d1f..ebfc9ddb1 100644 --- a/data/presets/fields.json +++ b/data/presets/fields.json @@ -252,7 +252,7 @@ "sport_racing_motor": {"key": "sport", "type": "semiCombo", "label": "Sports", "options": ["motor", "karting", "motocross"]}, "sport_racing_nonmotor": {"key": "sport", "type": "semiCombo", "label": "Sports", "options": ["bmx", "cycling", "dog_racing", "horse_racing", "running"]}, "sport": {"key": "sport", "type": "semiCombo", "label": "Sports"}, - "stars": {"key": "stars", "type": "number", "minValue": 0, "label": "Stars"}, + "stars": {"key": "stars", "type": "combo", "label": "Stars"}, "start_date": {"key": "start_date", "type": "text", "universal": true, "label": "Start Date"}, "step_count": {"key": "step_count", "type": "number", "minValue": 0, "label": "Number of Steps"}, "stop": {"key": "stop", "type": "combo", "label": "Stop Type", "strings": {"options": {"all": "All Ways", "minor": "Minor Road"}}}, diff --git a/data/presets/fields/stars.json b/data/presets/fields/stars.json index 2e38d232d..237dee393 100644 --- a/data/presets/fields/stars.json +++ b/data/presets/fields/stars.json @@ -1,6 +1,5 @@ { "key": "stars", - "type": "number", - "minValue": 0, + "type": "combo", "label": "Stars" } diff --git a/modules/services/taginfo.js b/modules/services/taginfo.js index 88c0c6c5b..594cd54a5 100644 --- a/modules/services/taginfo.js +++ b/modules/services/taginfo.js @@ -264,7 +264,7 @@ export default { // A few OSM keys expect values to contain uppercase values (see #3377). // This is not an exhaustive list (e.g. `name` also has uppercase values) // but these are the fields where taginfo value lookup is most useful. - var re = /network|taxon|genus|species|brand|grape_variety|royal_cypher|booth|rating|:output|_hours|_times/; + var re = /network|taxon|genus|species|brand|grape_variety|royal_cypher|booth|rating|stars|:output|_hours|_times/; var allowUpperCase = (params.key.match(re) !== null); var f = filterValues(allowUpperCase);