From 38d2ccd8660a7975c65261dd6cd4add100fa60e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=E2=84=93e=20Hensel?= Date: Tue, 4 Mar 2025 21:29:29 +1100 Subject: [PATCH] `isHighwayIntersection` only applies to nodes, so remove from osmEntity (#10831) --- modules/osm/entity.js | 4 ---- modules/ui/inspector.js | 2 +- modules/ui/sections/preset_fields.js | 2 +- test/spec/osm/entity.js | 6 ------ 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/modules/osm/entity.js b/modules/osm/entity.js index e33b0a552..9b4c4575c 100644 --- a/modules/osm/entity.js +++ b/modules/osm/entity.js @@ -182,10 +182,6 @@ osmEntity.prototype = { return Object.keys(this.tags).some(osmIsInterestingTag); }, - isHighwayIntersection: function() { - return false; - }, - isDegenerate: function() { return true; }, diff --git a/modules/ui/inspector.js b/modules/ui/inspector.js index d8a590a1b..d61d9c6b8 100644 --- a/modules/ui/inspector.js +++ b/modules/ui/inspector.js @@ -77,7 +77,7 @@ export function uiInspector(context) { if (context.validator().getEntityIssues(entityID).length) return false; // show turn restriction editor for junction vertices - if (entity.isHighwayIntersection(context.graph())) return false; + if (entity.type === 'node' && entity.isHighwayIntersection(context.graph())) return false; // otherwise show preset list for uninteresting vertices return true; diff --git a/modules/ui/sections/preset_fields.js b/modules/ui/sections/preset_fields.js index 4b11edbc4..3cb86d6df 100644 --- a/modules/ui/sections/preset_fields.js +++ b/modules/ui/sections/preset_fields.js @@ -78,7 +78,7 @@ export function uiSectionPresetFields(context) { }); var singularEntity = _entityIDs.length === 1 && graph.hasEntity(_entityIDs[0]); - if (singularEntity && singularEntity.isHighwayIntersection(graph) && presetsManager.field('restrictions')) { + if (singularEntity && singularEntity.type === 'node' && singularEntity.isHighwayIntersection(graph) && presetsManager.field('restrictions')) { _fieldsArr.push( uiField(context, presetsManager.field('restrictions'), _entityIDs) ); diff --git a/test/spec/osm/entity.js b/test/spec/osm/entity.js index 95f440c9a..878815a72 100644 --- a/test/spec/osm/entity.js +++ b/test/spec/osm/entity.js @@ -298,12 +298,6 @@ describe('iD.osmEntity', function () { }); }); - describe('#isHighwayIntersection', function () { - it('returns false', function () { - expect(iD.osmEntity().isHighwayIntersection()).to.be.false; - }); - }); - describe('#isDegenerate', function () { it('returns true', function () { expect(iD.osmEntity().isDegenerate()).to.be.true;