From fedad280b4fa0bcf6e95286e76d2efea24ea5093 Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Tue, 29 Jan 2019 14:30:42 -0500 Subject: [PATCH] Use different messages for crossing tunnels and bridges if they are connectable --- data/core.yaml | 4 ++++ dist/locales/en.json | 6 ++++++ modules/validations/crossing_ways.js | 11 ++++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/data/core.yaml b/data/core.yaml index 713908a55..05ba64a00 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -1192,8 +1192,12 @@ en: tip: Crossing waterways should be connected or use tunnels. tunnel-tunnel: tip: Crossing tunnels should use different layers. + tunnel-tunnel_connectable: + tip: Crossing tunnels should be connected or use different layers. bridge-bridge: tip: Crossing bridges should use different layers. + bridge-bridge_connectable: + tip: Crossing bridges should be connected or use different layers. highway_almost_junction: message: "{highway} is very close but not connected to {highway2}." tip: Intersecting highways should share a junction vertex. diff --git a/dist/locales/en.json b/dist/locales/en.json index 1cf509a98..bb1a2c171 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -1454,8 +1454,14 @@ "tunnel-tunnel": { "tip": "Crossing tunnels should use different layers." }, + "tunnel-tunnel_connectable": { + "tip": "Crossing tunnels should be connected or use different layers." + }, "bridge-bridge": { "tip": "Crossing bridges should use different layers." + }, + "bridge-bridge_connectable": { + "tip": "Crossing bridges should be connected or use different layers." } }, "highway_almost_junction": { diff --git a/modules/validations/crossing_ways.js b/modules/validations/crossing_ways.js index c75d0944f..885a6d3ef 100644 --- a/modules/validations/crossing_ways.js +++ b/modules/validations/crossing_ways.js @@ -283,12 +283,21 @@ export function validationHighwayCrossingOtherWays(context) { entities = _map(entities, function(way) { return getFeatureWithFeatureTypeTagsForWay(way, graph); }); + + var canConnect = canConnectEntities(entities[0], entities[1]); + var crossingTypeID; if (hasTag(entities[0].tags, 'tunnel') && hasTag(entities[1].tags, 'tunnel')) { crossingTypeID = 'tunnel-tunnel'; + if (canConnect) { + crossingTypeID += '_connectable'; + } } else if (hasTag(entities[0].tags, 'bridge') && hasTag(entities[1].tags, 'bridge')) { crossingTypeID = 'bridge-bridge'; + if (canConnect) { + crossingTypeID += '_connectable'; + } } else { crossingTypeID = crossing.featureTypes.sort().join('-'); @@ -300,7 +309,7 @@ export function validationHighwayCrossingOtherWays(context) { }; var fixes = []; - if (canConnectEntities(entities[0], entities[1])) { + if (canConnect) { fixes.push(new validationIssueFix({ title: t('issues.fix.add_connection_vertex.title'), onClick: function() {