NIFI-4754:
- Only showing the import link in the new Process Group dialog when initiating 
from the toolbar.
This closes #2395.

Signed-off-by: Mark Payne <[email protected]>


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

Branch: refs/heads/HDF-3.1-maint
Commit: cadcd1dc78451c31810ad64eb9f3b73357fb04e8
Parents: 658ce50
Author: Matt Gilman <[email protected]>
Authored: Wed Jan 10 15:30:05 2018 -0500
Committer: Matt Gilman <[email protected]>
Committed: Tue Jan 16 14:55:24 2018 -0500

----------------------------------------------------------------------
 .../header/components/nf-ng-group-component.js     | 17 +++++++++--------
 .../src/main/webapp/js/nf/canvas/nf-actions.js     |  2 +-
 2 files changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/cadcd1dc/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-group-component.js
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-group-component.js
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-group-component.js
index 2ce8438..0458b87 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-group-component.js
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-group-component.js
@@ -152,12 +152,6 @@
                  * Show the modal.
                  */
                 show: function () {
-                    if (nfCommon.canVersionFlows()) {
-                        $('#import-process-group-link').show();
-                    } else {
-                        $('#import-process-group-link').hide();
-                    }
-
                     this.getElement().modal('show');
                 },
 
@@ -211,7 +205,7 @@
              * @argument {object} pt        The point that the component was 
dropped.
              */
             dropHandler: function (pt) {
-                this.promptForGroupName(pt);
+                this.promptForGroupName(pt, true);
             },
 
             /**
@@ -228,8 +222,9 @@
              * Prompts the user to enter the name for the group.
              *
              * @argument {object} pt        The point that the group was 
dropped.
+             * @argument {boolean} showImportLink Whether we should show the 
import link
              */
-            promptForGroupName: function (pt) {
+            promptForGroupName: function (pt, showImportLink) {
                 var groupComponent = this;
                 return $.Deferred(function (deferred) {
                     var addGroup = function () {
@@ -286,6 +281,12 @@
                             }
                         }]);
 
+                    if (showImportLink === true && nfCommon.canVersionFlows()) 
{
+                        $('#import-process-group-link').show();
+                    } else {
+                        $('#import-process-group-link').hide();
+                    }
+
                     // show the dialog
                     groupComponent.modal.storePt(pt);
                     groupComponent.modal.show();

http://git-wip-us.apache.org/repos/asf/nifi/blob/cadcd1dc/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js
index 8a17291..64b0eab 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js
@@ -1535,7 +1535,7 @@
             var origin = nfCanvasUtils.getOrigin(selection);
 
             var pt = {'x': origin.x, 'y': origin.y};
-            
$.when(nfNgBridge.injector.get('groupComponent').promptForGroupName(pt)).done(function
 (processGroup) {
+            
$.when(nfNgBridge.injector.get('groupComponent').promptForGroupName(pt, 
false)).done(function (processGroup) {
                 var group = d3.select('#id-' + processGroup.id);
                 nfCanvasUtils.moveComponents(selection, group);
             });

Reply via email to