mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 13:38:26 +02:00
Add total ignored warnings count to changeset tags (re: #6123)
This commit is contained in:
@@ -24,6 +24,7 @@ var readOnlyTags = [
|
||||
/^imagery_used$/,
|
||||
/^host$/,
|
||||
/^locale$/,
|
||||
/^warnings$/,
|
||||
/^warnings:/
|
||||
];
|
||||
|
||||
@@ -116,7 +117,7 @@ export function uiCommit(context) {
|
||||
|
||||
// remove existing warning counts
|
||||
for (var key in tags) {
|
||||
if (key.match(/^warnings:/)) {
|
||||
if (key === 'warnings' || key.match(/^warnings:/)) {
|
||||
delete tags[key];
|
||||
}
|
||||
}
|
||||
@@ -125,6 +126,10 @@ export function uiCommit(context) {
|
||||
var warnings = context.validator()
|
||||
.getIssuesBySeverity({ what: 'edited', where: 'all' }).warning;
|
||||
|
||||
if (warnings.length) {
|
||||
tags.warnings = warnings.length.toString();
|
||||
}
|
||||
|
||||
var warningsByType = utilArrayGroupBy(warnings, 'type');
|
||||
for (var warningType in warningsByType) {
|
||||
tags['warnings:' + warningType] = warningsByType[warningType].length.toString();
|
||||
|
||||
Reference in New Issue
Block a user