don't suggest discardable tags in the raw tag editor

This commit is contained in:
Kyle Hensel
2023-08-06 15:07:26 +12:00
parent 5a14edfe36
commit d01112372b
+7
View File
@@ -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));
}