You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by mc...@apache.org on 2015/03/27 20:24:21 UTC

[1/2] incubator-nifi git commit: NIFI-250: - Fixing list item wrapping

Repository: incubator-nifi
Updated Branches:
  refs/heads/NIFI-250 1efa053b6 -> 0a7c55705


NIFI-250:
- Fixing list item wrapping

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

Branch: refs/heads/NIFI-250
Commit: 0d975028efdb07439ea21f1e3654b2c3cc939a93
Parents: 1efa053
Author: Matt Gilman <ma...@gmail.com>
Authored: Fri Mar 27 13:14:19 2015 -0400
Committer: Matt Gilman <ma...@gmail.com>
Committed: Fri Mar 27 13:14:19 2015 -0400

----------------------------------------------------------------------
 .../nifi-web-ui/src/main/webapp/css/controller-service.css       | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0d975028/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/controller-service.css
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/controller-service.css b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/controller-service.css
index 9eeccca..c7f8cd1 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/controller-service.css
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/controller-service.css
@@ -104,8 +104,7 @@ div.availability-setting {
 #controller-service-referencing-components {
     border: 0 solid #CCCCCC;
     height: 280px;
-    overflow-y: auto;
-    overflow-x: hidden;
+    overflow: auto;
     padding: 2px;
     width: 376px;
 }
