diff --git a/data/presets/README.md b/data/presets/README.md index f30da8f2b..13c9c6875 100644 --- a/data/presets/README.md +++ b/data/presets/README.md @@ -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. diff --git a/data/presets/fields.json b/data/presets/fields.json index 2e28d0f60..e6a0472e2 100644 --- a/data/presets/fields.json +++ b/data/presets/fields.json @@ -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"}, diff --git a/data/presets/fields/bridge.json b/data/presets/fields/bridge.json index bf0e98a04..d15fa0af7 100644 --- a/data/presets/fields/bridge.json +++ b/data/presets/fields/bridge.json @@ -2,5 +2,6 @@ "key": "bridge", "type": "typeCombo", "label": "Type", + "usage": "group", "placeholder": "Default" } diff --git a/data/presets/fields/comment.json b/data/presets/fields/comment.json index 71072e1d4..88459f413 100644 --- a/data/presets/fields/comment.json +++ b/data/presets/fields/comment.json @@ -2,5 +2,6 @@ "key": "comment", "type": "textarea", "label": "Changeset Comment", + "usage": "changeset", "placeholder": "Brief description of your contributions (required)" } diff --git a/data/presets/fields/cutting.json b/data/presets/fields/cutting.json index 72314c8ff..4d99849b9 100644 --- a/data/presets/fields/cutting.json +++ b/data/presets/fields/cutting.json @@ -2,5 +2,6 @@ "key": "cutting", "type": "typeCombo", "label": "Type", + "usage": "group", "placeholder": "Default" } diff --git a/data/presets/fields/embankment.json b/data/presets/fields/embankment.json index a9818c5ba..267712797 100644 --- a/data/presets/fields/embankment.json +++ b/data/presets/fields/embankment.json @@ -2,5 +2,6 @@ "key": "embankment", "type": "typeCombo", "label": "Type", + "usage": "group", "placeholder": "Default" } diff --git a/data/presets/fields/ford.json b/data/presets/fields/ford.json index 3755f5925..149acfffa 100644 --- a/data/presets/fields/ford.json +++ b/data/presets/fields/ford.json @@ -2,5 +2,6 @@ "key": "ford", "type": "typeCombo", "label": "Type", + "usage": "group", "placeholder": "Default" } diff --git a/data/presets/fields/hashtags.json b/data/presets/fields/hashtags.json index d3045507c..c096ae8b7 100644 --- a/data/presets/fields/hashtags.json +++ b/data/presets/fields/hashtags.json @@ -2,5 +2,6 @@ "key": "hashtags", "type": "semiCombo", "label": "Hashtags", + "usage": "changeset", "placeholder": "#example" } diff --git a/data/presets/fields/restrictions.json b/data/presets/fields/restrictions.json index f63255335..1b5f8871a 100644 --- a/data/presets/fields/restrictions.json +++ b/data/presets/fields/restrictions.json @@ -2,6 +2,7 @@ "type": "restrictions", "geometry": ["vertex"], "icon": "iD-restrictions", + "usage": "manual", "reference": { "rtype": "restriction" }, diff --git a/data/presets/fields/tunnel.json b/data/presets/fields/tunnel.json index e349219b4..d626d60c0 100644 --- a/data/presets/fields/tunnel.json +++ b/data/presets/fields/tunnel.json @@ -2,5 +2,6 @@ "key": "tunnel", "type": "typeCombo", "label": "Type", + "usage": "group", "placeholder": "Default" } diff --git a/data/presets/schema/field.json b/data/presets/schema/field.json index ae62e0753..243a42168 100644 --- a/data/presets/schema/field.json +++ b/data/presets/schema/field.json @@ -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