You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by al...@apache.org on 2020/09/18 00:56:50 UTC

[nifi] 01/11: NIFI-7742: add case for controller service selections

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

alopresto pushed a commit to branch support/nifi-1.12.x
in repository https://gitbox.apache.org/repos/asf/nifi.git

commit c0e7f773f0fdd3af6f6bdf38aada3f4162bdae5f
Author: Shane Ardell <sh...@gmail.com>
AuthorDate: Fri Sep 11 15:49:51 2020 -0400

    NIFI-7742: add case for controller service selections
---
 .../nf-ng-canvas-flow-status-controller.js         | 39 ++++++++++++++++++----
 1 file changed, 33 insertions(+), 6 deletions(-)

diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-flow-status-controller.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-flow-status-controller.js
index 8a338fa..2e2ebc5 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-flow-status-controller.js
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-flow-status-controller.js
@@ -27,9 +27,11 @@
                 'nf.ClusterSummary',
                 'nf.ErrorHandler',
                 'nf.Settings',
-                'nf.ParameterContexts'],
-            function ($, nfCommon, nfDialog, nfCanvasUtils, nfContextMenu, nfClusterSummary, nfErrorHandler, nfSettings, nfParameterContexts) {
-                return (nf.ng.Canvas.FlowStatusCtrl = factory($, nfCommon, nfDialog, nfCanvasUtils, nfContextMenu, nfClusterSummary, nfErrorHandler, nfSettings, nfParameterContexts));
+                'nf.ParameterContexts',
+                'nf.ProcessGroup',
+                'nf.ProcessGroupConfiguration'],
+            function ($, nfCommon, nfDialog, nfCanvasUtils, nfContextMenu, nfClusterSummary, nfErrorHandler, nfSettings, nfParameterContexts, nfProcessGroup, nfProcessGroupConfiguration) {
+                return (nf.ng.Canvas.FlowStatusCtrl = factory($, nfCommon, nfDialog, nfCanvasUtils, nfContextMenu, nfClusterSummary, nfErrorHandler, nfSettings, nfParameterContexts, nfProcessGroup, nfProcessGroupConfiguration));
             });
     } else if (typeof exports === 'object' && typeof module === 'object') {
         module.exports = (nf.ng.Canvas.FlowStatusCtrl =
@@ -41,7 +43,9 @@
                 require('nf.ClusterSummary'),
                 require('nf.ErrorHandler'),
                 require('nf.Settings'),
-                require('nf.ParameterContexts')));
+                require('nf.ParameterContexts'),
+                require('nf.ProcessGroup'),
+                require('nf.ProcessGroupConfiguration')));
     } else {
         nf.ng.Canvas.FlowStatusCtrl = factory(root.$,
             root.nf.Common,
@@ -51,9 +55,11 @@
             root.nf.ClusterSummary,
             root.nf.ErrorHandler,
             root.nf.Settings,
-            root.nf.ParameterContexts);
+            root.nf.ParameterContexts,
+            root.nf.ProcessGroup,
+            root.nf.ProcessGroupConfiguration);
     }
-}(this, function ($, nfCommon, nfDialog, nfCanvasUtils, nfContextMenu, nfClusterSummary, nfErrorHandler, nfSettings, nfParameterContexts) {
+}(this, function ($, nfCommon, nfDialog, nfCanvasUtils, nfContextMenu, nfClusterSummary, nfErrorHandler, nfSettings, nfParameterContexts, nfProcessGroup, nfProcessGroupConfiguration) {
     'use strict';
 
     return function (serviceProvider) {
@@ -311,6 +317,27 @@
                                     var paramContext = item.parentGroup;
                                     nfParameterContexts.showParameterContext(paramContext.id, null, item.name);
                                     break;
+                                case 'controller service':
+                                    var group = item.parentGroup;
+                                    if (nfCommon.isDefinedAndNotNull(group.id)) {
+                                        nfProcessGroup.enterGroup(group.id).done(function () {
+                                            if ($('#process-group-configuration').is(':visible')) {
+                                                nfProcessGroupConfiguration.loadConfiguration(group.id).done(function () {
+                                                    nfProcessGroupConfiguration.selectControllerService(item.id);
+                                                });
+                                            } else {
+                                                nfProcessGroupConfiguration.showConfiguration(group.id).done(function () {
+                                                    nfSettings.selectControllerService(item.id);
+                                                });
+                                            }
+                                        });
+                                    } else {
+                                        // reload the settings and show
+                                        nfSettings.showSettings().done(function () {
+                                            nfSettings.selectControllerService(item.id);
+                                        });
+                                    }
+                                    break;
                                 default:
                                     var group = item.parentGroup;