@@ -131,6 +130,7 @@ ul.referencing-component-listing {
 
 ul.referencing-component-listing li {
     margin-bottom: 6px;
+    white-space: nowrap;
 }
 
 div.referencing-component-state {


[2/2] incubator-nifi git commit: NIFI-250: - Reloading newly and previously referenced controller services when modifying the referencing controller service. (ie adding/changing/removing the reference).

Posted by mc...@apache.org.
NIFI-250:
- Reloading newly and previously referenced controller services when modifying the referencing controller service. (ie adding/changing/removing the reference). 

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

Branch: refs/heads/NIFI-250
Commit: 0a7c55705fcdb485b6a8278fe39dd31f6e21639e
Parents: 0d97502
Author: Matt Gilman <ma...@gmail.com>
Authored: Fri Mar 27 15:23:55 2015 -0400
Committer: Matt Gilman <ma...@gmail.com>
Committed: Fri Mar 27 15:23:55 2015 -0400

----------------------------------------------------------------------
 .../js/nf/canvas/nf-controller-service.js       | 85 +++++++++++++++++---
 1 file changed, 74 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0a7c5570/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js
index 2bc83b6..1698b94 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js
@@ -873,7 +873,7 @@ nf.ControllerService = (function () {
         var disableDialog = $(this);
         var canceled = false;
                             
-        // only provide a close option
+        // only provide a cancel option
         disableDialog.modal('setButtonModel', [{
             buttonText: 'Cancel',
             handler: {
@@ -958,7 +958,7 @@ nf.ControllerService = (function () {
         var enableDialog = $(this);
         var canceled = false;
                             
-        // only provide a close option
+        // only provide a cancel option
         enableDialog.modal('setButtonModel', [{
             buttonText: 'Cancel',
             handler: {
@@ -1069,6 +1069,43 @@ nf.ControllerService = (function () {
         }).fail(nf.Common.handleAjaxError);
     };
     
+    /**
+     * Identifies the descriptors that identify controller services.
+     * 
+     * @param {object} component
+     */
+    var identifyReferencedServiceDescriptors = function (component) {
+        var referencedServiceDescriptors = [];
+        
+        $.each(component.descriptors, function(_, descriptor) {
+            if (descriptor.identifiesControllerService === true) {
+                referencedServiceDescriptors.push(descriptor);
+            }
+        });
+        
+        return referencedServiceDescriptors;
+    };
+    
+    /**
+     * Identifies descritpors that reference controller services.
+     * 
+     * @param {object} component
+     */
+    var getReferencedServices = function (component) {
+        var referencedServices = [];
+        
+        $.each(identifyReferencedServiceDescriptors(component), function(_, descriptor) {
+            var referencedServiceId = component.properties[descriptor.name];
+
+            // ensure the property is configured
+            if (nf.Common.isDefinedAndNotNull(referencedServiceId) && $.trim(referencedServiceId).length > 0) {
+                referencedServices.push(referencedServiceId);
+            }
+        });
+        
+        return referencedServices;
+    };
+    
     return {
         /**
          * Initializes the controller service configuration dialog.
@@ -1357,6 +1394,17 @@ nf.ControllerService = (function () {
 
                                 // ensure details are valid as far as we can tell
                                 if (validateDetails(updatedControllerService)) {
+                                    var previouslyReferencedServiceIds = [];
+                                    $.each(identifyReferencedServiceDescriptors(controllerService), function (_, descriptor) {
+                                        // if we are attempting to update a controller service reference
+                                        if (!nf.Common.isUndefined(updatedControllerService.controllerService.properties[descriptor.name]) &&
+                                                !nf.Common.isNull(controllerService.properties[descriptor.name])) {
+                                        
+                                            // record the current value if set
+                                            previouslyReferencedServiceIds.push(controllerService.properties[descriptor.name]);
+                                        }
+                                    });
+                                    
                                     // update the selected component
                                     $.ajax({
                                         type: 'PUT',
@@ -1371,6 +1419,12 @@ nf.ControllerService = (function () {
 
                                             // reload the controller service
                                             renderControllerService(response.controllerService);
+                                            reloadControllerServiceReferences(response.controllerService);
+                                            
+                                            // reload all previously referenced controller services
+                                            $.each(previouslyReferencedServiceIds, function(_, oldServiceReferenceId) {
+                                                reloadControllerService(oldServiceReferenceId);
+                                            });
 
                                             // close the details panel
                                             controllerServiceDialog.modal('hide');
@@ -1427,6 +1481,17 @@ nf.ControllerService = (function () {
 
                                             // ensure details are valid as far as we can tell
                                             if (validateDetails(updatedControllerService)) {
+                                                var previouslyReferencedServiceIds = [];
+                                                $.each(identifyReferencedServiceDescriptors(controllerService), function (_, descriptor) {
+                                                    // if we are attempting to update a controller service reference
+                                                    if (!nf.Common.isUndefined(updatedControllerService.controllerService.properties[descriptor.name]) &&
+                                                            !nf.Common.isNull(controllerService.properties[descriptor.name])) {
+                                                        
+                                                        // record the current value if set
+                                                        previouslyReferencedServiceIds.push(controllerService.properties[descriptor.name]);
+                                                    }
+                                                });
+
                                                 // update the selected component
                                                 $.ajax({
                                                     type: 'PUT',
@@ -1440,6 +1505,11 @@ nf.ControllerService = (function () {
                                                         // update the revision
                                                         nf.Client.setRevision(response.revision);
 
+                                                        // reload all previously referenced controller services
+                                                        $.each(previouslyReferencedServiceIds, function(_, oldServiceReferenceId) {
+                                                            reloadControllerService(oldServiceReferenceId);
+                                                        });
+
                                                         // open the custom ui
                                                         openCustomUi();
                                                     }
@@ -1620,15 +1690,8 @@ nf.ControllerService = (function () {
          * @param {object} component
          */
         reloadReferencedServices: function(component) {
-            $.each(component.descriptors, function(_, descriptor) {
-                if (descriptor.identifiesControllerService === true) {
-                    var referencedServiceId = component.properties[descriptor.name];
-                    
-                    // ensure the property is configured
-                    if (nf.Common.isDefinedAndNotNull(referencedServiceId) && $.trim(referencedServiceId).length > 0) {
-                        reloadControllerService(referencedServiceId);
-                    }
-                }
+            $.each(getReferencedServices(component), function (_, referencedServiceId) {
+                reloadControllerService(referencedServiceId);
             });
         },