From 549c97d3f4f69a2f04e877bc7b74095fd4a5b0d3 Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Tue, 13 Jan 2015 15:17:58 -0500 Subject: [PATCH 1/3] NIFI-256: - Hiding the context menu when opening the shell if possible. --- .../web/nifi-web-ui/src/main/webapp/js/nf/nf-shell.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-shell.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-shell.js index b0793a9ea7..85ca0bfa0d 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-shell.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-shell.js @@ -53,6 +53,11 @@ nf.Shell = (function () { * @argument {boolean} canUndock Whether or not the shell is undockable */ showPage: function (uri, canUndock) { + // if the context menu is on this page, attempt to close + if (nf.Common.isDefinedAndNotNull(nf.ContextMenu)) { + nf.ContextMenu.hide(); + } + return $.Deferred(function (deferred) { var shell = $('#shell'); @@ -108,6 +113,11 @@ nf.Shell = (function () { * @argument {string} domId The id of the element to show in the shell */ showContent: function (domId) { + // if the context menu is on this page, attempt to close + if (nf.Common.isDefinedAndNotNull(nf.ContextMenu)) { + nf.ContextMenu.hide(); + } + return $.Deferred(function (deferred) { var content = $(domId); if (content.length) { From b142d7a9bdecee96bcc7c1b920b3c2dbb748b5e9 Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Tue, 13 Jan 2015 15:21:42 -0500 Subject: [PATCH 2/3] NIFI-257: - Using the target URI as specified. --- .../web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js index dc8ca31505..5fc94e1b4c 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js @@ -167,7 +167,7 @@ nf.Actions = (function () { var uri = selectionData.component.targetUri; if (!nf.Common.isBlank(uri)) { - window.open(encodeURI(uri + '/nifi')); + window.open(encodeURI(uri)); } else { nf.Dialog.showOkDialog({ dialogContent: 'No target URI defined.' From 80793ccbb829e079ef8cc2fe703bad6397a71d48 Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Tue, 13 Jan 2015 15:54:21 -0500 Subject: [PATCH 3/3] NIFI-258: - Ensuring connection stays up to date when processor configuration changes. --- .../nf/canvas/nf-processor-configuration.js | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-configuration.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-configuration.js index 4dec7348a5..14ffa9503f 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-configuration.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-configuration.js @@ -363,6 +363,20 @@ nf.ProcessorConfiguration = (function () { return true; } }; + + /** + * Reloads the outgoing connections for the specified processor. + * + * @param {object} processor + */ + var reloadProcessorConnections = function (processor) { + var connections = nf.Connection.getComponentConnections(processor.id); + $.each(connections, function (_, connection) { + if (connection.source.id === processor.id) { + nf.Connection.reload(connection); + } + }); + }; return { /** @@ -601,8 +615,11 @@ nf.ProcessorConfiguration = (function () { // update the revision nf.Client.setRevision(response.revision); - // set the new processor state + // set the new processor state based on the response nf.Processor.set(response.processor); + + // reload the processor's outgoing connections + reloadProcessorConnections(processor); // close the details panel $('#processor-configuration').modal('hide'); @@ -632,7 +649,11 @@ nf.ProcessorConfiguration = (function () { // show the custom ui nf.CustomProcessorUi.showCustomUi($('#processor-id').text(), processor.config.customUiUrl, true).done(function () { + // once the custom ui is closed, reload the processor nf.Processor.reload(processor); + + // and reload the processor's outgoing connections + reloadProcessorConnections(processor); }); };