mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-27 06:20:25 +01:00
Add outdated tags validation issue subtype for noncanonical brands
Add specific warning message for noncanonical brands (close #6443) Don't allow autofixing noncanonical brand issues
This commit is contained in:
@@ -1444,6 +1444,9 @@ en:
|
||||
incomplete:
|
||||
message: "{feature} has incomplete tags"
|
||||
reference: "Some features should have additional tags."
|
||||
noncanonical_brand:
|
||||
message: "{feature} looks like a brand with nonstandard tags"
|
||||
reference: "All features of the same brand should be tagged the same way."
|
||||
private_data:
|
||||
title: Private Information
|
||||
tip: "Find features that may contain private information"
|
||||
|
||||
4
dist/locales/en.json
vendored
4
dist/locales/en.json
vendored
@@ -1788,6 +1788,10 @@
|
||||
"incomplete": {
|
||||
"message": "{feature} has incomplete tags",
|
||||
"reference": "Some features should have additional tags."
|
||||
},
|
||||
"noncanonical_brand": {
|
||||
"message": "{feature} looks like a brand with nonstandard tags",
|
||||
"reference": "All features of the same brand should be tagged the same way."
|
||||
}
|
||||
},
|
||||
"private_data": {
|
||||
|
||||
@@ -101,6 +101,7 @@ export function validationOutdatedTags(context) {
|
||||
|
||||
var brand = brands.brands[match.kvnd];
|
||||
if (brand && brand.tags['brand:wikidata']) {
|
||||
subtype = 'noncanonical_brand';
|
||||
Object.assign(newTags, brand.tags);
|
||||
break;
|
||||
}
|
||||
@@ -112,7 +113,15 @@ export function validationOutdatedTags(context) {
|
||||
var tagDiff = utilTagDiff(oldTags, newTags);
|
||||
if (!tagDiff.length) return [];
|
||||
|
||||
var prefix = subtype === 'incomplete_tags' ? 'incomplete.' : '';
|
||||
var prefix = '';
|
||||
if (subtype === 'noncanonical_brand') {
|
||||
prefix = 'noncanonical_brand.';
|
||||
} else if (subtype === 'incomplete_tags') {
|
||||
prefix = 'incomplete.';
|
||||
}
|
||||
|
||||
// don't allow autofixing brand tags
|
||||
var autoArgs = subtype !== 'noncanonical_brand' ? [doUpgrade, t('issues.fix.upgrade_tags.annotation')] : null;
|
||||
|
||||
return [new validationIssue({
|
||||
type: type,
|
||||
@@ -124,7 +133,7 @@ export function validationOutdatedTags(context) {
|
||||
hash: JSON.stringify(tagDiff),
|
||||
fixes: [
|
||||
new validationIssueFix({
|
||||
autoArgs: [doUpgrade, t('issues.fix.upgrade_tags.annotation')],
|
||||
autoArgs: autoArgs,
|
||||
title: t('issues.fix.upgrade_tags.title'),
|
||||
onClick: function(context) {
|
||||
context.perform(doUpgrade, t('issues.fix.upgrade_tags.annotation'));
|
||||
|
||||
Reference in New Issue
Block a user