diff --git a/CHANGELOG.md b/CHANGELOG.md index f2a9a68a8..c6b764ecc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ _Breaking developer changes, which may affect downstream projects or sites that #### :camera: Street-Level * Rename OpenStreetCam overlay to KartaView ([#8807]) #### :white_check_mark: Validation +* Allow disconnecting members of certain "grouping" types of relation ([#8771]) * Clarify description of "disconnected way" validation rule ([#8800]) #### :bug: Bugfixes * Fix hidden tooltips on map control toolbar ([#8781]) @@ -60,6 +61,7 @@ _Breaking developer changes, which may affect downstream projects or sites that * Add colours for preset categories ([#8799]) #### :hammer: Development +[#8771]: https://github.com/openstreetmap/iD/issues/8771 [#8781]: https://github.com/openstreetmap/iD/issues/8781 [#8792]: https://github.com/openstreetmap/iD/pull/8792 [#8796]: https://github.com/openstreetmap/iD/issues/8796 diff --git a/modules/actions/disconnect.js b/modules/actions/disconnect.js index 1324cad03..02cdbb6f9 100644 --- a/modules/actions/disconnect.js +++ b/modules/actions/disconnect.js @@ -18,6 +18,11 @@ import { osmNode } from '../osm/node'; export function actionDisconnect(nodeId, newNodeId) { var wayIds; + var disconnectableRelationTypes = { + 'associatedStreet': true, + 'enforcement': true, + 'site': true, + }; var action = function(graph) { var node = graph.entity(nodeId); @@ -88,7 +93,9 @@ export function actionDisconnect(nodeId, newNodeId) { parentWays.forEach(function(way) { var relations = graph.parentRelations(way); - relations.forEach(function(relation) { + relations + .filter(relation => !disconnectableRelationTypes[relation.tags.type]) + .forEach(function(relation) { if (relation.id in seenRelationIds) { if (wayIds) { if (wayIds.indexOf(way.id) !== -1 ||