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 2019/03/18 18:49:39 UTC

[nifi] branch master updated: NIFI-6118 - Fix: UI - Not all calls to nfCanvasUtil.reloadConnectionSourceAndDestination are made with the proper component IDs

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

mcgilman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/master by this push:
     new 0cb15cf  NIFI-6118 - Fix: UI - Not all calls to nfCanvasUtil.reloadConnectionSourceAndDestination are made with the proper component IDs
0cb15cf is described below

commit 0cb15cfb1a5425704a60db2d49415f745df48b1b
Author: Rob Fellows <ro...@gmail.com>
AuthorDate: Wed Mar 13 13:07:15 2019 -0400

    NIFI-6118 - Fix: UI - Not all calls to nfCanvasUtil.reloadConnectionSourceAndDestination are made with the proper component IDs
    
    This closes #3368
---
 .../src/main/webapp/js/nf/canvas/nf-connection.js         | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js
index f4b333c..662a918 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js
@@ -1630,7 +1630,9 @@
     var removeConnections = function (removed) {
         // consider reloading source/destination of connection being removed
         removed.each(function (d) {
-            nfCanvasUtils.reloadConnectionSourceAndDestination(d.sourceId, d.destinationId);
+            var sourceComponentId = nfCanvasUtils.getConnectionSourceComponentId(d);
+            var destinationComponentId = nfCanvasUtils.getConnectionDestinationComponentId(d);
+            nfCanvasUtils.reloadConnectionSourceAndDestination(sourceComponentId, destinationComponentId);
         });
 
         // remove the connection
@@ -1767,7 +1769,7 @@
                     // get the corresponding connection
                     var connection = d3.select(this.parentNode);
                     var connectionData = connection.datum();
-                    var previousDestinationId = connectionData.destinationId;
+                    var previousDestinationComponentId = nfCanvasUtils.getConnectionDestinationComponentId(connectionData);
 
                     // attempt to select a new destination
                     var destination = d3.select('g.connectable-destination');
@@ -1784,7 +1786,7 @@
                             // user will select new port and updated connect details will be set accordingly
                             nfConnectionConfiguration.showConfiguration(connection, destination).done(function () {
                                 // reload the previous destination
-                                nfCanvasUtils.reloadConnectionSourceAndDestination(null, previousDestinationId);
+                                nfCanvasUtils.reloadConnectionSourceAndDestination(null, previousDestinationComponentId);
                             }).fail(function () {
                                 // reset the connection
                                 connection.call(updateConnections, {
@@ -1843,8 +1845,11 @@
                                 nfConnection.set(response);
 
                                 // reload the previous destination and the new source/destination
-                                nfCanvasUtils.reloadConnectionSourceAndDestination(null, previousDestinationId);
-                                nfCanvasUtils.reloadConnectionSourceAndDestination(response.sourceId, response.destinationId);
+                                nfCanvasUtils.reloadConnectionSourceAndDestination(null, previousDestinationComponentId);
+
+                                var sourceComponentId = nfCanvasUtils.getConnectionSourceComponentId(response);
+                                var destinationComponentId = nfCanvasUtils.getConnectionSourceComponentId(response);
+                                nfCanvasUtils.reloadConnectionSourceAndDestination(sourceComponentId, destinationComponentId);
                             }).fail(function (xhr, status, error) {
                                 if (xhr.status === 400 || xhr.status === 401 || xhr.status === 403 || xhr.status === 404 || xhr.status === 409) {
                                     nfDialog.showOkDialog({