tpalfy commented on code in PR #8273:
URL: https://github.com/apache/nifi/pull/8273#discussion_r1509031907
##########
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 this is a good observation. I'm trying to figure out how to solve
this. In cluster mode usually the Merger (and in this case the
FlowAnalysisResultEntityMerger) actually filters the result based on
authorization. But in non-cluster mode I don't see what the usual practice is.
Do you have a suggestion?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]