Add usage field property to provide more info on how a field is used

This commit is contained in:
Quincy Morgan
2020-10-16 10:30:07 -04:00
parent ce936a4df2
commit 29b6ffd0d5
11 changed files with 30 additions and 8 deletions

View File

@@ -294,6 +294,15 @@ A string specifying the UI and behavior of the field. Must be one of the followi
* `wikidata` - Search field for selecting a Wikidata entity
* `wikipedia` - Block of fields for selecting a wiki language and Wikipedia page
##### `usage`
A string specifying how iD uses the field. Must be one of the following values.
* `preset` - The field is listed in one or more preset files (default and most common value)
* `changeset` - The field is only used for changeset tags when uploading, e.g. `comment`
* `group` - The field is only used within another field such as `structure`, e.g. `cutting`
* `manual` - The field is only added by iD programmatically as needed, e.g. `restrictions`
##### `key`/`keys`
The `key` property names the OSM key that the field will edit.

View File

@@ -53,7 +53,7 @@
"brand": {"key": "brand", "type": "text", "label": "Brand"},
"brewery": {"key": "brewery", "type": "semiCombo", "label": "Draft Beers", "terms": ["on tap"]},
"bridge_combo": {"key": "bridge", "type": "combo", "label": "Type"},
"bridge": {"key": "bridge", "type": "typeCombo", "label": "Type", "placeholder": "Default"},
"bridge": {"key": "bridge", "type": "typeCombo", "label": "Type", "usage": "group", "placeholder": "Default"},
"bridge/support": {"key": "bridge:support", "type": "typeCombo", "label": "Type"},
"building_area": {"key": "building", "type": "combo", "default": "yes", "geometry": ["area"], "label": "Building"},
"building": {"key": "building", "type": "combo", "label": "Building", "terms": ["structure"]},
@@ -82,7 +82,7 @@
"collection_times": {"key": "collection_times", "type": "text", "label": "Collection Times"},
"collector": {"key": "collector", "type": "semiCombo", "label": "Items"},
"colour": {"key": "colour", "type": "text", "label": "Color"},
"comment": {"key": "comment", "type": "textarea", "label": "Changeset Comment", "placeholder": "Brief description of your contributions (required)"},
"comment": {"key": "comment", "type": "textarea", "label": "Changeset Comment", "usage": "changeset", "placeholder": "Brief description of your contributions (required)"},
"communication_multi": {"key": "communication:", "type": "multiCombo", "label": "Communication Types"},
"connectivity": {"key": "connectivity", "type": "text", "label": "Connectivity"},
"construction": {"key": "construction", "type": "combo", "label": "Type"},
@@ -103,7 +103,7 @@
"crossing/island": {"key": "crossing:island", "type": "check", "label": "Refuge Island"},
"cuisine": {"key": "cuisine", "type": "semiCombo", "label": "Cuisines", "terms": ["fare", "food types"]},
"currency_multi": {"key": "currency:", "type": "multiCombo", "label": "Currency Types", "terms": ["bills", "cash", "coins", "money"]},
"cutting": {"key": "cutting", "type": "typeCombo", "label": "Type", "placeholder": "Default"},
"cutting": {"key": "cutting", "type": "typeCombo", "label": "Type", "usage": "group", "placeholder": "Default"},
"cycle_network": {"key": "cycle_network", "type": "networkCombo", "label": "Network"},
"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"},
@@ -153,7 +153,7 @@
"ele": {"key": "ele", "type": "number", "icon": "elevation", "label": "Elevation", "geometry": ["line", "area", "relation"], "terms": ["altitude", "height"]},
"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"}}, "terms": ["contact line", "powered", "third rail"]},
"email": {"key": "email", "type": "email", "placeholder": "example@example.com", "label": "Email"},
"embankment": {"key": "embankment", "type": "typeCombo", "label": "Type", "placeholder": "Default"},
"embankment": {"key": "embankment", "type": "typeCombo", "label": "Type", "usage": "group", "placeholder": "Default"},
"embassy": {"key": "embassy", "type": "combo", "label": "Type"},
"emergency_combo": {"key": "emergency", "type": "combo", "label": "Type"},
"emergency_ward_entrance": {"key": "emergency_ward_entrance", "type": "combo", "label": "Type"},
@@ -177,7 +177,7 @@
"flag/type": {"key": "flag:type", "type": "combo", "label": "Flag Type"},
"floating": {"key": "floating", "type": "check", "label": "Floating"},
"flood_prone": {"key": "flood_prone", "type": "check", "label": "Flood Prone"},
"ford": {"key": "ford", "type": "typeCombo", "label": "Type", "placeholder": "Default"},
"ford": {"key": "ford", "type": "typeCombo", "label": "Type", "usage": "group", "placeholder": "Default"},
"fountain": {"key": "fountain", "type": "combo", "label": "Type"},
"frequency_electrified": {"key": "frequency", "type": "combo", "label": "Operating Frequency", "prerequisiteTag": {"key": "electrified", "valueNot": "no"}},
"frequency": {"key": "frequency", "type": "combo", "label": "Operating Frequency"},
@@ -201,7 +201,7 @@
"guest_house": {"key": "guest_house", "type": "combo", "label": "Type"},
"handicap": {"key": "handicap", "type": "number", "label": "Handicap", "placeholder": "1-18"},
"handrail": {"key": "handrail", "type": "check", "label": "Handrail"},
"hashtags": {"key": "hashtags", "type": "semiCombo", "label": "Hashtags", "placeholder": "#example"},
"hashtags": {"key": "hashtags", "type": "semiCombo", "label": "Hashtags", "usage": "changeset", "placeholder": "#example"},
"healthcare": {"key": "healthcare", "type": "typeCombo", "label": "Type"},
"healthcare/speciality": {"key": "healthcare:speciality", "type": "semiCombo", "reference": {"key": "healthcare"}, "label": "Specialties"},
"height_building": {"key": "height", "minValue": 0, "type": "number", "label": "Building Height (Meters)", "prerequisiteTag": {"key": "building", "valueNot": "no"}},
@@ -377,7 +377,7 @@
"resort": {"key": "resort", "type": "combo", "label": "Type"},
"resource": {"key": "resource", "type": "semiCombo", "label": "Resources"},
"restriction": {"key": "restriction", "type": "combo", "label": "Type"},
"restrictions": {"type": "restrictions", "geometry": ["vertex"], "icon": "iD-restrictions", "reference": {"rtype": "restriction"}, "label": "Turn Restrictions"},
"restrictions": {"type": "restrictions", "geometry": ["vertex"], "icon": "iD-restrictions", "usage": "manual", "reference": {"rtype": "restriction"}, "label": "Turn Restrictions"},
"roof/colour": {"key": "roof:colour", "type": "combo", "label": "Roof Color"},
"room": {"key": "room", "type": "combo", "label": "Type"},
"rooms": {"key": "rooms", "type": "number", "minValue": 0, "label": "Rooms"},
@@ -483,7 +483,7 @@
"trench": {"key": "trench", "type": "combo", "label": "Type"},
"trolley_wire": {"key": "trolley_wire", "type": "check", "label": "Overhead Trolley Wires"},
"tunnel_combo": {"key": "tunnel", "type": "combo", "label": "Type"},
"tunnel": {"key": "tunnel", "type": "typeCombo", "label": "Type", "placeholder": "Default"},
"tunnel": {"key": "tunnel", "type": "typeCombo", "label": "Type", "usage": "group", "placeholder": "Default"},
"usage_rail": {"key": "usage", "type": "combo", "label": "Usage Type", "strings": {"options": {"main": "Main", "branch": "Branch", "industrial": "Industrial", "military": "Military", "test": "Test", "tourism": "Tourism"}}},
"utility_semi": {"key": "utility", "type": "semiCombo", "label": "Utilities"},
"utility": {"key": "utility", "type": "typeCombo", "label": "Utility"},

