rfellows commented on code in PR #9371:
URL: https://github.com/apache/nifi/pull/9371#discussion_r1809058508
##########
nifi-extension-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/src/main/webapp/js/application.js:
##########
@@ -1484,14 +1487,31 @@ var ua = {
conditions.push(condition.expression);
});
return conditions;
- } else {
+ } else if (filterType.value === 'action') {
var actions = [];
$.each(rule.actions, function (_, action) {
actions.push(action.attribute);
actions.push(action.value);
});
return actions;
+ } else if (filterType.value === 'any') {
+ // Return all relevant details for the rule
+ var allDetails = [];
+ allDetails.push('Name: ' + rule.name);
+ allDetails.push('Comments: ' + rule.comments);
+
+ // Add conditions
+ $.each(rule.conditions, function (_, condition) {
+ allDetails.push('Condition: ' + condition.expression);
+ });
+
+ // Add actions
+ $.each(rule.actions, function (_, action) {
+ allDetails.push('Action: ' + action.attribute + ' -> ' +
action.value);
+ });
+ return allDetails;
Review Comment:
I can see the reasoning behind adding the labels for debugging purposes,
however, they shouldn't be included generally. By prefixing the strings `Name,
Comments, Condition, Action`, those all become searchable and dilute the
results if you really are looking for one of those words.
```suggestion
} else if (filterType.value === 'any') {
// Return all relevant details for the rule
var allDetails = [];
allDetails.push(rule.name);
allDetails.push(rule.comments);
// Add conditions
$.each(rule.conditions, function (_, condition) {
allDetails.push(condition.expression);
});
// Add actions
$.each(rule.actions, function (_, action) {
allDetails.push(action.attribute);
allDetails.push(action.value);
});
return allDetails;
```
--
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]