From d01112372be1b83920466924a238347d627ab042 Mon Sep 17 00:00:00 2001 From: Kyle Hensel Date: Sun, 6 Aug 2023 15:07:26 +1200 Subject: [PATCH] don't suggest discardable tags in the raw tag editor --- modules/ui/sections/raw_tag_editor.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/ui/sections/raw_tag_editor.js b/modules/ui/sections/raw_tag_editor.js index 9220b81a2..43bd043d5 100644 --- a/modules/ui/sections/raw_tag_editor.js +++ b/modules/ui/sections/raw_tag_editor.js @@ -12,6 +12,7 @@ import { utilArrayDifference, utilArrayIdentical } from '../../util/array'; import { utilGetSetValue, utilNoAuto, utilRebind, utilTagDiff } from '../../util'; import { uiTooltip } from '..'; import { allowUpperCaseTagValues } from '../../osm/tags'; +import { fileFetcher } from '../../core'; export function uiSectionRawTagEditor(id, context) { @@ -32,6 +33,11 @@ export function uiSectionRawTagEditor(id, context) { { id: 'text', icon: '#fas-i-cursor' } ]; + let _discardTags = {}; + fileFetcher.get('discarded') + .then((d) => { _discardTags = d; }) + .catch(() => { /* ignore */ }); + var _tagView = (prefs('raw-tag-editor-view') || 'list'); // 'list, 'text' var _readOnlyTags = []; // the keys in the order we want them to display @@ -424,6 +430,7 @@ export function uiSectionRawTagEditor(id, context) { if (!err) { const filtered = data .filter(d => _tags[d.value] === undefined) + .filter(d => !(d.value in _discardTags)) // do not suggest discardable tags (see #9817) .filter(d => d.value.toLowerCase().includes(value.toLowerCase())); callback(sort(value, filtered)); }