From f2ca5316b0ff337bde126909575e3b3759a6bdd1 Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Thu, 25 Apr 2019 09:34:07 -0700 Subject: [PATCH] Add total ignored warnings count to changeset tags (re: #6123) --- modules/ui/commit.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/ui/commit.js b/modules/ui/commit.js index 6e25b1b81..94b6e3b00 100644 --- a/modules/ui/commit.js +++ b/modules/ui/commit.js @@ -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();