Add total ignored warnings count to changeset tags (re: #6123)

This commit is contained in:
Quincy Morgan
2019-04-25 09:34:07 -07:00
parent 36917ab644
commit f2ca5316b0
+6 -1
View File
@@ -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();