Fix validator suggesting to add empty *:wikipedia tags to NSI presets (fixes #10140)

This commit is contained in:
Martin Raifer
2024-02-29 10:30:18 +01:00
parent aa7adc88d5
commit 8274384311
3 changed files with 5 additions and 6 deletions
+2
View File
@@ -43,6 +43,7 @@ _Breaking developer changes, which may affect downstream projects or sites that
#### :camera: Street-Level
#### :white_check_mark: Validation
#### :bug: Bugfixes
* Fix false validation message, which was suggesting to add empty `*:wikipedia` tags to NSI presets ([#10140])
#### :earth_asia: Localization
* Add address format for New Zealand ([#10123], thanks [@k-yle])
#### :hourglass: Performance
@@ -51,6 +52,7 @@ _Breaking developer changes, which may affect downstream projects or sites that
#### :hammer: Development
[#10123]: https://github.com/openstreetmap/iD/pull/10123
[#10140]: https://github.com/openstreetmap/iD/issues/10140
# 2.28.0
-3
View File
@@ -248,9 +248,6 @@ export function presetPreset(presetID, preset, addable, allFields, allPresets) {
if (_this.tags[k] || !tags[k]) {
tags[k] = 'yes';
}
} else if (addTags[k] === '') {
// empty string equates to a tag which should be removed
delete tags[k];
} else {
tags[k] = addTags[k];
}
+3 -3
View File
@@ -87,13 +87,13 @@ function loadNsiPresets() {
// is going to be out of sync, see #9103
Object.values(vals[0].presets).forEach(preset => {
if (preset.tags['brand:wikidata']) {
preset.addTags['brand:wikipedia'] = '';
preset.removeTags = {'brand:wikipedia': '*', ...(preset.removeTags || preset.addTags || preset.tags)};
}
if (preset.tags['operator:wikidata']) {
preset.addTags['operator:wikipedia'] = '';
preset.removeTags = {'operator:wikipedia': '*', ...(preset.removeTags || preset.addTags || preset.tags)};
}
if (preset.tags['network:wikidata']) {
preset.addTags['network:wikipedia'] = '';
preset.removeTags = {'network:wikipedia': '*', ...(preset.removeTags || preset.addTags || preset.tags)};
}
});