sardell commented on code in PR #8273:
URL: https://github.com/apache/nifi/pull/8273#discussion_r1508148578
##########
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:
> In past features, referencing components where the user lacked permissions
were rendered as unauthorized
I'm assuming that those past features would handle the permission logic on
the backend so details like the name aren't returned in the request response.
cc @tpalfy
--
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]