Repository: nifi
Updated Branches:
  refs/heads/master 1a1e01c56 -> b8a386207


NIFI-4497:
- Fixing issue preventing separators in sub context menus.

This closes #2216

Signed-off-by: Scott Aslan <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/b8a38620
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/b8a38620
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/b8a38620

Branch: refs/heads/master
Commit: b8a3862078c91e1184575ebf469b1660539860be
Parents: 1a1e01c
Author: Matt Gilman <[email protected]>
Authored: Wed Oct 18 12:03:07 2017 -0400
Committer: Scott Aslan <[email protected]>
Committed: Wed Oct 18 13:42:58 2017 -0400

----------------------------------------------------------------------
 .../src/main/webapp/js/nf/canvas/nf-context-menu.js      | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/b8a38620/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-context-menu.js
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-context-menu.js
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-context-menu.js
index 0ebcf6a..a32a47f 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-context-menu.js
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-context-menu.js
@@ -704,7 +704,9 @@
 
             // whether or not a group item should be included
             var includeGroupItem = function (groupItem) {
-                if (groupItem.menuItem) {
+                if (groupItem.separator) {
+                    return true;
+                } else if (groupItem.menuItem) {
                     return groupItem.condition(selection);
                 } else {
                     var descendantItems = [];
@@ -754,7 +756,12 @@
                             applicableGroupItems.push(groupItem);
                         }
                     });
-                    included = applicableGroupItems.length > 0;
+
+                    // ensure the included menu items includes more than just 
separators
+                    var includedMenuItems = $.grep(applicableGroupItems, 
function (gi) {
+                        return nfCommon.isUndefinedOrNull(gi.separator);
+                    });
+                    included = includedMenuItems.length > 0;
                     if (included) {
                         addGroupItem(menu, i.id, i.groupMenuItem, 
applicableGroupItems);
                     }

Reply via email to