mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-22 08:17:30 +02:00
don't suggest discardable tags in the raw tag editor
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user