diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js index 051f397fcb..ecb1269313 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js @@ -174,7 +174,8 @@ // refresh the graph nfGraph.expireCaches(now); nfGraph.set(processGroupFlow.flow, $.extend({ - 'selectAll': false + 'selectAll': false, + 'overrideRevisionCheck': nfClusterSummary.didConnectedStateChange() }, options)); // update component visibility 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 6b0e5a9541..caf6ff99b8 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 @@ -2000,16 +2000,18 @@ set: function (connectionEntities, options) { var selectAll = false; var transition = false; + var overrideRevisionCheck = false; if (nfCommon.isDefinedAndNotNull(options)) { selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll; transition = nfCommon.isDefinedAndNotNull(options.transition) ? options.transition : transition; + overrideRevisionCheck = nfCommon.isDefinedAndNotNull(options.overrideRevisionCheck) ? options.overrideRevisionCheck : overrideRevisionCheck; } var set = function (proposedConnectionEntity) { var currentConnectionEntity = connectionMap.get(proposedConnectionEntity.id); // set the connection if appropriate due to revision and wasn't previously removed - if (nfClient.isNewerRevision(currentConnectionEntity, proposedConnectionEntity) && !removedCache.has(proposedConnectionEntity.id)) { + if ((nfClient.isNewerRevision(currentConnectionEntity, proposedConnectionEntity) && !removedCache.has(proposedConnectionEntity.id)) || overrideRevisionCheck === true) { connectionMap.set(proposedConnectionEntity.id, $.extend({ type: 'Connection' }, proposedConnectionEntity)); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-funnel.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-funnel.js index 44ff136124..ed5051fe65 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-funnel.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-funnel.js @@ -267,16 +267,18 @@ set: function (funnelEntities, options) { var selectAll = false; var transition = false; + var overrideRevisionCheck = false; if (nfCommon.isDefinedAndNotNull(options)) { selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll; transition = nfCommon.isDefinedAndNotNull(options.transition) ? options.transition : transition; + overrideRevisionCheck = nfCommon.isDefinedAndNotNull(options.overrideRevisionCheck) ? options.overrideRevisionCheck : overrideRevisionCheck; } var set = function (proposedFunnelEntity) { var currentFunnelEntity = funnelMap.get(proposedFunnelEntity.id); // set the funnel if appropriate due to revision and wasn't previously removed - if (nfClient.isNewerRevision(currentFunnelEntity, proposedFunnelEntity) && !removedCache.has(proposedFunnelEntity.id)) { + if ((nfClient.isNewerRevision(currentFunnelEntity, proposedFunnelEntity) && !removedCache.has(proposedFunnelEntity.id)) || overrideRevisionCheck === true) { funnelMap.set(proposedFunnelEntity.id, $.extend({ type: 'Funnel', dimensions: dimensions diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label.js index 382b7e0bfc..cce575c356 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label.js @@ -460,16 +460,18 @@ set: function (labelEntities, options) { var selectAll = false; var transition = false; + var overrideRevisionCheck = false; if (nfCommon.isDefinedAndNotNull(options)) { selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll; transition = nfCommon.isDefinedAndNotNull(options.transition) ? options.transition : transition; + overrideRevisionCheck = nfCommon.isDefinedAndNotNull(options.overrideRevisionCheck) ? options.overrideRevisionCheck : overrideRevisionCheck; } var set = function (proposedLabelEntity) { var currentLabelEntity = labelMap.get(proposedLabelEntity.id); // set the processor if appropriate due to revision and wasn't previously removed - if (nfClient.isNewerRevision(currentLabelEntity, proposedLabelEntity) && !removedCache.has(proposedLabelEntity.id)) { + if ((nfClient.isNewerRevision(currentLabelEntity, proposedLabelEntity) && !removedCache.has(proposedLabelEntity.id)) || overrideRevisionCheck === true) { labelMap.set(proposedLabelEntity.id, $.extend({ type: 'Label' }, proposedLabelEntity)); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port.js index 06820bfc8f..a574f0cc27 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port.js @@ -606,9 +606,11 @@ set: function (portEntities, options) { var selectAll = false; var transition = false; + var overrideRevisionCheck = false; if (nfCommon.isDefinedAndNotNull(options)) { selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll; transition = nfCommon.isDefinedAndNotNull(options.transition) ? options.transition : transition; + overrideRevisionCheck = nfCommon.isDefinedAndNotNull(options.overrideRevisionCheck) ? options.overrideRevisionCheck : overrideRevisionCheck; } // determine the appropriate dimensions for this port @@ -621,7 +623,7 @@ var currentPortEntity = portMap.get(proposedPortEntity.id); // set the port if appropriate due to revision and wasn't previously removed - if (nfClient.isNewerRevision(currentPortEntity, proposedPortEntity) && !removedCache.has(proposedPortEntity.id)) { + if ((nfClient.isNewerRevision(currentPortEntity, proposedPortEntity) && !removedCache.has(proposedPortEntity.id)) || overrideRevisionCheck === true) { // add the port portMap.set(proposedPortEntity.id, $.extend({ type: 'Port', diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group.js index c142b75c34..13bbc70594 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group.js @@ -1097,16 +1097,18 @@ set: function (processGroupEntities, options) { var selectAll = false; var transition = false; + var overrideRevisionCheck = false; if (nfCommon.isDefinedAndNotNull(options)) { selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll; transition = nfCommon.isDefinedAndNotNull(options.transition) ? options.transition : transition; + overrideRevisionCheck = nfCommon.isDefinedAndNotNull(options.overrideRevisionCheck) ? options.overrideRevisionCheck : overrideRevisionCheck; } var set = function (proposedProcessGroupEntity) { var currentProcessGroupEntity = processGroupMap.get(proposedProcessGroupEntity.id); // set the process group if appropriate due to revision and wasn't previously removed - if (nfClient.isNewerRevision(currentProcessGroupEntity, proposedProcessGroupEntity) && !removedCache.has(proposedProcessGroupEntity.id)) { + if ((nfClient.isNewerRevision(currentProcessGroupEntity, proposedProcessGroupEntity) && !removedCache.has(proposedProcessGroupEntity.id)) || overrideRevisionCheck === true) { processGroupMap.set(proposedProcessGroupEntity.id, $.extend({ type: 'ProcessGroup', dimensions: dimensions diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor.js index bc09526b7d..09b33dbd1c 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor.js @@ -944,16 +944,18 @@ set: function (processorEntities, options) { var selectAll = false; var transition = false; + var overrideRevisionCheck = false; if (nfCommon.isDefinedAndNotNull(options)) { selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll; transition = nfCommon.isDefinedAndNotNull(options.transition) ? options.transition : transition; + overrideRevisionCheck = nfCommon.isDefinedAndNotNull(options.overrideRevisionCheck) ? options.overrideRevisionCheck : overrideRevisionCheck; } var set = function (proposedProcessorEntity) { var currentProcessorEntity = processorMap.get(proposedProcessorEntity.id); // set the processor if appropriate due to revision and wasn't previously removed - if (nfClient.isNewerRevision(currentProcessorEntity, proposedProcessorEntity) && !removedCache.has(proposedProcessorEntity.id)) { + if ((nfClient.isNewerRevision(currentProcessorEntity, proposedProcessorEntity) && !removedCache.has(proposedProcessorEntity.id)) || overrideRevisionCheck === true) { processorMap.set(proposedProcessorEntity.id, $.extend({ type: 'Processor', dimensions: dimensions diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group.js index b91afd1e95..34005daa86 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group.js @@ -931,16 +931,18 @@ set: function (remoteProcessGroupEntities, options) { var selectAll = false; var transition = false; + var overrideRevisionCheck = false; if (nfCommon.isDefinedAndNotNull(options)) { selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll; transition = nfCommon.isDefinedAndNotNull(options.transition) ? options.transition : transition; + overrideRevisionCheck = nfCommon.isDefinedAndNotNull(options.overrideRevisionCheck) ? options.overrideRevisionCheck : overrideRevisionCheck; } var set = function (proposedRemoteProcessGroupEntity) { var currentRemoteProcessGroupEntity = remoteProcessGroupMap.get(proposedRemoteProcessGroupEntity.id); // set the remote process group if appropriate due to revision and wasn't previously removed - if (nfClient.isNewerRevision(currentRemoteProcessGroupEntity, proposedRemoteProcessGroupEntity) && !removedCache.has(proposedRemoteProcessGroupEntity.id)) { + if ((nfClient.isNewerRevision(currentRemoteProcessGroupEntity, proposedRemoteProcessGroupEntity) && !removedCache.has(proposedRemoteProcessGroupEntity.id)) || overrideRevisionCheck === true) { remoteProcessGroupMap.set(proposedRemoteProcessGroupEntity.id, $.extend({ type: 'RemoteProcessGroup', dimensions: dimensions diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-cluster-summary.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-cluster-summary.js index a06b7711f2..9a0acadc83 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-cluster-summary.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-cluster-summary.js @@ -31,6 +31,7 @@ }(this, function ($) { var clustered = false; var connectedToCluster = false; + var connectedStateChanged = false; var config = { urls: { @@ -54,6 +55,11 @@ var clusterSummaryResponse = clusterSummaryResult; var clusterSummary = clusterSummaryResponse.clusterSummary; + // see if the connected state changes + if (connectedToCluster !== clusterSummary.connectedToCluster) { + connectedStateChanged = true; + } + // establish the initial cluster state clustered = clusterSummary.clustered; connectedToCluster = clusterSummary.connectedToCluster; @@ -76,6 +82,16 @@ */ isConnectedToCluster: function () { return connectedToCluster === true; + }, + + /** + * Returns whether the connected state has changed since the last time + * didConnectedStateChange was invoked. + */ + didConnectedStateChange: function () { + var stateChanged = connectedStateChanged; + connectedStateChanged = false; + return stateChanged; } }; })); \ No newline at end of file