From b2569e255440d3b4474c43b59b4cf206081e5478 Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Fri, 2 Nov 2018 19:41:03 -0700 Subject: [PATCH 1/9] Use the green stroke color to render barrier=hedge --- css/25_areas.css | 1 + css/50_misc.css | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/css/25_areas.css b/css/25_areas.css index 2805d5e0b..3cd56114c 100644 --- a/css/25_areas.css +++ b/css/25_areas.css @@ -23,6 +23,7 @@ path.stroke.old-multipolygon { /* Green things */ path.stroke.tag-landuse, +path.stroke.tag-barrier-hedge, path.stroke.tag-natural, path.stroke.tag-leisure-nature_reserve, path.stroke.tag-leisure-pitch, diff --git a/css/50_misc.css b/css/50_misc.css index 7fefafc97..14629185e 100644 --- a/css/50_misc.css +++ b/css/50_misc.css @@ -72,8 +72,10 @@ path.stroke.tag-natural-tree_row { /* barriers */ -path.stroke.tag-barrier { +path.stroke.tag-barrier:not(.tag-barrier-hedge) { stroke: #ddd; +} +path.stroke.tag-barrier { stroke-width: 3px; stroke-linecap: round; stroke-dasharray: 15, 5, 1, 5; From edca5f2d2313709de3151a2a97a9b101c283e024 Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Fri, 2 Nov 2018 19:54:12 -0700 Subject: [PATCH 2/9] Fixes placement of .tag-barrier-hedge css line --- css/25_areas.css | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/css/25_areas.css b/css/25_areas.css index 3cd56114c..f5fd3cd90 100644 --- a/css/25_areas.css +++ b/css/25_areas.css @@ -23,11 +23,11 @@ path.stroke.old-multipolygon { /* Green things */ path.stroke.tag-landuse, -path.stroke.tag-barrier-hedge, path.stroke.tag-natural, path.stroke.tag-leisure-nature_reserve, path.stroke.tag-leisure-pitch, -path.stroke.tag-leisure-park { +path.stroke.tag-leisure-park, +path.stroke.tag-barrier-hedge { stroke: rgb(140, 208, 95); } path.fill.tag-landuse, @@ -275,4 +275,3 @@ path.fill.tag-natural-glacier { border-color: rgb(170, 170, 170); background: rgba(170, 170, 170, 0.3); } - From 94bbcc9fcf4d9fb197d8d3dd24482403c1edc3c9 Mon Sep 17 00:00:00 2001 From: Mateusz Konieczny Date: Sat, 3 Nov 2018 14:15:01 +0100 Subject: [PATCH 3/9] update imagery apparently running tests updates this file --- dist/locales/en.json | 49 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/dist/locales/en.json b/dist/locales/en.json index b67bbe8be..bf5a470ff 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -7441,11 +7441,33 @@ "description": "Japan GSI Standard Map. Widely covered.", "name": "Japan GSI Standard Map" }, - "hike_n_bike": { + "helsingborg-orto": { "attribution": { - "text": "© OpenStreetMap contributors" + "text": "© Helsingborg municipality" }, - "name": "Hike & Bike" + "description": "Orthophotos from the municipality of Helsingborg 2016, public domain", + "name": "Helsingborg Orthophoto" + }, + "kalmar-orto-2014": { + "attribution": { + "text": "© Kalmar municipality" + }, + "description": "Orthophotos for the north coast of the municipality of Kalmar 2014", + "name": "Kalmar North Orthophoto 2014" + }, + "kalmar-orto-2016": { + "attribution": { + "text": "© Kalmar municipality" + }, + "description": "Orthophotos for the south coast of the municipality of Kalmar 2016", + "name": "Kalmar South Orthophoto 2016" + }, + "kalmar-orto-2018": { + "attribution": { + "text": "© Kalmar municipality" + }, + "description": "Orthophotos for urban areas of the municipality of Kalmar 2018", + "name": "Kalmar Urban Orthophoto 2018" }, "kelkkareitit": { "attribution": { @@ -7468,6 +7490,20 @@ "description": "Mosaic of Swedish orthophotos from the period 1970–1980. Is under construction.", "name": "Lantmäteriet Historic Orthophoto 1975" }, + "lantmateriet-topowebb": { + "attribution": { + "text": "© Lantmäteriet, CC0" + }, + "description": "Topographic map of Sweden 1:50 000", + "name": "Lantmäteriet Topographic Map" + }, + "linkoping-orto": { + "attribution": { + "text": "© Linköping municipality" + }, + "description": "Orthophotos from the municipality of Linköping 2010, open data", + "name": "Linköping Orthophoto" + }, "mapbox_locator_overlay": { "attribution": { "text": "Terms & Feedback" @@ -7532,6 +7568,13 @@ }, "name": "Stamen Terrain" }, + "stockholm-orto": { + "attribution": { + "text": "© Stockholm municipality, CC0" + }, + "description": "Orthophotos from the municipality of Stockholm 2015, CC0 license", + "name": "Stockholm Orthophoto" + }, "tf-cycle": { "attribution": { "text": "Maps © Thunderforest, Data © OpenStreetMap contributors" From bb054211c0e1f5044c7a96799217948872547d55 Mon Sep 17 00:00:00 2001 From: Mateusz Konieczny Date: Sat, 3 Nov 2018 14:26:52 +0100 Subject: [PATCH 4/9] fix missing negation is specs --- test/spec/services/taginfo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/spec/services/taginfo.js b/test/spec/services/taginfo.js index 7db16fb27..146e748ad 100644 --- a/test/spec/services/taginfo.js +++ b/test/spec/services/taginfo.js @@ -206,7 +206,7 @@ describe('iD.serviceTaginfo', function() { ); }); - it('does not get values for extremely popular keys', function() { + it('does not get values for extremely unpopular keys', function() { var callback = sinon.spy(); taginfo.values({key: 'name', query: 'ste'}, callback); From f4a64c27a450fdd8826225eadca4982c1b116dbd Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Sun, 4 Nov 2018 11:55:29 -0800 Subject: [PATCH 5/9] Keeps the raw tag editor buttons fixed-width using flexbox --- css/80_app.css | 30 ++++++++---------------------- modules/ui/raw_tag_editor.js | 16 ++++++++++------ 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/css/80_app.css b/css/80_app.css index 5888cd007..e1813d0d4 100644 --- a/css/80_app.css +++ b/css/80_app.css @@ -413,11 +413,7 @@ button.active { } button.minor { - position: absolute; - top: 0; - right: 0; height: 100%; - width: 10%; border-radius: 0; background-color: #fafafa; } @@ -2210,7 +2206,11 @@ div.combobox { .tag-row { width: 100%; position: relative; - clear: both; +} +.tag-row .inner-wrap { + width: 100%; + position: relative; + display: flex; } .tag-row.readonly, @@ -2236,14 +2236,9 @@ div.combobox { .tag-row .key-wrap, .tag-row .input-wrap-position { - width: 40%; - float: left; + flex: 1 0.5 100%; height: 30px; } -[dir='rtl'] .tag-row .key-wrap, -[dir='rtl'] .tag-row .input-wrap-position { - float: right; -} .tag-row input.key { font-weight: bold; @@ -2271,15 +2266,13 @@ div.combobox { } .tag-row button { - position: absolute; height: 31px; - right: 10%; + flex: 0 0 33px; border: 1px solid #ccc; border-top-width: 0; border-left-width: 0; } [dir='rtl'] .tag-row button { - left: 10%; border-left-width: 1px; border-right-width: 0; } @@ -2313,16 +2306,10 @@ div.combobox { } .tag-row .tag-reference-button { - right: 0; border-radius: 0; - width: 10%; - top: 0; background: #fafafa; } [dir='rtl'] .tag-row .tag-reference-button { - left: auto; - right: auto; - margin-right: 35px; border-left-width: 1px; border-right-width: 0; } @@ -2378,7 +2365,6 @@ button.minor.tag-reference-loading { } .raw-tag-editor .tag-reference-body { - float: left; width: 100%; } @@ -2387,7 +2373,7 @@ button.minor.tag-reference-loading { color: #333; } -.raw-tag-editor .tag-row:not(:last-child) .tag-reference-body { +.raw-tag-editor .tag-row:not(:last-child) .tag-reference-body.expanded { border-bottom: 1px solid #ccc; } diff --git a/modules/ui/raw_tag_editor.js b/modules/ui/raw_tag_editor.js index d5a4fb23a..37952b995 100644 --- a/modules/ui/raw_tag_editor.js +++ b/modules/ui/raw_tag_editor.js @@ -106,7 +106,10 @@ export function uiRawTagEditor(context) { .attr('class', 'tag-row cf') .classed('readonly', isReadOnly); - enter + var innerWrap = enter.append('div') + .attr('class', 'inner-wrap') + + innerWrap .append('div') .attr('class', 'key-wrap') .append('input') @@ -117,7 +120,7 @@ export function uiRawTagEditor(context) { .on('blur', keyChange) .on('change', keyChange); - enter + innerWrap .append('div') .attr('class', 'input-wrap-position') .append('input') @@ -129,7 +132,7 @@ export function uiRawTagEditor(context) { .on('change', valueChange) .on('keydown.push-more', pushMore); - enter + innerWrap .append('button') .attr('tabindex', -1) .attr('class', 'remove minor') @@ -169,9 +172,10 @@ export function uiRawTagEditor(context) { reference.showing(false); } - row - .call(reference.button) - .call(reference.body); + row.select('.inner-wrap') + .call(reference.button); + + row.call(reference.body); }); items.selectAll('input.key') From 1db80ff49c3df3964e779b37bdb0636e3dec2031 Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Sun, 4 Nov 2018 12:06:32 -0800 Subject: [PATCH 6/9] Adds missing semicolon --- modules/ui/raw_tag_editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ui/raw_tag_editor.js b/modules/ui/raw_tag_editor.js index 37952b995..5e67edad4 100644 --- a/modules/ui/raw_tag_editor.js +++ b/modules/ui/raw_tag_editor.js @@ -107,7 +107,7 @@ export function uiRawTagEditor(context) { .classed('readonly', isReadOnly); var innerWrap = enter.append('div') - .attr('class', 'inner-wrap') + .attr('class', 'inner-wrap'); innerWrap .append('div') From 3ff1139364e952ee406a6e6cfa90fd0623413812 Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Sun, 4 Nov 2018 12:40:59 -0800 Subject: [PATCH 7/9] Fixes an error where preventDefault would be called on an event object without that function --- modules/ui/sidebar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ui/sidebar.js b/modules/ui/sidebar.js index da5028682..721baa37e 100644 --- a/modules/ui/sidebar.js +++ b/modules/ui/sidebar.js @@ -197,7 +197,7 @@ export function uiSidebar(context) { sidebar.toggleCollapse = function(shouldCollapse) { - if (d3_event) { + if (d3_event && typeof d3_event.preventDefault == 'function') { d3_event.preventDefault(); } From 5a2444ed40a547ee28fe88db946c82d7e72bb4f8 Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Sun, 4 Nov 2018 12:42:04 -0800 Subject: [PATCH 8/9] Converts == to === in the prior commit --- modules/ui/sidebar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ui/sidebar.js b/modules/ui/sidebar.js index 721baa37e..a94004f17 100644 --- a/modules/ui/sidebar.js +++ b/modules/ui/sidebar.js @@ -197,7 +197,7 @@ export function uiSidebar(context) { sidebar.toggleCollapse = function(shouldCollapse) { - if (d3_event && typeof d3_event.preventDefault == 'function') { + if (d3_event && typeof d3_event.preventDefault === 'function') { d3_event.preventDefault(); } From 50d0b98be85ada87c71f342d39e147421cf82ce6 Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Mon, 5 Nov 2018 17:50:15 -0800 Subject: [PATCH 9/9] Adds undo messages for connecting points to points, vertices, lines, and areas; and vertices to sibling and adjacent vertices Closes #1252 --- data/core.yaml | 16 ++++++++++++---- dist/locales/en.json | 18 ++++++++++++++---- modules/modes/drag_node.js | 24 ++++++++++++++++++++---- 3 files changed, 46 insertions(+), 12 deletions(-) diff --git a/data/core.yaml b/data/core.yaml index 045db6496..47324ad14 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -118,10 +118,18 @@ en: annotation: Removed a member from a relation. connect: annotation: - point: Connected a way to a point. - vertex: Connected a way to another. - line: Connected a way to a line. - area: Connected a way to an area. + from_vertex: + to_point: Connected a way to a point. + to_vertex: Connected a way to another. + to_line: Connected a way to a line. + to_area: Connected a way to an area. + to_adjacent_vertex: Merged adjacent points in a way. + to_sibling_vertex: Connected a way to itself. + from_point: + to_point: Merged a point with another. + to_vertex: Merged a point with a point in a way. + to_line: Moved a point to a line. + to_area: Moved a point to an area. relation: These features can't be connected because they have conflicting relation roles. restriction: "These features can't be connected because it would damage a \"{relation}\" relation." disconnect: diff --git a/dist/locales/en.json b/dist/locales/en.json index bf5a470ff..3fb345339 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -154,10 +154,20 @@ }, "connect": { "annotation": { - "point": "Connected a way to a point.", - "vertex": "Connected a way to another.", - "line": "Connected a way to a line.", - "area": "Connected a way to an area." + "from_vertex": { + "to_point": "Connected a way to a point.", + "to_vertex": "Connected a way to another.", + "to_line": "Connected a way to a line.", + "to_area": "Connected a way to an area.", + "to_adjacent_vertex": "Merged adjacent points in a way.", + "to_sibling_vertex": "Connected a way to itself." + }, + "from_point": { + "to_point": "Merged a point with another.", + "to_vertex": "Merged a point with a point in a way.", + "to_line": "Moved a point to a line.", + "to_area": "Moved a point to an area." + } }, "relation": "These features can't be connected because they have conflicting relation roles.", "restriction": "These features can't be connected because it would damage a \"{relation}\" relation." diff --git a/modules/modes/drag_node.js b/modules/modes/drag_node.js index 0327ece06..518816881 100644 --- a/modules/modes/drag_node.js +++ b/modules/modes/drag_node.js @@ -1,4 +1,5 @@ import _find from 'lodash-es/find'; +import _intersection from 'lodash-es/intersection'; import { event as d3_event, @@ -75,8 +76,23 @@ export function modeDragNode(context) { } - function connectAnnotation(entity) { - return t('operations.connect.annotation.' + entity.geometry(context.graph())); + function connectAnnotation(nodeEntity, targetEntity) { + var nodeGeometry = nodeEntity.geometry(context.graph()); + var targetGeometry = targetEntity.geometry(context.graph()); + if (nodeGeometry === 'vertex' && targetGeometry === 'vertex') { + var nodeParentWayIDs = context.graph().parentWays(nodeEntity); + var targetParentWayIDs = context.graph().parentWays(targetEntity); + var sharedParentWays = _intersection(nodeParentWayIDs, targetParentWayIDs); + // if both vertices are part of the same way + if (sharedParentWays.length !== 0) { + // if the nodes are next to each other, they are merged + if (sharedParentWays[0].areAdjacent(nodeEntity.id, targetEntity.id)) { + return t('operations.connect.annotation.from_vertex.to_adjacent_vertex'); + } + return t('operations.connect.annotation.from_vertex.to_sibling_vertex'); + } + } + return t('operations.connect.annotation.from_' + nodeGeometry + '.to_' + targetGeometry); } @@ -359,13 +375,13 @@ export function modeDragNode(context) { loc: choice.loc, edge: [target.nodes[choice.index - 1], target.nodes[choice.index]] }, entity), - connectAnnotation(target) + connectAnnotation(entity, target) ); } else if (target && target.type === 'node') { context.replace( actionConnect([target.id, entity.id]), - connectAnnotation(target) + connectAnnotation(entity, target) ); } else if (_wasMidpoint) {