From 674c9e468785fd0c0f7b4cc68fa35f9707e36a71 Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Wed, 10 Jan 2018 15:30:05 -0500 Subject: [PATCH] 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 --- .../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(-) 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 2ce843866e..0458b87ce1 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(); 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 8a17291392..64b0eaba26 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); });