From 8708c13f87a2750924b13d0e449ede0e808a54fa Mon Sep 17 00:00:00 2001 From: Quincy Morgan <2046746+quincylvania@users.noreply.github.com> Date: Thu, 3 Sep 2020 14:00:30 -0400 Subject: [PATCH] Followup changes to #7932 --- modules/presets/preset.js | 11 +---------- modules/ui/preset_list.js | 2 +- modules/ui/sections/feature_type.js | 5 ++--- modules/ui/tag_reference.js | 2 +- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/modules/presets/preset.js b/modules/presets/preset.js index d6370dbad..65fcef1f5 100644 --- a/modules/presets/preset.js +++ b/modules/presets/preset.js @@ -115,7 +115,7 @@ export function presetPreset(presetID, preset, addable, allFields, allPresets) { }; - _this.reference = (geom) => { + _this.reference = () => { // Lookup documentation on Wikidata... const qid = _this.tags.wikidata || _this.tags['brand:wikidata'] || _this.tags['operator:wikidata']; if (qid) { @@ -126,15 +126,6 @@ export function presetPreset(presetID, preset, addable, allFields, allPresets) { let key = _this.originalReference.key || Object.keys(utilObjectOmit(_this.tags, 'name'))[0]; let value = _this.originalReference.value || _this.tags[key]; - if (geom === 'relation' && key === 'type') { - if (value in _this.tags) { - key = value; - value = _this.tags[key]; - } else { - return { rtype: value }; - } - } - if (value === '*') { return { key: key }; } else { diff --git a/modules/ui/preset_list.js b/modules/ui/preset_list.js index fa4f3b396..790b7f59f 100644 --- a/modules/ui/preset_list.js +++ b/modules/ui/preset_list.js @@ -425,7 +425,7 @@ export function uiPresetList(context) { }; item.preset = preset; - item.reference = uiTagReference(preset.reference(entityGeometries()[0]), context); + item.reference = uiTagReference(preset.reference(), context); return item; } diff --git a/modules/ui/sections/feature_type.js b/modules/ui/sections/feature_type.js index 10ce49a09..50dc45892 100644 --- a/modules/ui/sections/feature_type.js +++ b/modules/ui/sections/feature_type.js @@ -125,9 +125,8 @@ export function uiSectionFeatureType(context) { if (!utilArrayIdentical(val, _presets)) { _presets = val; - var geometries = entityGeometries(); - if (_presets.length === 1 && geometries.length) { - _tagReference = uiTagReference(_presets[0].reference(geometries[0]), context) + if (_presets.length === 1) { + _tagReference = uiTagReference(_presets[0].reference(), context) .showing(false); } } diff --git a/modules/ui/tag_reference.js b/modules/ui/tag_reference.js index 123bff2b0..fafaeb70f 100644 --- a/modules/ui/tag_reference.js +++ b/modules/ui/tag_reference.js @@ -175,7 +175,7 @@ export function uiTagReference(what) { tagReference.body = function(selection) { - var itemID = what.qid || what.rtype || (what.key + '-' + what.value); + var itemID = what.qid || (what.key + '-' + (what.value || '')); _body = selection.selectAll('.tag-reference-body') .data([itemID], function(d) { return d; });