From 5fbaad1088bd93d6cee75f607ed02fbd4a0ed136 Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Wed, 24 Jun 2020 16:31:28 -0400 Subject: [PATCH] Make the waterway destination field separate from the road sign destination field (re: 7c5ec9be702852a279b8e19fc6ebda6c54fd2862) Make the destination field for the destination_sign preset a semiCombo (re: #6970) --- data/presets.yaml | 5 ++++- data/presets/fields.json | 3 ++- data/presets/fields/destination.json | 4 ++-- data/presets/fields/destination_waterway.json | 5 +++++ data/presets/presets.json | 2 +- data/presets/presets/type/waterway.json | 2 +- dist/locales/en.json | 5 ++++- modules/ui/fields/combo.js | 4 ++-- 8 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 data/presets/fields/destination_waterway.json diff --git a/data/presets.yaml b/data/presets.yaml index 404068570..1e966d0e6 100644 --- a/data/presets.yaml +++ b/data/presets.yaml @@ -666,7 +666,7 @@ en: label: Design destination: # destination=* - label: Destination + label: Destinations destination/ref: # 'destination:ref=*' label: Destination Road Numbers @@ -683,6 +683,9 @@ en: destination_oneway: # destination=* label: Destinations + destination_waterway: + # destination=* + label: Destination devices: # devices=* label: Devices diff --git a/data/presets/fields.json b/data/presets/fields.json index 76734db01..b7f47224e 100644 --- a/data/presets/fields.json +++ b/data/presets/fields.json @@ -116,7 +116,8 @@ "description": {"key": "description", "type": "textarea", "label": "Description", "universal": true, "terms": ["summary"]}, "design": {"key": "design", "type": "combo", "label": "Design"}, "destination_oneway": {"key": "destination", "type": "semiCombo", "label": "Destinations", "prerequisiteTag": {"key": "oneway", "value": "yes"}, "snake_case": false}, - "destination": {"key": "destination", "type": "text", "label": "Destination"}, + "destination_waterway": {"key": "destination", "type": "text", "label": "Destination"}, + "destination": {"key": "destination", "type": "semiCombo", "label": "Destinations"}, "destination/ref_oneway": {"key": "destination:ref", "type": "semiCombo", "label": "Destination Road Numbers", "prerequisiteTag": {"key": "oneway", "value": "yes"}, "snake_case": false}, "destination/ref": {"key": "destination:ref", "type": "semiCombo", "label": "Destination Road Numbers", "snake_case": false}, "destination/symbol_oneway": {"key": "destination:symbol", "type": "semiCombo", "label": "Destination Symbols", "prerequisiteTag": {"key": "oneway", "value": "yes"}}, diff --git a/data/presets/fields/destination.json b/data/presets/fields/destination.json index a4e1f8946..931bbc799 100644 --- a/data/presets/fields/destination.json +++ b/data/presets/fields/destination.json @@ -1,5 +1,5 @@ { "key": "destination", - "type": "text", - "label": "Destination" + "type": "semiCombo", + "label": "Destinations" } diff --git a/data/presets/fields/destination_waterway.json b/data/presets/fields/destination_waterway.json new file mode 100644 index 000000000..a4e1f8946 --- /dev/null +++ b/data/presets/fields/destination_waterway.json @@ -0,0 +1,5 @@ +{ + "key": "destination", + "type": "text", + "label": "Destination" +} diff --git a/data/presets/presets.json b/data/presets/presets.json index a4dbc0401..c9a95fb46 100644 --- a/data/presets/presets.json +++ b/data/presets/presets.json @@ -1312,7 +1312,7 @@ "type/route/tram": {"icon": "temaki-tram", "fields": ["{type/route/train}"], "moreFields": ["{type/route/train}"], "geometry": ["relation"], "tags": {"type": "route", "route": "tram"}, "name": "Tram Route"}, "type/route/trolleybus": {"icon": "temaki-trolleybus", "fields": ["{type/route/train}"], "moreFields": ["{type/route/train}"], "geometry": ["relation"], "tags": {"type": "route", "route": "trolleybus"}, "name": "Trolleybus Route"}, "type/site": {"icon": "iD-relation", "fields": ["name", "site"], "geometry": ["relation"], "tags": {"type": "site"}, "name": "Site"}, - "type/waterway": {"icon": "iD-waterway-stream", "fields": ["name", "waterway", "destination", "ref"], "geometry": ["relation"], "tags": {"type": "waterway"}, "name": "Waterway"}, + "type/waterway": {"icon": "iD-waterway-stream", "fields": ["name", "waterway", "destination_waterway", "ref"], "geometry": ["relation"], "tags": {"type": "waterway"}, "name": "Waterway"}, "waterway/riverbank": {"icon": "maki-water", "geometry": ["area"], "tags": {"waterway": "riverbank"}, "name": "Riverbank", "searchable": false}, "waterway/boatyard": {"icon": "temaki-boat", "fields": ["name", "operator"], "moreFields": ["address", "email", "fax", "gnis/feature_id", "phone", "website", "wheelchair"], "geometry": ["area", "vertex", "point"], "tags": {"waterway": "boatyard"}, "name": "Boatyard"}, "waterway/canal": {"icon": "iD-waterway-canal", "fields": ["name", "structure_waterway", "width", "intermittent", "lock"], "moreFields": ["fishing", "gnis/feature_id", "salt", "tidal"], "geometry": ["line"], "tags": {"waterway": "canal"}, "name": "Canal"}, diff --git a/data/presets/presets/type/waterway.json b/data/presets/presets/type/waterway.json index 9a27429f1..3ed752175 100644 --- a/data/presets/presets/type/waterway.json +++ b/data/presets/presets/type/waterway.json @@ -3,7 +3,7 @@ "fields": [ "name", "waterway", - "destination", + "destination_waterway", "ref" ], "geometry": [ diff --git a/dist/locales/en.json b/dist/locales/en.json index 963c1990a..1c95f4142 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -3290,9 +3290,12 @@ "destination_oneway": { "label": "Destinations" }, - "destination": { + "destination_waterway": { "label": "Destination" }, + "destination": { + "label": "Destinations" + }, "destination/ref_oneway": { "label": "Destination Road Numbers" }, diff --git a/modules/ui/fields/combo.js b/modules/ui/fields/combo.js index 04d6ca0d0..65f1fc398 100644 --- a/modules/ui/fields/combo.js +++ b/modules/ui/fields/combo.js @@ -351,7 +351,7 @@ export function uiFieldCombo(field, context) { // Use a separate line for each value in the Destinations field // to mimic highway exit signs - if (field.id === 'destination_oneway') { + if (field.key === 'destination') { listClass += ' full-line-chips'; } @@ -584,7 +584,7 @@ export function uiFieldCombo(field, context) { var targetIndexOffsetTop = null; var draggedTagWidth = d3_select(this).node().offsetWidth; - if (field.id === 'destination_oneway') { // meaning tags are full width + if (field.key === 'destination') { // meaning tags are full width container.selectAll('.chip') .style('transform', function(d2, index2) { var node = d3_select(this).node();