View File

@@ -2,5 +2,6 @@
"key": "bridge",
"type": "typeCombo",
"label": "Type",
"usage": "group",
"placeholder": "Default"
}

View File

@@ -2,5 +2,6 @@
"key": "comment",
"type": "textarea",
"label": "Changeset Comment",
"usage": "changeset",
"placeholder": "Brief description of your contributions (required)"
}

View File

@@ -2,5 +2,6 @@
"key": "cutting",
"type": "typeCombo",
"label": "Type",
"usage": "group",
"placeholder": "Default"
}

View File

@@ -2,5 +2,6 @@
"key": "embankment",
"type": "typeCombo",
"label": "Type",
"usage": "group",
"placeholder": "Default"
}

View File

@@ -2,5 +2,6 @@
"key": "ford",
"type": "typeCombo",
"label": "Type",
"usage": "group",
"placeholder": "Default"
}

View File

@@ -2,5 +2,6 @@
"key": "hashtags",
"type": "semiCombo",
"label": "Hashtags",
"usage": "changeset",
"placeholder": "#example"
}

View File

@@ -2,6 +2,7 @@
"type": "restrictions",
"geometry": ["vertex"],
"icon": "iD-restrictions",
"usage": "manual",
"reference": {
"rtype": "restriction"
},

View File

@@ -2,5 +2,6 @@
"key": "tunnel",
"type": "typeCombo",
"label": "Type",
"usage": "group",
"placeholder": "Default"
}

View File

@@ -222,6 +222,11 @@
"pattern": {
"description": "Regular expression that a valid `identifier` value is expected to match",
"type": "string"
},
"usage": {
"description": "The manner and context in which the field is used",
"type": "string",
"enum": ["preset", "changeset", "manual", "group"]
}
},
"additionalProperties": false