This is an automated email from the ASF dual-hosted git repository.

rfellows pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new d693293c43 NIFI-13853: Added the ability to filter by all to the 
Advanced Rules page (#9371)
d693293c43 is described below

commit d693293c439cbb8a150d108c1891a5e98535bb6b
Author: Hunter Goller <[email protected]>
AuthorDate: Mon Oct 21 16:46:56 2024 -0400

    NIFI-13853: Added the ability to filter by all to the Advanced Rules page 
(#9371)
    
    * NIFI-13853: Added the ability to filter by all to the Advanced Rules pag
    
    * NIFI-13853: Fixed formatting
    
    * NIFI-13853: Removed labels in filter by everything
    
    Removed 'Name, Comments, Condition, Action' labels
    
    Co-authored-by: Rob Fellows <[email protected]>
    
    * NIFI-13853: Fixed indentation
    
    * NIFI-13853:Fixed the indentation
    
    For some reason my last commit didn't fix the indentation
    
    ---------
    
    Co-authored-by: Rob Fellows <[email protected]>
    
    This closes #9371
---
 .../src/main/webapp/js/application.js              | 23 +++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git 
a/nifi-extension-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/src/main/webapp/js/application.js
 
b/nifi-extension-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/src/main/webapp/js/application.js
index e65268966a..15e5f936fa 100644
--- 
a/nifi-extension-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/src/main/webapp/js/application.js
+++ 
b/nifi-extension-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/src/main/webapp/js/application.js
@@ -201,6 +201,9 @@ var ua = {
                 }, {
                     text: 'by action',
                     value: 'action'
+                }, {
+                     text: 'by any field',
+                     value: 'any'
                 }],
             select: function (option) {
                 ua.applyRuleFilter();
@@ -1484,14 +1487,32 @@ 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(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;
         }
+        return [];
     },
 
     /**

Reply via email to