Add quick fix to remove deprecated tags

This commit is contained in:
Quincy Morgan
2019-02-20 10:06:44 -05:00
parent cdc4557da5
commit 598827db87
3 changed files with 36 additions and 4 deletions
+8 -2
View File
@@ -1267,12 +1267,18 @@ en:
move_tags:
title: Move the tags
annotation: Moved tags.
remove_deprecated_tag:
annotation: Removed an old tag.
remove_deprecated_tag_combo:
annotation: Removed an old tag combination.
remove_generic_name:
title: Remove the name
annotation: Removed a generic name.
remove_tag:
title: Remove the tag
annotation: Removed tag.
remove_tags:
title: Remove the tags
reposition_features:
title: Reposition the features
select_preset:
@@ -1281,10 +1287,10 @@ en:
title: Tag as disconnected
annotation: Tagged very close features as disconnected.
upgrade_tag:
title: Upgrade this tag
title: Upgrade the tag
annotation: Upgraded an old tag.
upgrade_tag_combo:
title: Upgrade these tags
title: Upgrade the tags
annotation: Upgraded an old tag combination.
use_bridge_or_tunnel:
title: Use a bridge or tunnel
+11 -2
View File
@@ -1560,6 +1560,12 @@
"title": "Move the tags",
"annotation": "Moved tags."
},
"remove_deprecated_tag": {
"annotation": "Removed an old tag."
},
"remove_deprecated_tag_combo": {
"annotation": "Removed an old tag combination."
},
"remove_generic_name": {
"title": "Remove the name",
"annotation": "Removed a generic name."
@@ -1568,6 +1574,9 @@
"title": "Remove the tag",
"annotation": "Removed tag."
},
"remove_tags": {
"title": "Remove the tags"
},
"reposition_features": {
"title": "Reposition the features"
},
@@ -1579,11 +1588,11 @@
"annotation": "Tagged very close features as disconnected."
},
"upgrade_tag": {
"title": "Upgrade this tag",
"title": "Upgrade the tag",
"annotation": "Upgraded an old tag."
},
"upgrade_tag_combo": {
"title": "Upgrade these tags",
"title": "Upgrade the tags",
"annotation": "Upgraded an old tag combination."
},
"use_bridge_or_tunnel": {
+17
View File
@@ -82,6 +82,23 @@ export function validationDeprecatedTag() {
t('issues.fix.' + fixTextID + '.annotation')
);
}
}),
new validationIssueFix({
icon: 'iD-operation-delete',
title: t('issues.fix.' + (isCombo ? 'remove_tags' : 'remove_tag') + '.title'),
onClick: function() {
var entity = this.issue.entities[0];
var tags = _clone(entity.tags);
var oldTags = this.issue.info.oldTags;
for (var key in oldTags) {
delete tags[key];
}
var fixTextID = Object.keys(oldTags).length > 1 ? 'remove_deprecated_tag_combo' : 'remove_deprecated_tag';
context.perform(
actionChangeTags(entity.id, tags),
t('issues.fix.' + fixTextID + '.annotation')
);
}
})
]
}));