NIFI-4497:

- Fixing issue preventing separators in sub context menus.

This closes #2216

Signed-off-by: Scott Aslan <scottyaslan@gmail.com>
This commit is contained in:
Matt Gilman 2017-10-18 12:03:07 -04:00 committed by Scott Aslan
parent 1a1e01c568
commit b8a3862078
1 changed files with 9 additions and 2 deletions

View File

@ -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);
}