tpalfy commented on code in PR #8273:
URL: https://github.com/apache/nifi/pull/8273#discussion_r1513231844


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-flow-status-controller.js:
##########
@@ -400,6 +406,556 @@
                 }
             }
 
+            /**
+             * The flow analysis controller.
+             */
+
+            this.flowAnalysis = {
+
+                /**
+                 * Create the list of rule violations
+                 */
+                buildRuleViolationsList: function(rules, violationsAndRecs) {
+                    var ruleViolationCountEl = $('#rule-violation-count');
+                    var ruleViolationListEl = $('#rule-violations-list');
+                    var ruleWarningCountEl = $('#rule-warning-count');
+                    var ruleWarningListEl = $('#rule-warnings-list');
+                    var violations = violationsAndRecs.filter(function 
(violation) {
+                        return violation.enforcementPolicy === 'ENFORCE'
+                    });
+                    var warnings = violationsAndRecs.filter(function 
(violation) {
+                        return violation.enforcementPolicy === 'WARN'
+                    });
+                    ruleViolationCountEl.empty().text('(' + violations.length 
+ ')');
+                    ruleWarningCountEl.empty().text('(' + warnings.length + 
')');
+                    ruleViolationListEl.empty();
+                    violations.forEach(function(violation) {
+                        var rule = rules.find(function(rule) {
+                            return rule.id === violation.ruleId;
+                        });
+                        // create DOM elements
+                        var violationListItemEl = $('<li></li>');
+                        var violationEl = $('<div 
class="violation-list-item"></div>');
+                        var violationListItemWrapperEl = $('<div 
class="violation-list-item-wrapper"></div>');
+                        var violationRuleEl = $('<div 
class="rule-violations-list-item-name"></div>');
+                        var violationListItemNameEl = $('<div 
class="violation-list-item-name"></div>');
+                        var violationListItemIdEl = $('<span 
class="violation-list-item-id"></span>');
+                        var violationInfoButtonEl = $('<button 
class="violation-menu-btn"><i class="fa fa-ellipsis-v 
rules-list-item-menu-target" aria-hidden="true"></i></button>');
+
+                        // add text content and button data
+                        $(violationRuleEl).text(rule.name);
+                        
$(violationListItemNameEl).text(violation.subjectDisplayName);

Review Comment:
   @mcgilman I opened a PR https://issues.apache.org/jira/browse/NIFI-12862 
that should take care of this issue.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to