mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-25 01:24:05 +02: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:
@@ -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