Skip to content

Commit

Permalink
Added fields for oneway:bicycle, destination, minspeed, and dog tags …
Browse files Browse the repository at this point in the history
…and added them to moreFields of appropriate presets

Reduced the maximum fields count before warning from 9 to 8
Updated some similar highway presets to use field inheritance
Added additional fields to moreFields of various highway presets
  • Loading branch information
quincylvania committed Jan 17, 2019
1 parent 39a4cc2 commit ecec397
Show file tree
Hide file tree
Showing 34 changed files with 174 additions and 106 deletions.
2 changes: 1 addition & 1 deletion build_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ function validateCategoryPresets(categories, presets) {
function validatePresetFields(presets, fields) {
var betweenBracketsRegex = /([^{]*?)(?=\})/;
var maxFieldsBeforeError = 12;
var maxFieldsBeforeWarning = 9;
var maxFieldsBeforeWarning = 8;
for (var presetID in presets) {
var preset = presets[presetID];
if (preset.fields) {
Expand Down
21 changes: 21 additions & 0 deletions data/presets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,9 @@ en:
design:
# design=*
label: Design
destination:
# destination=*
label: Destination
devices:
# devices=*
label: Devices
Expand Down Expand Up @@ -551,6 +554,16 @@ en:
dock:
# dock=*
label: Type
dog:
# dog=*
label: Dogs
options:
# dog=leashed
leashed: Leashed Only
# dog=no
'no': Not Allowed
# dog=yes
'yes': Allowed
drive_through:
# drive_through=*
label: Drive-Through
Expand Down Expand Up @@ -981,6 +994,11 @@ en:
memorial:
# memorial=*
label: Type
minspeed:
# minspeed=*
label: Minimum Speed Limit
# minspeed field placeholder
placeholder: '20, 30, 40...'
monitoring_multi:
# 'monitoring:=*'
label: Monitoring
Expand Down Expand Up @@ -1114,6 +1132,9 @@ en:
undefined: Assumed to be No
# oneway=yes
'yes': 'Yes'
oneway/bicycle:
# 'oneway:bicycle=*'
label: One Way (Bicycles)
oneway_yes:
# oneway=*
label: One Way
Expand Down
4 changes: 4 additions & 0 deletions data/presets/fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"denotation": {"key": "denotation", "type": "combo", "label": "Denotation"},
"description": {"key": "description", "type": "textarea", "label": "Description", "universal": true},
"design": {"key": "design", "type": "combo", "label": "Design"},
"destination": {"key": "destination", "type": "text", "label": "Destination"},
"devices": {"key": "devices", "type": "number", "minValue": 0, "label": "Devices", "placeholder": "1, 2, 3..."},
"diaper": {"key": "diaper", "type": "combo", "label": "Diaper Changing Available", "options": ["yes", "no", "room", "1", "2", "3", "4", "5"]},
"diet_multi": {"key": "diet:", "type": "multiCombo", "label": "Diet Types"},
Expand All @@ -94,6 +95,7 @@
"display": {"key": "display", "type": "combo", "label": "Display", "options": ["analog", "digital", "sundial", "unorthodox"]},
"distance": {"key": "distance", "type": "text", "label": "Distance"},
"dock": {"key": "dock", "type": "combo", "label": "Type"},
"dog": {"key": "dog", "type": "combo", "label": "Dogs", "strings": {"options": {"yes": "Allowed", "leashed": "Leashed Only", "no": "Not Allowed"}}},
"drive_through": {"key": "drive_through", "type": "check", "label": "Drive-Through"},
"duration": {"key": "duration", "type": "text", "label": "Duration", "placeholder": "00:00"},
"electrified": {"key": "electrified", "type": "combo", "label": "Electrification", "placeholder": "Contact Line, Electrified Rail...", "strings": {"options": {"contact_line": "Contact Line", "rail": "Electrified Rail", "yes": "Yes (unspecified)", "no": "No"}}},
Expand Down Expand Up @@ -188,6 +190,7 @@
"maxstay": {"key": "maxstay", "type": "combo", "label": "Max Stay", "options": ["15 min", "30 min", "45 min", "1 hr", "1.5 hr", "2 hr", "2.5 hr", "3 hr", "4 hr", "1 day", "2 day"], "snake_case": false},
"maxweight": {"key": "maxweight", "type": "combo", "label": "Max Weight", "snake_case": false},
"memorial": {"key": "memorial", "type": "typeCombo", "label": "Type"},
"minspeed": {"key": "minspeed", "type": "maxspeed", "label": "Minimum Speed Limit", "placeholder": "20, 30, 40..."},
"monitoring_multi": {"key": "monitoring:", "type": "multiCombo", "label": "Monitoring"},
"mtb/scale": {"key": "mtb:scale", "type": "combo", "label": "Mountain Biking Difficulty", "placeholder": "0, 1, 2, 3...", "strings": {"options": {"0": "0: Solid gravel/packed earth, no obstacles, wide curves", "1": "1: Some loose surface, small obstacles, wide curves", "2": "2: Much loose surface, large obstacles, easy hairpins", "3": "3: Slippery surface, large obstacles, tight hairpins", "4": "4: Loose surface or boulders, dangerous hairpins", "5": "5: Maximum difficulty, boulder fields, landslides", "6": "6: Not rideable except by the very best mountain bikers"}}},
"mtb/scale/imba": {"key": "mtb:scale:imba", "type": "combo", "label": "IMBA Trail Difficulty", "placeholder": "Easy, Medium, Difficult...", "strings": {"options": {"0": "Easiest (white circle)", "1": "Easy (green circle)", "2": "Medium (blue square)", "3": "Difficult (black diamond)", "4": "Extremely Difficult (double black diamond)"}}},
Expand All @@ -203,6 +206,7 @@
"office": {"key": "office", "type": "typeCombo", "label": "Type"},
"oneway_yes": {"key": "oneway", "type": "onewayCheck", "label": "One Way", "strings": {"options": {"undefined": "Assumed to be Yes", "yes": "Yes", "no": "No", "reversible": "Reversible", "alternating": "Alternating"}}},
"oneway": {"key": "oneway", "type": "onewayCheck", "label": "One Way", "strings": {"options": {"undefined": "Assumed to be No", "yes": "Yes", "no": "No", "reversible": "Reversible", "alternating": "Alternating"}}},
"oneway/bicycle": {"key": "oneway:bicycle", "type": "check", "label": "One Way (Bicycles)", "prerequisiteTag": {"key": "oneway"}},
"opening_date": {"key": "opening_date", "type": "text", "label": "Expected Opening Date"},
"opening_hours": {"key": "opening_hours", "type": "combo", "label": "Hours", "snake_case": false},
"operator": {"key": "operator", "type": "text", "label": "Operator"},
Expand Down
5 changes: 5 additions & 0 deletions data/presets/fields/destination.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"key": "destination",
"type": "text",
"label": "Destination"
}
12 changes: 12 additions & 0 deletions data/presets/fields/dog.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"key": "dog",
"type": "combo",
"label": "Dogs",
"strings": {
"options": {
"yes": "Allowed",
"leashed": "Leashed Only",
"no": "Not Allowed"
}
}
}
6 changes: 6 additions & 0 deletions data/presets/fields/minspeed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"key": "minspeed",
"type": "maxspeed",
"label": "Minimum Speed Limit",
"placeholder": "20, 30, 40..."
}
8 changes: 8 additions & 0 deletions data/presets/fields/oneway/bicycle.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"key": "oneway:bicycle",
"type": "check",
"label": "One Way (Bicycles)",
"prerequisiteTag": {
"key": "oneway"
}
}

0 comments on commit ecec397

Please sign in to comment.