Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NIFI-13853: Added the ability to filter by all to the Advanced Rules page #9371

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ var ua = {
}, {
text: 'by action',
value: 'action'
}, {
text: 'by any field',
value: 'any'
}],
select: function (option) {
ua.applyRuleFilter();
Expand Down Expand Up @@ -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;
}
return [];
},

/**
Expand Down