mcgilman commented on a change in pull request #5247:
URL: https://github.com/apache/nifi/pull/5247#discussion_r815962313
##########
File path:
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js
##########
@@ -845,6 +845,116 @@
}
},
+ /**
+ * Enable all controller services in the specified ProcessGroup.
+ *
+ * @argument {selection} selection The selection
+ * @argument {cb} callback The function to call when
request is processed
+ */
+ enableAllControllerServices: function (selection,cb) {
+ if (selection.empty()) {
+ // build the entity
+ var entity = {
+ 'id': nfCanvasUtils.getGroupId(),
+ 'state': 'ENABLED'
+ };
+ updateResource(config.urls.api + '/flow/process-groups/' +
encodeURIComponent(nfCanvasUtils.getGroupId()) + '/controller-services',
entity).done(updateProcessGroup);
+ } else {
+ var componentsToStart = selection.filter(function (d) {
Review comment:
@eduardofontes With the conditions on menu-items guaranteeing that
selection is empty or 1 we are doing a lot of unnecessary processing here.
Within this `else` we already know the selection is empty. Since the condition
was for a single Process Group, we don't need to be filtering for the
components to enable or the `enableRequests[]` array.
I think it would be fair to establish conditions that ensure the selection
is a single Process Group. However, code that allows the selection to contain
other types of components and filters down to only the Process Groups is
unnecessary. It was a requirement of the code where this snippet was copied
from. However, it's not a requirement here.
--
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]