NIFI-342: - Setting focus in filter field on add processor dialog. - Ensuring toolbar button state is updated when adding a component. - Clear name/URL fields when canceling add port/group dialogs.
Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/05c01952 Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/05c01952 Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/05c01952 Branch: refs/heads/NIFI-250 Commit: 05c01952ad4604c5ca5ff3e75cc7823300de818b Parents: e486c56 Author: Matt Gilman <[email protected]> Authored: Thu Feb 12 09:52:37 2015 -0500 Committer: Matt Gilman <[email protected]> Committed: Thu Feb 12 09:52:37 2015 -0500 ---------------------------------------------------------------------- .../src/main/webapp/js/nf/canvas/nf-actions.js | 2 - .../webapp/js/nf/canvas/nf-canvas-toolbox.js | 52 +++++++++++++------- .../src/main/webapp/js/nf/canvas/nf-graph.js | 6 ++- 3 files changed, 38 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/05c01952/nifi/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/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js index 5fc94e1..02e0c3a 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js @@ -1065,7 +1065,6 @@ nf.Actions = (function () { // refresh the birdseye/toolbar nf.Birdseye.refresh(); - nf.CanvasToolbar.refresh(); // remove the original snippet nf.Snippet.remove(snippet.id).fail(reject); @@ -1078,7 +1077,6 @@ nf.Actions = (function () { // refresh the birdseye/toolbar nf.Birdseye.refresh(); - nf.CanvasToolbar.refresh(); }); // reject the deferred http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/05c01952/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-toolbox.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-canvas-toolbox.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-toolbox.js index 3255641..7de17f4 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-toolbox.js +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-toolbox.js @@ -373,6 +373,9 @@ nf.CanvasToolbox = (function () { // show the dialog $('#new-processor-dialog').modal('show'); + + // set the focus in the filter field + $('#processor-type-filter').focus(); // adjust the grid canvas now that its been rendered grid.resizeCanvas(); @@ -427,12 +430,11 @@ nf.CanvasToolbox = (function () { */ var promptForInputPortName = function (pt) { var addInputPort = function () { - // hide the dialog - $('#new-port-dialog').modal('hide'); - // get the name of the input port and clear the textfield var portName = $('#new-port-name').val(); - $('#new-port-name').val(''); + + // hide the dialog + $('#new-port-dialog').modal('hide'); // create the input port createInputPort(portName, pt); @@ -514,12 +516,11 @@ nf.CanvasToolbox = (function () { */ var promptForOutputPortName = function (pt) { var addOutputPort = function () { - // hide the dialog - $('#new-port-dialog').modal('hide'); - // get the name of the output port and clear the textfield var portName = $('#new-port-name').val(); - $('#new-port-name').val(''); + + // hide the dialog + $('#new-port-dialog').modal('hide'); // create the output port createOutputPort(portName, pt); @@ -641,12 +642,11 @@ nf.CanvasToolbox = (function () { */ var promptForRemoteProcessGroupUri = function (pt) { var addRemoteProcessGroup = function () { - // hide the dialog - $('#new-remote-process-group-dialog').modal('hide'); - // get the uri of the controller and clear the textfield var remoteProcessGroupUri = $('#new-remote-process-group-uri').val(); - $('#new-remote-process-group-uri').val(''); + + // hide the dialog + $('#new-remote-process-group-dialog').modal('hide'); // create the remote process group createRemoteProcessGroup(remoteProcessGroupUri, pt); @@ -1123,19 +1123,34 @@ nf.CanvasToolbox = (function () { // configure the new port dialog $('#new-port-dialog').modal({ headerText: 'Add Port', - overlayBackground: false + overlayBackground: false, + handler: { + close: function () { + $('#new-port-name').val(''); + } + } }); // configure the new process group dialog $('#new-process-group-dialog').modal({ headerText: 'Add Process Group', - overlayBackground: false + overlayBackground: false, + handler: { + close: function () { + $('#new-process-group-name').val(''); + } + } }); // configure the new remote process group dialog $('#new-remote-process-group-dialog').modal({ headerText: 'Add Remote Process Group', - overlayBackground: false + overlayBackground: false, + handler: { + close: function () { + $('#new-remote-process-group-uri').val(''); + } + } }); // configure the instantiate template dialog @@ -1164,12 +1179,11 @@ nf.CanvasToolbox = (function () { promptForGroupName: function (pt) { return $.Deferred(function (deferred) { var addGroup = function () { - // hide the dialog - $('#new-process-group-dialog').modal('hide'); - // get the name of the group and clear the textfield var groupName = $('#new-process-group-name').val(); - $('#new-process-group-name').val(''); + + // hide the dialog + $('#new-process-group-dialog').modal('hide'); // create the group and resolve the deferred accordingly createGroup(groupName, pt).done(function (response) { http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/05c01952/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-graph.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-graph.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-graph.js index 100f0f8..a9070c7 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-graph.js +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-graph.js @@ -67,7 +67,6 @@ nf.Graph = (function () { // if we are going to select the new components, deselect the previous selection if (selectAll) { - // deselect the current selection nf.CanvasUtils.getSelection().classed('selected', false); } @@ -96,6 +95,11 @@ nf.Graph = (function () { if (!nf.Common.isEmpty(processGroupContents.connections)) { nf.Connection.add(processGroupContents.connections, selectAll); } + + // trigger the toolbar to refresh if the selection is changing + if (selectAll) { + nf.CanvasToolbar.refresh(); + } }, /**
