mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-30 03:39:36 +02:00
drop *:wikipedia tags when selecting a NSI-based, fixes #9103
This commit is contained in:
@@ -58,8 +58,10 @@ _Breaking developer changes, which may affect downstream projects or sites that
|
||||
#### :rocket: Presets
|
||||
* Don't consider traffic_calming features as areas ([id-tagging-schema#1076])
|
||||
* Add rendering style for roller coaster tracks and supports ([#9891], thanks [@mangerlahn])
|
||||
* Drop `*:wikipedia` tags when switching to a new NSI-based preset which specifies a corresponding `*:wikidata` tag ([#9103])
|
||||
#### :hammer: Development
|
||||
|
||||
[#9103]: https://github.com/openstreetmap/iD/issues/9103
|
||||
[#9424]: https://github.com/openstreetmap/iD/pull/9424
|
||||
[#9422]: https://github.com/openstreetmap/iD/issues/9422
|
||||
[#9876]: https://github.com/openstreetmap/iD/issues/9876
|
||||
|
||||
@@ -248,6 +248,9 @@ 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];
|
||||
}
|
||||
|
||||
@@ -82,6 +82,21 @@ function loadNsiPresets() {
|
||||
// The preset json schema doesn't include it, but the iD code still uses it
|
||||
Object.values(vals[0].presets).forEach(preset => preset.suggestion = true);
|
||||
|
||||
// nsi does not specify *:wikipedia (anymore):
|
||||
// clean up previous values to prevent that the wikidata/wikipedia information
|
||||
// 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'] = '';
|
||||
}
|
||||
if (preset.tags['operator:wikidata']) {
|
||||
preset.addTags['operator:wikipedia'] = '';
|
||||
}
|
||||
if (preset.tags['network:wikidata']) {
|
||||
preset.addTags['network:wikipedia'] = '';
|
||||
}
|
||||
});
|
||||
|
||||
presetManager.merge({
|
||||
presets: vals[0].presets,
|
||||
featureCollection: vals[1]
|
||||
|
||||
Reference in New Issue
Block a user