mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-08 11:14:49 +02:00
introduce allowlist for disconnectable relation types
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 ||
|
||||
|
||||
Reference in New Issue
Block a user