http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-queue-listing.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-queue-listing.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-queue-listing.js index acf2ca5..98632dc 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-queue-listing.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-queue-listing.js @@ -32,8 +32,8 @@ 'nf.ErrorHandler', 'nf.Storage', 'nf.CanvasUtils'], - function ($, Slick, common, dialog, shell, angularBridge, clusterSummary, errorHandler, storage, canvasUtils) { - return (nf.QueueListing = factory($, Slick, common, dialog, shell, angularBridge, clusterSummary, errorHandler, storage, canvasUtils)); + function ($, Slick, nfCommon, nfDialog, nfShell, nfNgBridge, nfClusterSummary, nfErrorHandler, nfStorage, nfCanvasUtils) { + return (nf.QueueListing = factory($, Slick, nfCommon, nfDialog, nfShell, nfNgBridge, nfClusterSummary, nfErrorHandler, nfStorage, nfCanvasUtils)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.QueueListing = @@ -59,7 +59,7 @@ root.nf.Storage, root.nf.CanvasUtils); } -}(this, function ($, Slick, common, dialog, shell, angularBridge, clusterSummary, errorHandler, storage, canvasUtils) { +}(this, function ($, Slick, nfCommon, nfDialog, nfShell, nfNgBridge, nfClusterSummary, nfErrorHandler, nfStorage, nfCanvasUtils) { 'use strict'; /** @@ -96,17 +96,17 @@ var dataUri = $('#flowfile-uri').text() + '/content'; // perform the request once we've received a token - common.getAccessToken(config.urls.downloadToken).done(function (downloadToken) { + nfCommon.getAccessToken(config.urls.downloadToken).done(function (downloadToken) { var parameters = {}; // conditionally include the ui extension token - if (!common.isBlank(downloadToken)) { + if (!nfCommon.isBlank(downloadToken)) { parameters['access_token'] = downloadToken; } // conditionally include the cluster node id var clusterNodeId = $('#flowfile-cluster-node-id').text(); - if (!common.isBlank(clusterNodeId)) { + if (!nfCommon.isBlank(clusterNodeId)) { parameters['clusterNodeId'] = clusterNodeId; } @@ -117,7 +117,7 @@ window.open(dataUri + '?' + $.param(parameters)); } }).fail(function () { - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Queue Listing', dialogContent: 'Unable to generate access token for downloading content.' }); @@ -132,7 +132,7 @@ // generate tokens as necessary var getAccessTokens = $.Deferred(function (deferred) { - if (storage.hasItem('jwt')) { + if (nfStorage.hasItem('jwt')) { // generate a token for the ui extension and another for the callback var uiExtensionToken = $.ajax({ type: 'POST', @@ -149,7 +149,7 @@ var downloadToken = downloadTokenResult[0]; deferred.resolve(uiExtensionToken, downloadToken); }).fail(function () { - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Queue Listing', dialogContent: 'Unable to generate access token for viewing content.' }); @@ -166,12 +166,12 @@ // conditionally include the cluster node id var clusterNodeId = $('#flowfile-cluster-node-id').text(); - if (!common.isBlank(clusterNodeId)) { + if (!nfCommon.isBlank(clusterNodeId)) { dataUriParameters['clusterNodeId'] = clusterNodeId; } // include the download token if applicable - if (!common.isBlank(downloadToken)) { + if (!nfCommon.isBlank(downloadToken)) { dataUriParameters['access_token'] = downloadToken; } @@ -197,7 +197,7 @@ }; // include the download token if applicable - if (!common.isBlank(uiExtensionToken)) { + if (!nfCommon.isBlank(uiExtensionToken)) { contentViewerParameters['access_token'] = uiExtensionToken; } @@ -227,7 +227,7 @@ // update the progress var label = $('<div class="progress-label"></div>').text(percentComplete + '%'); - (angularBridge.injector.get('$compile')($('<md-progress-linear ng-cloak ng-value="' + percentComplete + '" class="md-hue-2" md-mode="determinate" aria-label="Searching Queue"></md-progress-linear>'))(angularBridge.rootScope)).appendTo(progressBar); + (nfNgBridge.injector.get('$compile')($('<md-progress-linear ng-cloak ng-value="' + percentComplete + '" class="md-hue-2" md-mode="determinate" aria-label="Searching Queue"></md-progress-linear>'))(nfNgBridge.rootScope)).appendTo(progressBar); progressBar.append(label); }; @@ -263,7 +263,7 @@ var reject = cancelled; // ensure the listing requests are present - if (common.isDefinedAndNotNull(listingRequest)) { + if (nfCommon.isDefinedAndNotNull(listingRequest)) { $.ajax({ type: 'DELETE', url: listingRequest.uri, @@ -271,20 +271,20 @@ }); // use the listing request from when the listing completed - if (common.isEmpty(listingRequest.flowFileSummaries)) { + if (nfCommon.isEmpty(listingRequest.flowFileSummaries)) { if (cancelled === false) { reject = true; // show the dialog - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Queue Listing', dialogContent: 'The queue has no FlowFiles.' }); } } else { // update the queue size - $('#total-flowfiles-count').text(common.formatInteger(listingRequest.queueSize.objectCount)); - $('#total-flowfiles-size').text(common.formatDataSize(listingRequest.queueSize.byteCount)); + $('#total-flowfiles-count').text(nfCommon.formatInteger(listingRequest.queueSize.objectCount)); + $('#total-flowfiles-size').text(nfCommon.formatDataSize(listingRequest.queueSize.byteCount)); // update the last updated time $('#queue-listing-last-refreshed').text(listingRequest.lastUpdated); @@ -356,7 +356,7 @@ }).done(function (response) { listingRequest = response.listingRequest; processListingRequest(nextDelay); - }).fail(completeListingRequest).fail(errorHandler.handleAjaxError); + }).fail(completeListingRequest).fail(nfErrorHandler.handleAjaxError); }; // issue the request to list the flow files @@ -375,7 +375,7 @@ // process the drop request listingRequest = response.listingRequest; processListingRequest(1); - }).fail(completeListingRequest).fail(errorHandler.handleAjaxError); + }).fail(completeListingRequest).fail(nfErrorHandler.handleAjaxError); }).promise(); }; @@ -389,13 +389,13 @@ var formatFlowFileDetail = function (label, value) { $('<div class="flowfile-detail"></div>').append( $('<div class="detail-name"></div>').text(label)).append( - $('<div class="detail-value">' + common.formatValue(value) + '</div>').ellipsis()).append( + $('<div class="detail-value">' + nfCommon.formatValue(value) + '</div>').ellipsis()).append( $('<div class="clear"></div>')).appendTo('#additional-flowfile-details'); }; // formats the content value var formatContentValue = function (element, value) { - if (common.isDefinedAndNotNull(value)) { + if (nfCommon.isDefinedAndNotNull(value)) { element.removeClass('unset').text(value); } else { element.addClass('unset').text('No value set'); @@ -403,7 +403,7 @@ }; var params = {}; - if (common.isDefinedAndNotNull(flowFileSummary.clusterNodeId)) { + if (nfCommon.isDefinedAndNotNull(flowFileSummary.clusterNodeId)) { params['clusterNodeId'] = flowFileSummary.clusterNodeId; } @@ -419,16 +419,16 @@ $('#flowfile-uri').text(flowFile.uri); // show the flowfile details dialog - $('#flowfile-uuid').html(common.formatValue(flowFile.uuid)); - $('#flowfile-filename').html(common.formatValue(flowFile.filename)); - $('#flowfile-queue-position').html(common.formatValue(flowFile.position)); - $('#flowfile-file-size').html(common.formatValue(flowFile.contentClaimFileSize)); - $('#flowfile-queued-duration').text(common.formatDuration(flowFile.queuedDuration)); - $('#flowfile-lineage-duration').text(common.formatDuration(flowFile.lineageDuration)); + $('#flowfile-uuid').html(nfCommon.formatValue(flowFile.uuid)); + $('#flowfile-filename').html(nfCommon.formatValue(flowFile.filename)); + $('#flowfile-queue-position').html(nfCommon.formatValue(flowFile.position)); + $('#flowfile-file-size').html(nfCommon.formatValue(flowFile.contentClaimFileSize)); + $('#flowfile-queued-duration').text(nfCommon.formatDuration(flowFile.queuedDuration)); + $('#flowfile-lineage-duration').text(nfCommon.formatDuration(flowFile.lineageDuration)); $('#flowfile-penalized').text(flowFile.penalized === true ? 'Yes' : 'No'); // conditionally show the cluster node identifier - if (common.isDefinedAndNotNull(flowFileSummary.clusterNodeId)) { + if (nfCommon.isDefinedAndNotNull(flowFileSummary.clusterNodeId)) { // save the cluster node id $('#flowfile-cluster-node-id').text(flowFileSummary.clusterNodeId); @@ -436,7 +436,7 @@ formatFlowFileDetail('Node Address', flowFileSummary.clusterNodeAddress); } - if (common.isDefinedAndNotNull(flowFile.contentClaimContainer)) { + if (nfCommon.isDefinedAndNotNull(flowFile.contentClaimContainer)) { // content claim formatContentValue($('#content-container'), flowFile.contentClaimContainer); formatContentValue($('#content-section'), flowFile.contentClaimSection); @@ -447,9 +447,9 @@ // input content file size var contentSize = $('#content-size'); formatContentValue(contentSize, flowFile.contentClaimFileSize); - if (common.isDefinedAndNotNull(flowFile.contentClaimFileSize)) { + if (nfCommon.isDefinedAndNotNull(flowFile.contentClaimFileSize)) { // over the default tooltip with the actual byte count - contentSize.attr('title', common.formatInteger(flowFile.contentClaimFileSizeBytes) + ' bytes'); + contentSize.attr('title', nfCommon.formatInteger(flowFile.contentClaimFileSizeBytes) + ' bytes'); } // show the content details @@ -465,18 +465,18 @@ $.each(flowFile.attributes, function (attributeName, attributeValue) { // create the attribute record var attributeRecord = $('<div class="attribute-detail"></div>') - .append($('<div class="attribute-name">' + common.formatValue(attributeName) + '</div>').ellipsis()) + .append($('<div class="attribute-name">' + nfCommon.formatValue(attributeName) + '</div>').ellipsis()) .appendTo(attributesContainer); // add the current value attributeRecord - .append($('<div class="attribute-value">' + common.formatValue(attributeValue) + '</div>').ellipsis()) + .append($('<div class="attribute-value">' + nfCommon.formatValue(attributeValue) + '</div>').ellipsis()) .append('<div class="clear"></div>'); }); // show the dialog $('#flowfile-details-dialog').modal('show'); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; var nfQueueListing = { @@ -496,12 +496,12 @@ // function for formatting data sizes var dataSizeFormatter = function (row, cell, value, columnDef, dataContext) { - return common.formatDataSize(value); + return nfCommon.formatDataSize(value); }; // function for formatting durations var durationFormatter = function (row, cell, value, columnDef, dataContext) { - return common.formatDuration(value); + return nfCommon.formatDuration(value); }; // function for formatting penalization @@ -588,7 +588,7 @@ ]; // conditionally show the cluster node identifier - if (clusterSummary.isClustered()) { + if (nfClusterSummary.isClustered()) { queueListingColumns.push({ id: 'clusterNodeAddress', name: 'Node', @@ -599,7 +599,7 @@ } // add an actions column when the user can access provenance - if (common.canAccessProvenance()) { + if (nfCommon.canAccessProvenance()) { // function for formatting actions var actionsFormatter = function () { return '<div title="Provenance" class="pointer icon icon-provenance view-provenance"></div>'; @@ -654,7 +654,7 @@ $('#shell-close-button').click(); // open the provenance page with the specified component - shell.showPage('provenance?' + $.param({ + nfShell.showPage('provenance?' + $.param({ flowFileUuid: item.uuid })); } @@ -688,7 +688,7 @@ $('#content-download').on('click', downloadContent); // only show if content viewer is configured - if (common.isContentViewConfigured()) { + if (nfCommon.isContentViewConfigured()) { $('#content-view').show(); $('#content-view').on('click', viewContent); } @@ -730,7 +730,7 @@ $('#additional-flowfile-details').empty(); }, open: function () { - common.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0)); + nfCommon.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0)); } } }); @@ -741,7 +741,7 @@ */ resetTableSize: function () { var queueListingGrid = $('#queue-listing-table').data('gridInstance'); - if (common.isDefinedAndNotNull(queueListingGrid)) { + if (nfCommon.isDefinedAndNotNull(queueListingGrid)) { queueListingGrid.resizeCanvas(); } }, @@ -757,7 +757,7 @@ // update the connection name var connectionName = ''; if (connection.permissions.canRead) { - connectionName = canvasUtils.formatConnectionName(connection.component); + connectionName = nfCanvasUtils.formatConnectionName(connection.component); } if (connectionName === '') { connectionName = 'Connection'; @@ -765,7 +765,7 @@ $('#queue-listing-header-text').text(connectionName); // show the listing container - shell.showContent('#queue-listing-container').done(function () { + nfShell.showContent('#queue-listing-container').done(function () { $('#queue-listing-table').removeData('connection'); // clear the table @@ -779,7 +779,7 @@ // reset stats $('#displayed-flowfiles, #total-flowfiles-count').text('0'); - $('#total-flowfiles-size').text(common.formatDataSize(0)); + $('#total-flowfiles-size').text(nfCommon.formatDataSize(0)); }); // adjust the table size
http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group-configuration.js ---------------------------------------------------------------------- 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-configuration.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-configuration.js index a8d5236..06cf866 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-configuration.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-configuration.js @@ -28,8 +28,8 @@ 'nf.CanvasUtils', 'nf.ng.Bridge', 'nf.RemoteProcessGroup'], - function ($, d3, errorHandler, common, dialog, client, canvasUtils, angularBridge, nfRemoteProcessGroup) { - return (nf.RemoteProcessGroupConfiguration = factory($, d3, errorHandler, common, dialog, client, canvasUtils, angularBridge, nfRemoteProcessGroup)); + function ($, d3, nfErrorHandler, nfCommon, nfDialog, nfClient, nfCanvasUtils, nfNgBridge, nfRemoteProcessGroup) { + return (nf.RemoteProcessGroupConfiguration = factory($, d3, nfErrorHandler, nfCommon, nfDialog, nfClient, nfCanvasUtils, nfNgBridge, nfRemoteProcessGroup)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.RemoteProcessGroupConfiguration = @@ -53,7 +53,7 @@ root.nf.ng.Bridge, root.nf.RemoteProcessGroup); } -}(this, function ($, d3, errorHandler, common, dialog, client, canvasUtils, angularBridge, nfRemoteProcessGroup) { +}(this, function ($, d3, nfErrorHandler, nfCommon, nfDialog, nfClient, nfCanvasUtils, nfNgBridge, nfRemoteProcessGroup) { 'use strict'; return { @@ -75,7 +75,7 @@ // create the remote process group details var remoteProcessGroupEntity = { - 'revision': client.getRevision(remoteProcessGroupData), + 'revision': nfClient.getRevision(remoteProcessGroupData), 'component': { id: remoteProcessGroupId, communicationsTimeout: $('#remote-process-group-timeout').val(), @@ -100,7 +100,7 @@ nfRemoteProcessGroup.set(response); // inform Angular app values have changed - angularBridge.digest(); + nfNgBridge.digest(); // close the details panel $('#remote-process-group-configuration').modal('hide'); @@ -112,15 +112,15 @@ if (errors.length === 1) { content = $('<span></span>').text(errors[0]); } else { - content = common.formatUnorderedList(errors); + content = nfCommon.formatUnorderedList(errors); } - dialog.showOkDialog({ + nfDialog.showOkDialog({ dialogContent: content, headerText: 'Remote Process Group Configuration' }); } else { - errorHandler.handleAjaxError(xhr, status, error); + nfErrorHandler.handleAjaxError(xhr, status, error); } }); } @@ -176,7 +176,7 @@ */ showConfiguration: function (selection) { // if the specified component is a remote process group, load its properties - if (canvasUtils.isRemoteProcessGroup(selection)) { + if (nfCanvasUtils.isRemoteProcessGroup(selection)) { var selectionData = selection.datum(); // populate the port settings http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group-details.js ---------------------------------------------------------------------- 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-details.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-details.js index 73c44b5..7c6d667 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-details.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-details.js @@ -22,8 +22,8 @@ define(['jquery', 'nf.Common', 'nf.CanvasUtils'], - function ($, common, canvasUtils) { - return (nf.RemoteProcessGroupDetails = factory($, common, canvasUtils)); + function ($, nfCommon, nfCanvasUtils) { + return (nf.RemoteProcessGroupDetails = factory($, nfCommon, nfCanvasUtils)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.RemoteProcessGroupDetails = @@ -35,7 +35,7 @@ root.nf.Common, root.nf.CanvasUtils); } -}(this, function ($, common, canvasUtils) { +}(this, function ($, nfCommon, nfCanvasUtils) { 'use strict'; return { @@ -59,16 +59,16 @@ handler: { close: function () { // clear the remote process group details - common.clearField('read-only-remote-process-group-id'); - common.clearField('read-only-remote-process-group-name'); - common.clearField('read-only-remote-process-group-urls'); - common.clearField('read-only-remote-process-group-timeout'); - common.clearField('read-only-remote-process-group-yield-duration'); - common.clearField('read-only-remote-process-group-transport-protocol'); - common.clearField('read-only-remote-process-group-proxy-host'); - common.clearField('read-only-remote-process-group-proxy-port'); - common.clearField('read-only-remote-process-group-proxy-user'); - common.clearField('read-only-remote-process-group-proxy-password'); + nfCommon.clearField('read-only-remote-process-group-id'); + nfCommon.clearField('read-only-remote-process-group-name'); + nfCommon.clearField('read-only-remote-process-group-urls'); + nfCommon.clearField('read-only-remote-process-group-timeout'); + nfCommon.clearField('read-only-remote-process-group-yield-duration'); + nfCommon.clearField('read-only-remote-process-group-transport-protocol'); + nfCommon.clearField('read-only-remote-process-group-proxy-host'); + nfCommon.clearField('read-only-remote-process-group-proxy-port'); + nfCommon.clearField('read-only-remote-process-group-proxy-user'); + nfCommon.clearField('read-only-remote-process-group-proxy-password'); } } }); @@ -81,20 +81,20 @@ */ showDetails: function (selection) { // if the specified component is a remote process group, load its properties - if (canvasUtils.isRemoteProcessGroup(selection)) { + if (nfCanvasUtils.isRemoteProcessGroup(selection)) { var selectionData = selection.datum(); // populate the port settings - common.populateField('read-only-remote-process-group-id', selectionData.id); - common.populateField('read-only-remote-process-group-name', selectionData.component.name); - common.populateField('read-only-remote-process-group-urls', selectionData.component.targetUris); - common.populateField('read-only-remote-process-group-timeout', selectionData.component.communicationsTimeout); - common.populateField('read-only-remote-process-group-yield-duration', selectionData.component.yieldDuration); - common.populateField('read-only-remote-process-group-transport-protocol', selectionData.component.transportProtocol); - common.populateField('read-only-remote-process-group-proxy-host', selectionData.component.proxyHost); - common.populateField('read-only-remote-process-group-proxy-port', selectionData.component.proxyPort); - common.populateField('read-only-remote-process-group-proxy-user', selectionData.component.proxyUser); - common.populateField('read-only-remote-process-group-proxy-password', selectionData.component.proxyPassword); + nfCommon.populateField('read-only-remote-process-group-id', selectionData.id); + nfCommon.populateField('read-only-remote-process-group-name', selectionData.component.name); + nfCommon.populateField('read-only-remote-process-group-urls', selectionData.component.targetUris); + nfCommon.populateField('read-only-remote-process-group-timeout', selectionData.component.communicationsTimeout); + nfCommon.populateField('read-only-remote-process-group-yield-duration', selectionData.component.yieldDuration); + nfCommon.populateField('read-only-remote-process-group-transport-protocol', selectionData.component.transportProtocol); + nfCommon.populateField('read-only-remote-process-group-proxy-host', selectionData.component.proxyHost); + nfCommon.populateField('read-only-remote-process-group-proxy-port', selectionData.component.proxyPort); + nfCommon.populateField('read-only-remote-process-group-proxy-user', selectionData.component.proxyUser); + nfCommon.populateField('read-only-remote-process-group-proxy-password', selectionData.component.proxyPassword); // show the details $('#remote-process-group-details').modal('show'); http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group-ports.js ---------------------------------------------------------------------- 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-ports.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-ports.js index f5f44dd..2a7f282 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-ports.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-ports.js @@ -28,8 +28,8 @@ 'nf.CanvasUtils', 'nf.ng.Bridge', 'nf.RemoteProcessGroup'], - function ($, d3, errorHandler, common, dialog, client, canvasUtils, angularBridge, nfRemoteProcessGroup) { - return (nf.RemoteProcessGroupPorts = factory($, d3, errorHandler, common, dialog, client, canvasUtils, angularBridge, nfRemoteProcessGroup)); + function ($, d3, nfErrorHandler, nfCommon, nfDialog, nfClient, nfCanvasUtils, nfNgBridge, nfRemoteProcessGroup) { + return (nf.RemoteProcessGroupPorts = factory($, d3, nfErrorHandler, nfCommon, nfDialog, nfClient, nfCanvasUtils, nfNgBridge, nfRemoteProcessGroup)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.RemoteProcessGroupPorts = @@ -53,7 +53,7 @@ root.nf.ng.Bridge, root.nf.RemoteProcessGroup); } -}(this, function ($, d3, errorHandler, common, dialog, client, canvasUtils, angularBridge, nfRemoteProcessGroup) { +}(this, function ($, d3, nfErrorHandler, nfCommon, nfDialog, nfClient, nfCanvasUtils, nfNgBridge, nfRemoteProcessGroup) { 'use strict'; /** @@ -82,7 +82,7 @@ // create the remote process group details var remoteProcessGroupPortEntity = { - 'revision': client.getRevision(remoteProcessGroupData), + 'revision': nfClient.getRevision(remoteProcessGroupData), 'remoteProcessGroupPort': { id: remotePortId, groupId: remoteProcessGroupId, @@ -129,22 +129,22 @@ if (errors.length === 1) { content = $('<span></span>').text(errors[0]); } else { - content = common.formatUnorderedList(errors); + content = nfCommon.formatUnorderedList(errors); } - dialog.showOkDialog({ + nfDialog.showOkDialog({ dialogContent: content, headerText: 'Remote Process Group Ports' }); } else { - errorHandler.handleAjaxError(xhr, status, error); + nfErrorHandler.handleAjaxError(xhr, status, error); } }).always(function () { // close the dialog $('#remote-port-configuration').modal('hide'); }); } else { - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Remote Process Group Ports', dialogContent: 'Concurrent tasks must be an integer value.' }); @@ -202,7 +202,7 @@ var remoteProcessGroupData = remoteProcessGroup.datum(); // if can modify, the over status of this node may have changed - if (canvasUtils.canModify(remoteProcessGroup)) { + if (nfCanvasUtils.canModify(remoteProcessGroup)) { // reload the remote process group nfRemoteProcessGroup.reload(remoteProcessGroupData.id); } @@ -221,8 +221,8 @@ // clear any tooltips var dialog = $('#remote-process-group-ports'); - common.cleanUpTooltips(dialog, 'div.remote-port-removed'); - common.cleanUpTooltips(dialog, 'div.concurrent-tasks-info'); + nfCommon.cleanUpTooltips(dialog, 'div.remote-port-removed'); + nfCommon.cleanUpTooltips(dialog, 'div.concurrent-tasks-info'); // clear the input and output ports $('#remote-process-group-input-ports-container').empty(); @@ -240,7 +240,7 @@ * @argument {string} portType The type of port */ var createPortOption = function (container, port, portType) { - var portId = common.escapeHtml(port.id); + var portId = nfCommon.escapeHtml(port.id); var portContainer = $('<div class="remote-port-container"></div>').appendTo(container); var portContainerEditContainer = $('<div class="remote-port-edit-container"></div>').appendTo(portContainer); var portContainerDetailsContainer = $('<div class="remote-port-details-container"></div>').appendTo(portContainer); @@ -250,25 +250,25 @@ var remoteProcessGroup = d3.select('#id-' + remoteProcessGroupId); // if can modify, support updating the remote group port - if (canvasUtils.canModify(remoteProcessGroup)) { + if (nfCanvasUtils.canModify(remoteProcessGroup)) { // show the enabled transmission switch var transmissionSwitch; if (port.connected === true) { if (port.transmitting === true) { - transmissionSwitch = (angularBridge.injector.get('$compile')($('<md-switch style="margin:0px" class="md-primary enabled-active-transmission" aria-label="Toggle port transmission"></md-switch>'))(angularBridge.rootScope)).appendTo(portContainerEditContainer); + transmissionSwitch = (nfNgBridge.injector.get('$compile')($('<md-switch style="margin:0px" class="md-primary enabled-active-transmission" aria-label="Toggle port transmission"></md-switch>'))(nfNgBridge.rootScope)).appendTo(portContainerEditContainer); transmissionSwitch.click(); } else { if (port.exists === true) { - transmissionSwitch = (angularBridge.injector.get('$compile')($('<md-switch style="margin:0px" class="md-primary enabled-inactive-transmission" aria-label="Toggle port transmission"></md-switch>'))(angularBridge.rootScope)).appendTo(portContainerEditContainer); + transmissionSwitch = (nfNgBridge.injector.get('$compile')($('<md-switch style="margin:0px" class="md-primary enabled-inactive-transmission" aria-label="Toggle port transmission"></md-switch>'))(nfNgBridge.rootScope)).appendTo(portContainerEditContainer); } else { - (angularBridge.injector.get('$compile')($('<md-switch ng-disabled="true" style="margin:0px" class="md-primary disabled-inactive-transmission" aria-label="Toggle port transmission"></md-switch>'))(angularBridge.rootScope)).appendTo(portContainerEditContainer); + (nfNgBridge.injector.get('$compile')($('<md-switch ng-disabled="true" style="margin:0px" class="md-primary disabled-inactive-transmission" aria-label="Toggle port transmission"></md-switch>'))(nfNgBridge.rootScope)).appendTo(portContainerEditContainer); } } } else { if (port.transmitting === true) { - (angularBridge.injector.get('$compile')($('<md-switch style="margin:0px" class="md-primary disabled-active-transmission" aria-label="Toggle port transmission"></md-switch>'))(angularBridge.rootScope)).appendTo(portContainerEditContainer); + (nfNgBridge.injector.get('$compile')($('<md-switch style="margin:0px" class="md-primary disabled-active-transmission" aria-label="Toggle port transmission"></md-switch>'))(nfNgBridge.rootScope)).appendTo(portContainerEditContainer); } else { - (angularBridge.injector.get('$compile')($('<md-switch ng-disabled="true" style="margin:0px" class="md-primary disabled-inactive-transmission" aria-label="Toggle port transmission"></md-switch>'))(angularBridge.rootScope)).appendTo(portContainerEditContainer); + (nfNgBridge.injector.get('$compile')($('<md-switch ng-disabled="true" style="margin:0px" class="md-primary disabled-inactive-transmission" aria-label="Toggle port transmission"></md-switch>'))(nfNgBridge.rootScope)).appendTo(portContainerEditContainer); } } @@ -292,14 +292,14 @@ } } else if (port.exists === false) { $('<div class="remote-port-removed"/>').appendTo(portContainerEditContainer).qtip($.extend({}, - common.config.tooltipConfig, + nfCommon.config.tooltipConfig, { content: 'This port has been removed.' })); } // only allow modifications to transmission when the swtich is defined - if (common.isDefinedAndNotNull(transmissionSwitch)) { + if (nfCommon.isDefinedAndNotNull(transmissionSwitch)) { // create toggle for changing transmission state transmissionSwitch.click(function () { // get the component being edited @@ -314,7 +314,7 @@ // create the remote process group details var remoteProcessGroupPortEntity = { - 'revision': client.getRevision(remoteProcessGroupData), + 'revision': nfClient.getRevision(remoteProcessGroupData), 'remoteProcessGroupPort': { id: port.id, groupId: remoteProcessGroupId, @@ -349,7 +349,7 @@ transmissionSwitch.removeClass('enabled-active-transmission enabled-inactive-transmission').addClass('disabled-inactive-transmission').off('click'); // hide the edit button - if (common.isDefinedAndNotNull(editRemotePort)) { + if (nfCommon.isDefinedAndNotNull(editRemotePort)) { editRemotePort.hide(); } } else { @@ -359,7 +359,7 @@ transmissionSwitch.removeClass('enabled-active-transmission enabled-inactive-transmission').addClass('enabled-active-transmission'); // hide the edit button - if (common.isDefinedAndNotNull(editRemotePort)) { + if (nfCommon.isDefinedAndNotNull(editRemotePort)) { editRemotePort.hide(); } } else { @@ -367,7 +367,7 @@ transmissionSwitch.removeClass('enabled-active-transmission enabled-inactive-transmission').addClass('enabled-inactive-transmission'); // show the edit button - if (common.isDefinedAndNotNull(editRemotePort)) { + if (nfCommon.isDefinedAndNotNull(editRemotePort)) { editRemotePort.show(); } } @@ -380,15 +380,15 @@ if (errors.length === 1) { content = $('<span></span>').text(errors[0]); } else { - content = common.formatUnorderedList(errors); + content = nfCommon.formatUnorderedList(errors); } - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Remote Process Group Ports', dialogContent: content }); } else { - errorHandler.handleAjaxError(xhr, status, error); + nfErrorHandler.handleAjaxError(xhr, status, error); } }); }); @@ -396,9 +396,9 @@ } else { // show the disabled transmission switch if (port.transmitting === true) { - (angularBridge.injector.get('$compile')($('<md-switch style="margin:0px" class="md-primary disabled-active-transmission" aria-label="Toggle port transmission"></md-switch>'))(angularBridge.rootScope)).appendTo(portContainerEditContainer); + (nfNgBridge.injector.get('$compile')($('<md-switch style="margin:0px" class="md-primary disabled-active-transmission" aria-label="Toggle port transmission"></md-switch>'))(nfNgBridge.rootScope)).appendTo(portContainerEditContainer); } else { - (angularBridge.injector.get('$compile')($('<md-switch ng-disabled="true" style="margin:0px" class="md-primary disabled-inactive-transmission" aria-label="Toggle port transmission"></md-switch>'))(angularBridge.rootScope)).appendTo(portContainerEditContainer); + (nfNgBridge.injector.get('$compile')($('<md-switch ng-disabled="true" style="margin:0px" class="md-primary disabled-inactive-transmission" aria-label="Toggle port transmission"></md-switch>'))(nfNgBridge.rootScope)).appendTo(portContainerEditContainer); } } @@ -410,7 +410,7 @@ $('<div class="clear"></div>').appendTo(portContainerDetailsContainer); // add the comments for this port - if (common.isBlank(port.comments)) { + if (nfCommon.isBlank(port.comments)) { $('<div class="remote-port-description unset">No description specified.</div>').appendTo(portContainerDetailsContainer); } else { $('<div class="remote-port-description"></div>').text(port.comments).appendTo(portContainerDetailsContainer); @@ -431,7 +431,7 @@ '<div class="processor-setting concurrent-tasks-info fa fa-question-circle"></div>' + '</div>' + '</div>').append(concurrentTasks).appendTo(concurrentTasksContainer).find('div.concurrent-tasks-info').qtip($.extend({}, - common.config.tooltipConfig, + nfCommon.config.tooltipConfig, { content: 'The number of tasks that should be concurrently scheduled for this port.' })); @@ -461,7 +461,7 @@ portContainer.find('.ellipsis').ellipsis(); // inform Angular app values have changed - angularBridge.digest(); + nfNgBridge.digest(); }; /** @@ -506,7 +506,7 @@ */ showPorts: function (selection) { // if the specified component is a remote process group, load its properties - if (canvasUtils.isRemoteProcessGroup(selection)) { + if (nfCanvasUtils.isRemoteProcessGroup(selection)) { var selectionData = selection.datum(); // load the properties for the specified component @@ -527,7 +527,7 @@ // get the contents var remoteProcessGroupContents = remoteProcessGroup.contents; - if (common.isDefinedAndNotNull(remoteProcessGroupContents)) { + if (nfCommon.isDefinedAndNotNull(remoteProcessGroupContents)) { var connectedInputPorts = []; var disconnectedInputPorts = []; @@ -551,7 +551,7 @@ createPortOption(inputPortContainer, inputPort, 'input'); }); - if (common.isEmpty(connectedInputPorts) && common.isEmpty(disconnectedInputPorts)) { + if (nfCommon.isEmpty(connectedInputPorts) && nfCommon.isEmpty(disconnectedInputPorts)) { $('<div class="unset"></div>').text("No ports to display").appendTo(inputPortContainer); } @@ -578,14 +578,14 @@ createPortOption(outputPortContainer, outputPort, 'output'); }); - if (common.isEmpty(connectedOutputPorts) && common.isEmpty(disconnectedOutputPorts)) { + if (nfCommon.isEmpty(connectedOutputPorts) && nfCommon.isEmpty(disconnectedOutputPorts)) { $('<div class="unset"></div>').text("No ports to display").appendTo(outputPortContainer); } } // show the details $('#remote-process-group-ports').modal('show'); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); } } }; http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group.js ---------------------------------------------------------------------- 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 f487ca4..9842c71 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 @@ -25,8 +25,8 @@ 'nf.Common', 'nf.Client', 'nf.CanvasUtils'], - function ($, d3, connection, common, client, canvasUtils) { - return (nf.RemoteProcessGroup = factory($, d3, connection, common, client, canvasUtils)); + function ($, d3, nfConnection, nfCommon, nfClient, nfCanvasUtils) { + return (nf.RemoteProcessGroup = factory($, d3, nfConnection, nfCommon, nfClient, nfCanvasUtils)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.RemoteProcessGroup = @@ -44,7 +44,7 @@ root.nf.Client, root.nf.CanvasUtils); } -}(this, function ($, d3, connection, common, client, canvasUtils) { +}(this, function ($, d3, nfConnection, nfCommon, nfClient, nfCanvasUtils) { 'use strict'; var nfConnectable; @@ -88,7 +88,7 @@ * @param {object} d */ var getProcessGroupComments = function (d) { - if (common.isBlank(d.component.comments)) { + if (nfCommon.isBlank(d.component.comments)) { return 'No comments specified'; } else { return d.component.comments; @@ -123,7 +123,7 @@ 'class': 'remote-process-group component' }) .classed('selected', selected) - .call(canvasUtils.position); + .call(nfCanvasUtils.position); // ---- // body @@ -211,7 +211,7 @@ var details = remoteProcessGroup.select('g.remote-process-group-details'); // update the component behavior as appropriate - canvasUtils.editable(remoteProcessGroup, nfConnectable, nfDraggable); + nfCanvasUtils.editable(remoteProcessGroup, nfConnectable, nfDraggable); // if this processor is visible, render everything if (remoteProcessGroup.classed('visible')) { @@ -532,7 +532,7 @@ remoteProcessGroupUri.text(null).selectAll('title').remove(); // apply ellipsis to the remote process group name as necessary - canvasUtils.ellipsis(remoteProcessGroupUri, d.component.targetUris); + nfCanvasUtils.ellipsis(remoteProcessGroupUri, d.component.targetUris); }).append('title').text(function (d) { return d.component.name; }); @@ -571,7 +571,7 @@ }); // add the tooltip - canvasUtils.canvasTooltip(tip, d3.select(this)); + nfCanvasUtils.canvasTooltip(tip, d3.select(this)); }); // --------------- @@ -587,9 +587,9 @@ remoteProcessGroupComments.text(null).selectAll('tspan, title').remove(); // apply ellipsis to the port name as necessary - canvasUtils.ellipsis(remoteProcessGroupComments, getProcessGroupComments(d)); + nfCanvasUtils.ellipsis(remoteProcessGroupComments, getProcessGroupComments(d)); }).classed('unset', function (d) { - return common.isBlank(d.component.comments); + return nfCommon.isBlank(d.component.comments); }).append('title').text(function (d) { return getProcessGroupComments(d); }); @@ -600,7 +600,7 @@ details.select('text.remote-process-group-last-refresh') .text(function (d) { - if (common.isDefinedAndNotNull(d.component.flowRefreshed)) { + if (nfCommon.isDefinedAndNotNull(d.component.flowRefreshed)) { return d.component.flowRefreshed; } else { return 'Remote flow not current'; @@ -616,7 +616,7 @@ remoteProcessGroupName.text(null).selectAll('title').remove(); // apply ellipsis to the remote process group name as necessary - canvasUtils.ellipsis(remoteProcessGroupName, d.component.name); + nfCanvasUtils.ellipsis(remoteProcessGroupName, d.component.name); }).append('title').text(function (d) { return d.component.name; }); @@ -680,13 +680,13 @@ // sent count value updated.select('text.remote-process-group-sent tspan.count') .text(function (d) { - return common.substringBeforeFirst(d.status.aggregateSnapshot.sent, ' '); + return nfCommon.substringBeforeFirst(d.status.aggregateSnapshot.sent, ' '); }); // sent size value updated.select('text.remote-process-group-sent tspan.size') .text(function (d) { - return ' ' + common.substringAfterFirst(d.status.aggregateSnapshot.sent, ' '); + return ' ' + nfCommon.substringAfterFirst(d.status.aggregateSnapshot.sent, ' '); }); // sent ports value @@ -704,13 +704,13 @@ // received count value updated.select('text.remote-process-group-received tspan.count') .text(function (d) { - return common.substringBeforeFirst(d.status.aggregateSnapshot.received, ' '); + return nfCommon.substringBeforeFirst(d.status.aggregateSnapshot.received, ' '); }); // received size value updated.select('text.remote-process-group-received tspan.size') .text(function (d) { - return ' ' + common.substringAfterFirst(d.status.aggregateSnapshot.received, ' '); + return ' ' + nfCommon.substringAfterFirst(d.status.aggregateSnapshot.received, ' '); }); // -------------------- @@ -723,7 +723,7 @@ .text(function (d) { var icon = ''; if (d.permissions.canRead) { - if (!common.isEmpty(d.component.authorizationIssues)) { + if (!nfCommon.isEmpty(d.component.authorizationIssues)) { icon = '\uf071'; } else if (d.component.transmitting === true) { icon = '\uf140'; @@ -736,7 +736,7 @@ .attr('font-family', function (d) { var family = ''; if (d.permissions.canRead) { - if (!common.isEmpty(d.component.authorizationIssues) || d.component.transmitting) { + if (!nfCommon.isEmpty(d.component.authorizationIssues) || d.component.transmitting) { family = 'FontAwesome'; } else { family = 'flowfont'; @@ -745,20 +745,20 @@ return family; }) .classed('invalid', function (d) { - return d.permissions.canRead && !common.isEmpty(d.component.authorizationIssues); + return d.permissions.canRead && !nfCommon.isEmpty(d.component.authorizationIssues); }) .classed('transmitting', function (d) { - return d.permissions.canRead && common.isEmpty(d.component.authorizationIssues) && d.component.transmitting === true; + return d.permissions.canRead && nfCommon.isEmpty(d.component.authorizationIssues) && d.component.transmitting === true; }) .classed('not-transmitting', function (d) { - return d.permissions.canRead && common.isEmpty(d.component.authorizationIssues) && d.component.transmitting === false; + return d.permissions.canRead && nfCommon.isEmpty(d.component.authorizationIssues) && d.component.transmitting === false; }) .each(function (d) { // get the tip var tip = d3.select('#authorization-issues-' + d.id); // if there are validation errors generate a tooltip - if (d.permissions.canRead && !common.isEmpty(d.component.authorizationIssues)) { + if (d.permissions.canRead && !nfCommon.isEmpty(d.component.authorizationIssues)) { // create the tip if necessary if (tip.empty()) { tip = d3.select('#remote-process-group-tooltips').append('div') @@ -770,7 +770,7 @@ // update the tip tip.html(function () { - var list = common.formatUnorderedList(d.component.authorizationIssues); + var list = nfCommon.formatUnorderedList(d.component.authorizationIssues); if (list === null || list.length === 0) { return ''; } else { @@ -779,7 +779,7 @@ }); // add the tooltip - canvasUtils.canvasTooltip(tip, d3.select(this)); + nfCanvasUtils.canvasTooltip(tip, d3.select(this)); } else { if (!tip.empty()) { tip.remove(); @@ -795,7 +795,7 @@ // active thread count // ------------------- - canvasUtils.activeThreadCount(remoteProcessGroup, d, function (off) { + nfCanvasUtils.activeThreadCount(remoteProcessGroup, d, function (off) { offset = off; }); @@ -804,10 +804,10 @@ // --------- remoteProcessGroup.select('rect.bulletin-background').classed('has-bulletins', function () { - return !common.isEmpty(d.status.aggregateSnapshot.bulletins); + return !nfCommon.isEmpty(d.status.aggregateSnapshot.bulletins); }); - canvasUtils.bulletins(remoteProcessGroup, d, function () { + nfCanvasUtils.bulletins(remoteProcessGroup, d, function () { return d3.select('#remote-process-group-tooltips'); }, offset); }); @@ -843,12 +843,17 @@ var nfRemoteProcessGroup = { /** * Initializes of the Process Group handler. + * + * @param nfConnectableRef The nfConnectable module. + * @param nfDraggableRef The nfDraggable module. + * @param nfSelectableRef The nfSelectable module. + * @param nfContextMenuRef The nfContextMenu module. */ - init: function (connectable, draggable, selectable, contextMenu) { - nfConnectable = connectable; - nfDraggable = draggable; - nfSelectable = selectable; - nfContextMenu = contextMenu; + init: function (nfConnectableRef, nfDraggableRef, nfSelectableRef, nfContextMenuRef) { + nfConnectable = nfConnectableRef; + nfDraggable = nfDraggableRef; + nfSelectable = nfSelectableRef; + nfContextMenu = nfContextMenuRef; remoteProcessGroupMap = d3.map(); removedCache = d3.map(); @@ -870,8 +875,8 @@ */ add: function (remoteProcessGroupEntities, options) { var selectAll = false; - if (common.isDefinedAndNotNull(options)) { - selectAll = common.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll; + if (nfCommon.isDefinedAndNotNull(options)) { + selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll; } // get the current time @@ -892,7 +897,7 @@ $.each(remoteProcessGroupEntities, function (_, remoteProcessGroupEntity) { add(remoteProcessGroupEntity); }); - } else if (common.isDefinedAndNotNull(remoteProcessGroupEntities)) { + } else if (nfCommon.isDefinedAndNotNull(remoteProcessGroupEntities)) { add(remoteProcessGroupEntities); } @@ -911,16 +916,16 @@ set: function (remoteProcessGroupEntities, options) { var selectAll = false; var transition = false; - if (common.isDefinedAndNotNull(options)) { - selectAll = common.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll; - transition = common.isDefinedAndNotNull(options.transition) ? options.transition : transition; + if (nfCommon.isDefinedAndNotNull(options)) { + selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll; + transition = nfCommon.isDefinedAndNotNull(options.transition) ? options.transition : transition; } 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 (client.isNewerRevision(currentRemoteProcessGroupEntity, proposedRemoteProcessGroupEntity) && !removedCache.has(proposedRemoteProcessGroupEntity.id)) { + if (nfClient.isNewerRevision(currentRemoteProcessGroupEntity, proposedRemoteProcessGroupEntity) && !removedCache.has(proposedRemoteProcessGroupEntity.id)) { remoteProcessGroupMap.set(proposedRemoteProcessGroupEntity.id, $.extend({ type: 'RemoteProcessGroup', dimensions: dimensions @@ -944,14 +949,14 @@ $.each(remoteProcessGroupEntities, function (_, remoteProcessGroupEntity) { set(remoteProcessGroupEntity); }); - } else if (common.isDefinedAndNotNull(remoteProcessGroupEntities)) { + } else if (nfCommon.isDefinedAndNotNull(remoteProcessGroupEntities)) { set(remoteProcessGroupEntities); } // apply the selection and handle all new remote process groups var selection = select(); selection.enter().call(renderRemoteProcessGroups, selectAll); - selection.call(updateRemoteProcessGroups).call(canvasUtils.position, transition); + selection.call(updateRemoteProcessGroups).call(nfCanvasUtils.position, transition); selection.exit().call(removeRemoteProcessGroups); }, @@ -962,7 +967,7 @@ * @param {string} id */ get: function (id) { - if (common.isUndefined(id)) { + if (nfCommon.isUndefined(id)) { return remoteProcessGroupMap.values(); } else { return remoteProcessGroupMap.get(id); @@ -976,7 +981,7 @@ * @param {string} id Optional */ refresh: function (id) { - if (common.isDefinedAndNotNull(id)) { + if (nfCommon.isDefinedAndNotNull(id)) { d3.select('#id-' + id).call(updateRemoteProcessGroups); } else { d3.selectAll('g.remote-process-group').call(updateRemoteProcessGroups); @@ -1007,10 +1012,10 @@ nfRemoteProcessGroup.set(response); // reload the group's connections - var connections = connection.getComponentConnections(id); + var connections = nfConnection.getComponentConnections(id); $.each(connections, function (_, connection) { if (connection.permissions.canRead) { - connection.reload(connection.id); + nfConnection.reload(connection.id); } }); }); @@ -1023,7 +1028,7 @@ * @param {string} id The id */ position: function (id) { - d3.select('#id-' + id).call(canvasUtils.position); + d3.select('#id-' + id).call(nfCanvasUtils.position); }, /** http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-reporting-task.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-reporting-task.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-reporting-task.js index 88f6fb4..bb1b07c 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-reporting-task.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-reporting-task.js @@ -28,8 +28,8 @@ 'nf.ControllerServices', 'nf.UniversalCapture', 'nf.CustomUi'], - function ($, errorHandler, common, dialog, client, controllerService, controllerServices, universalCapture, customUi) { - return (nf.ReportingTask = factory($, errorHandler, common, dialog, client, controllerService, controllerServices, universalCapture, customUi)); + function ($, nfErrorHandler, nfCommon, nfDialog, nfClient, nfControllerService, nfControllerServices, nfUniversalCapture, nfCustomUi) { + return (nf.ReportingTask = factory($, nfErrorHandler, nfCommon, nfDialog, nfClient, nfControllerService, nfControllerServices, nfUniversalCapture, nfCustomUi)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ReportingTask = @@ -53,7 +53,7 @@ root.nf.UniversalCapture, root.nf.CustomUi); } -}(this, function ($, errorHandler, common, dialog, client, controllerService, controllerServices, universalCapture, customUi) { +}(this, function ($, nfErrorHandler, nfCommon, nfDialog, nfClient, nfControllerService, nfControllerServices, nfUniversalCapture, nfCustomUi) { 'use strict'; var nfSettings; @@ -93,15 +93,15 @@ if (errors.length === 1) { content = $('<span></span>').text(errors[0]); } else { - content = common.formatUnorderedList(errors); + content = nfCommon.formatUnorderedList(errors); } - dialog.showOkDialog({ + nfDialog.showOkDialog({ dialogContent: content, headerText: 'Reporting Task' }); } else { - errorHandler.handleAjaxError(xhr, status, error); + nfErrorHandler.handleAjaxError(xhr, status, error); } }; @@ -141,7 +141,7 @@ } // check the scheduling period - if (common.isDefinedAndNotNull(schedulingPeriod) && schedulingPeriod.val() !== (entity.component['schedulingPeriod'] + '')) { + if (nfCommon.isDefinedAndNotNull(schedulingPeriod) && schedulingPeriod.val() !== (entity.component['schedulingPeriod'] + '')) { return true; } @@ -204,13 +204,13 @@ var errors = []; var reportingTask = details['component']; - if (common.isBlank(reportingTask['schedulingPeriod'])) { + if (nfCommon.isBlank(reportingTask['schedulingPeriod'])) { errors.push('Run schedule must be specified'); } if (errors.length > 0) { - dialog.showOkDialog({ - dialogContent: common.formatUnorderedList(errors), + nfDialog.showOkDialog({ + dialogContent: nfCommon.formatUnorderedList(errors), headerText: 'Reporting Task' }); return false; @@ -241,7 +241,7 @@ */ var setRunning = function (reportingTaskEntity, running) { var entity = { - 'revision': client.getRevision(reportingTaskEntity), + 'revision': nfClient.getRevision(reportingTaskEntity), 'component': { 'id': reportingTaskEntity.id, 'state': running === true ? 'RUNNING' : 'STOPPED' @@ -257,8 +257,8 @@ }).done(function (response) { // update the task renderReportingTask(response); - controllerService.reloadReferencedServices(getControllerServicesTable(), response.component); - }).fail(errorHandler.handleAjaxError); + nfControllerService.reloadReferencedServices(getControllerServicesTable(), response.component); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -272,7 +272,7 @@ // determine if changes have been made if (isSaveRequired()) { // see if those changes should be saved - dialog.showYesNoDialog({ + nfDialog.showYesNoDialog({ headerText: 'Save', dialogContent: 'Save changes before going to this Controller Service?', noHandler: function () { @@ -304,7 +304,7 @@ // ensure details are valid as far as we can tell if (validateDetails(updatedReportingTask)) { - updatedReportingTask['revision'] = client.getRevision(reportingTaskEntity); + updatedReportingTask['revision'] = nfClient.getRevision(reportingTaskEntity); // update the selected component return $.ajax({ @@ -338,15 +338,17 @@ propertyName: propertyName }, dataType: 'json' - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }; var nfReportingTask = { /** * Initializes the reporting task configuration dialog. + * + * @param nfSettingsRef The nfSettings module. */ - init: function (settings) { - nfSettings = settings; + init: function (nfSettingsRef) { + nfSettings = nfSettingsRef; // initialize the configuration dialog tabs $('#reporting-task-configuration-tabs').tabbs({ @@ -365,7 +367,7 @@ }], select: function () { // remove all property detail dialogs - universalCapture.removeAllPropertyDetailDialogs(); + nfUniversalCapture.removeAllPropertyDetailDialogs(); // update the property table size in case this is the first time its rendered if ($(this).text() === 'Properties') { @@ -390,13 +392,13 @@ $('#reporting-task-properties').propertytable('clear'); // clear the comments - common.clearField('read-only-reporting-task-comments'); + nfCommon.clearField('read-only-reporting-task-comments'); // removed the cached reporting task details $('#reporting-task-configuration').removeData('reportingTaskDetails'); }, open: function () { - common.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0)); + nfCommon.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0)); } } }); @@ -408,7 +410,7 @@ dialogContainer: '#new-reporting-task-property-container', descriptorDeferred: getReportingTaskPropertyDescriptor, controllerServiceCreatedDeferred: function (response) { - return controllerServices.loadControllerServices(controllerServicesUri, $('#controller-services-table')); + return nfControllerServices.loadControllerServices(controllerServicesUri, $('#controller-services-table')); }, goToServiceDeferred: goToServiceFromProperty }); @@ -433,7 +435,7 @@ dialogContainer: '#new-reporting-task-property-container', descriptorDeferred: getReportingTaskPropertyDescriptor, controllerServiceCreatedDeferred: function (response) { - return controllerServices.loadControllerServices(controllerServicesUri, $('#controller-services-table')); + return nfControllerServices.loadControllerServices(controllerServicesUri, $('#controller-services-table')); }, goToServiceDeferred: goToServiceFromProperty }); @@ -475,8 +477,8 @@ } // populate the reporting task settings - common.populateField('reporting-task-id', reportingTask['id']); - common.populateField('reporting-task-type', common.substringAfterLast(reportingTask['type'], '.')); + nfCommon.populateField('reporting-task-id', reportingTask['id']); + nfCommon.populateField('reporting-task-type', nfCommon.substringAfterLast(reportingTask['type'], '.')); $('#reporting-task-name').val(reportingTask['name']); $('#reporting-task-enabled').removeClass('checkbox-unchecked checkbox-checked').addClass(reportingTaskEnableStyle); $('#reporting-task-comments').val(reportingTask['comments']); @@ -533,7 +535,7 @@ // save the reporting task saveReportingTask(reportingTaskEntity).done(function (response) { // reload the reporting task - controllerService.reloadReferencedServices(getControllerServicesTable(), response.component); + nfControllerService.reloadReferencedServices(getControllerServicesTable(), response.component); // close the details panel $('#reporting-task-configuration').modal('hide'); @@ -556,7 +558,7 @@ }]; // determine if we should show the advanced button - if (common.isDefinedAndNotNull(reportingTask.customUiUrl) && reportingTask.customUiUrl !== '') { + if (nfCommon.isDefinedAndNotNull(reportingTask.customUiUrl) && reportingTask.customUiUrl !== '') { buttons.push({ buttonText: 'Advanced', clazz: 'fa fa-cog button-icon', @@ -575,10 +577,10 @@ $('#shell-close-button').click(); // show the custom ui - customUi.showCustomUi(reportingTaskEntity, reportingTask.customUiUrl, true).done(function () { + nfCustomUi.showCustomUi(reportingTaskEntity, reportingTask.customUiUrl, true).done(function () { // once the custom ui is closed, reload the reporting task nfReportingTask.reload(reportingTaskEntity.id).done(function (response) { - controllerService.reloadReferencedServices(getControllerServicesTable(), response.reportingTask); + nfControllerService.reloadReferencedServices(getControllerServicesTable(), response.reportingTask); }); // show the settings @@ -592,7 +594,7 @@ // determine if changes have been made if (isSaveRequired()) { // see if those changes should be saved - dialog.showYesNoDialog({ + nfDialog.showYesNoDialog({ headerText: 'Save', dialogContent: 'Save changes before opening the advanced configuration?', noHandler: openCustomUi, @@ -624,7 +626,7 @@ $('#reporting-task-configuration').modal('show'); $('#reporting-task-properties').propertytable('resetTableSize'); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }, /** @@ -673,10 +675,10 @@ var reportingTaskHistory = historyResponse[0].componentHistory; // populate the reporting task settings - common.populateField('reporting-task-id', reportingTask['id']); - common.populateField('reporting-task-type', common.substringAfterLast(reportingTask['type'], '.')); - common.populateField('read-only-reporting-task-name', reportingTask['name']); - common.populateField('read-only-reporting-task-comments', reportingTask['comments']); + nfCommon.populateField('reporting-task-id', reportingTask['id']); + nfCommon.populateField('reporting-task-type', nfCommon.substringAfterLast(reportingTask['type'], '.')); + nfCommon.populateField('read-only-reporting-task-name', reportingTask['name']); + nfCommon.populateField('read-only-reporting-task-comments', reportingTask['comments']); // make the scheduling strategy human readable var schedulingStrategy = reportingTask['schedulingStrategy']; @@ -685,8 +687,8 @@ } else { schedulingStrategy = "Timer driven"; } - common.populateField('read-only-reporting-task-scheduling-strategy', schedulingStrategy); - common.populateField('read-only-reporting-task-scheduling-period', reportingTask['schedulingPeriod']); + nfCommon.populateField('read-only-reporting-task-scheduling-strategy', schedulingStrategy); + nfCommon.populateField('read-only-reporting-task-scheduling-period', reportingTask['schedulingPeriod']); var buttons = [{ buttonText: 'Ok', @@ -704,7 +706,7 @@ }]; // determine if we should show the advanced button - if (common.isDefinedAndNotNull(customUi) && common.isDefinedAndNotNull(reportingTask.customUiUrl) && reportingTask.customUiUrl !== '') { + if (nfCommon.isDefinedAndNotNull(nfCustomUi) && nfCommon.isDefinedAndNotNull(reportingTask.customUiUrl) && reportingTask.customUiUrl !== '') { buttons.push({ buttonText: 'Advanced', clazz: 'fa fa-cog button-icon', @@ -722,7 +724,7 @@ $('#shell-close-button').click(); // show the custom ui - customUi.showCustomUi(reportingTaskEntity, reportingTask.customUiUrl, false).done(function () { + nfCustomUi.showCustomUi(reportingTaskEntity, reportingTask.customUiUrl, false).done(function () { nfSettings.showSettings(); }); } @@ -777,7 +779,7 @@ dataType: 'json' }).done(function (response) { renderReportingTask(response); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }, /** @@ -787,9 +789,9 @@ */ promptToDeleteReportingTask: function (reportingTaskEntity) { // prompt for deletion - dialog.showYesNoDialog({ + nfDialog.showYesNoDialog({ headerText: 'Delete Reporting Task', - dialogContent: 'Delete reporting task \'' + common.escapeHtml(reportingTaskEntity.component.name) + '\'?', + dialogContent: 'Delete reporting task \'' + nfCommon.escapeHtml(reportingTaskEntity.component.name) + '\'?', yesHandler: function () { nfReportingTask.remove(reportingTaskEntity); } @@ -804,7 +806,7 @@ remove: function (reportingTaskEntity) { // prompt for removal? - var revision = client.getRevision(reportingTaskEntity); + var revision = nfClient.getRevision(reportingTaskEntity); $.ajax({ type: 'DELETE', url: reportingTaskEntity.uri + '?' + $.param({ @@ -817,7 +819,7 @@ var reportingTaskGrid = $('#reporting-tasks-table').data('gridInstance'); var reportingTaskData = reportingTaskGrid.getData(); reportingTaskData.deleteItem(reportingTaskEntity.id); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); } }; http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-selectable.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-selectable.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-selectable.js index d418b01..c8b5179 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-selectable.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-selectable.js @@ -22,8 +22,8 @@ define(['d3', 'nf.ng.Bridge', 'nf.ContextMenu'], - function (d3, angularBridge, contextMenu) { - return (nf.Selectable = factory(d3, angularBridge, contextMenu)); + function (d3, nfNgBridge, nfContextMenu) { + return (nf.Selectable = factory(d3, nfNgBridge, nfContextMenu)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.Selectable = @@ -35,14 +35,14 @@ root.nf.ng.Bridge, root.nf.ContextMenu); } -}(this, function (d3, angularBridge, contextMenu) { +}(this, function (d3, nfNgBridge, nfContextMenu) { 'use strict'; var nfSelectable = { select: function (g) { // hide any context menus as necessary - contextMenu.hide(); + nfContextMenu.hide(); // only need to update selection if necessary if (!g.classed('selected')) { @@ -62,7 +62,7 @@ // inform Angular app that values have changed since the // enabled operate palette buttons are based off of the selection - angularBridge.digest(); + nfNgBridge.digest(); // stop propagation d3.event.stopPropagation();
