mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-20 07:25:15 +02:00
Add ignored warning counts to the changeset tags (close #6123)
This commit is contained in:
+14
-1
@@ -24,7 +24,8 @@ var readOnlyTags = [
|
||||
/^ideditor:/,
|
||||
/^imagery_used$/,
|
||||
/^host$/,
|
||||
/^locale$/
|
||||
/^locale$/,
|
||||
/^warnings:/
|
||||
];
|
||||
|
||||
// treat most punctuation (except -, _, +, &) as hashtag delimiters - #4398
|
||||
@@ -114,6 +115,18 @@ export function uiCommit(context) {
|
||||
}
|
||||
}
|
||||
|
||||
var warningCountsByType = {};
|
||||
context.validator().getWarnings().forEach(function(warning) {
|
||||
// deletion count can be derived so don't tag that warning in the changeset
|
||||
if (warning.type === 'many_deletions') return;
|
||||
if (!warningCountsByType[warning.type]) warningCountsByType[warning.type] = 0;
|
||||
warningCountsByType[warning.type] += 1;
|
||||
});
|
||||
for (var warningType in warningCountsByType) {
|
||||
// tag the counts of warnings ignored by the user
|
||||
tags['warnings:' + warningType] = warningCountsByType[warningType].toString();
|
||||
}
|
||||
|
||||
_changeset = _changeset.update({ tags: tags });
|
||||
|
||||
var header = selection.selectAll('.header')
|
||||
|
||||
Reference in New Issue
Block a user