Repository: nifi Updated Branches: refs/heads/master 2e1b87fa4 -> bf3b1640f
http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js index 0a19a7e..d2566e1 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js @@ -15,9 +15,59 @@ * limitations under the License. */ -/* global nf, Slick, d3 */ +/* global define, module, require, exports */ + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + define(['jquery', + 'Slick', + 'd3', + 'nf.Client', + 'nf.Dialog', + 'nf.Common', + 'nf.CanvasUtils', + 'nf.ControllerServices', + 'nf.ErrorHandler', + 'nf.ReportingTask', + 'nf.Shell', + 'nf.ComponentState', + 'nf.PolicyManagement'], + function ($, Slick, d3, client, dialog, common, canvasUtils, controllerServices, errorHandler, reportingTask, shell, componentState, policyManagement) { + return (nf.Settings = factory($, Slick, d3, client, dialog, common, canvasUtils, controllerServices, errorHandler, reportingTask, shell, componentState, policyManagement)); + }); + } else if (typeof exports === 'object' && typeof module === 'object') { + module.exports = (nf.Settings = + factory(require('jquery'), + require('Slick'), + require('d3'), + require('nf.Client'), + require('nf.Dialog'), + require('nf.Common'), + require('nf.CanvasUtils'), + require('nf.ControllerServices'), + require('nf.ErrorHandler'), + require('nf.ReportingTask'), + require('nf.Shell'), + require('nf.ComponentState'), + require('nf.PolicyManagement'))); + } else { + nf.Settings = factory(root.$, + root.Slick, + root.d3, + root.nf.Client, + root.nf.Dialog, + root.nf.Common, + root.nf.CanvasUtils, + root.nf.ControllerServices, + root.nf.ErrorHandler, + root.nf.ReportingTask, + root.nf.Shell, + root.nf.ComponentState, + root.nf.PolicyManagement); + } +}(this, function ($, Slick, d3, client, dialog, common, canvasUtils, controllerServices, errorHandler, reportingTask, shell, componentState, policyManagement) { + 'use strict'; -nf.Settings = (function () { var config = { urls: { @@ -57,7 +107,7 @@ nf.Settings = (function () { // marshal the configuration details var configuration = marshalConfiguration(); var entity = { - 'revision': nf.Client.getRevision({ + 'revision': client.getRevision({ 'revision': { 'version': version } @@ -74,7 +124,7 @@ nf.Settings = (function () { contentType: 'application/json' }).done(function (response) { // close the settings dialog - nf.Dialog.showOkDialog({ + dialog.showOkDialog({ headerText: 'Settings', dialogContent: 'Settings successfully applied.' }); @@ -83,7 +133,7 @@ nf.Settings = (function () { $('#settings-save').off('click').on('click', function () { saveSettings(response.revision.version); }); - }).fail(nf.ErrorHandler.handleAjaxError); + }).fail(errorHandler.handleAjaxError); } /** @@ -161,7 +211,7 @@ nf.Settings = (function () { * @param item reporting task type */ var isSelectable = function (item) { - return nf.Common.isBlank(item.usageRestriction) || nf.Common.canAccessRestrictedComponents(); + return common.isBlank(item.usageRestriction) || common.canAccessRestrictedComponents(); }; /** @@ -197,7 +247,7 @@ nf.Settings = (function () { return ''; } - return nf.Common.substringAfterLast(dataContext.component.type, '.'); + return common.substringAfterLast(dataContext.component.type, '.'); }; /** @@ -209,41 +259,41 @@ nf.Settings = (function () { var sort = function (sortDetails, data) { // defines a function for sorting var comparer = function (a, b) { - if(a.permissions.canRead && b.permissions.canRead) { + if (a.permissions.canRead && b.permissions.canRead) { if (sortDetails.columnId === 'moreDetails') { var aBulletins = 0; - if (!nf.Common.isEmpty(a.bulletins)) { + if (!common.isEmpty(a.bulletins)) { aBulletins = a.bulletins.length; } var bBulletins = 0; - if (!nf.Common.isEmpty(b.bulletins)) { + if (!common.isEmpty(b.bulletins)) { bBulletins = b.bulletins.length; } return aBulletins - bBulletins; } else if (sortDetails.columnId === 'type') { - var aType = nf.Common.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? nf.Common.substringAfterLast(a.component[sortDetails.columnId], '.') : ''; - var bType = nf.Common.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? nf.Common.substringAfterLast(b.component[sortDetails.columnId], '.') : ''; + var aType = common.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? common.substringAfterLast(a.component[sortDetails.columnId], '.') : ''; + var bType = common.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? common.substringAfterLast(b.component[sortDetails.columnId], '.') : ''; return aType === bType ? 0 : aType > bType ? 1 : -1; } else if (sortDetails.columnId === 'state') { var aState = 'Invalid'; - if (nf.Common.isEmpty(a.component.validationErrors)) { - aState = nf.Common.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : ''; + if (common.isEmpty(a.component.validationErrors)) { + aState = common.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : ''; } var bState = 'Invalid'; - if (nf.Common.isEmpty(b.component.validationErrors)) { - bState = nf.Common.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : ''; + if (common.isEmpty(b.component.validationErrors)) { + bState = common.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : ''; } return aState === bState ? 0 : aState > bState ? 1 : -1; } else { - var aString = nf.Common.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : ''; - var bString = nf.Common.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : ''; + var aString = common.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : ''; + var bString = common.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : ''; return aString === bString ? 0 : aString > bString ? 1 : -1; } } else { - if (!a.permissions.canRead && !b.permissions.canRead){ + if (!a.permissions.canRead && !b.permissions.canRead) { return 0; } - if(a.permissions.canRead){ + if (a.permissions.canRead) { return 1; } else { return -1; @@ -272,7 +322,7 @@ nf.Settings = (function () { var reportingTaskTypesGrid = $('#reporting-task-types-table').data('gridInstance'); // ensure the grid has been initialized - if (nf.Common.isDefinedAndNotNull(reportingTaskTypesGrid)) { + if (common.isDefinedAndNotNull(reportingTaskTypesGrid)) { var reportingTaskTypesData = reportingTaskTypesGrid.getData(); // update the search criteria @@ -354,7 +404,7 @@ nf.Settings = (function () { // ensure something was selected if (selectedTaskType === '') { - nf.Dialog.showOkDialog({ + dialog.showOkDialog({ headerText: 'Settings', dialogContent: 'The type of reporting task to create must be selected.' }); @@ -371,7 +421,7 @@ nf.Settings = (function () { var addReportingTask = function (reportingTaskType) { // build the reporting task entity var reportingTaskEntity = { - 'revision': nf.Client.getRevision({ + 'revision': client.getRevision({ 'revision': { 'version': 0 } @@ -402,7 +452,7 @@ nf.Settings = (function () { var row = reportingTaskData.getRowById(reportingTaskEntity.id); reportingTaskGrid.setSelectedRows([row]); reportingTaskGrid.scrollRowIntoView(row); - }).fail(nf.ErrorHandler.handleAjaxError); + }).fail(errorHandler.handleAjaxError); // hide the dialog $('#new-reporting-task-dialog').modal('hide'); @@ -440,7 +490,7 @@ nf.Settings = (function () { id: 'type', name: 'Type', field: 'label', - formatter: nf.Common.typeFormatter, + formatter: common.typeFormatter, sortable: false, resizable: true }, @@ -474,11 +524,11 @@ nf.Settings = (function () { var reportingTaskType = reportingTaskTypesGrid.getDataItem(reportingTaskTypeIndex); // set the reporting task type description - if (nf.Common.isDefinedAndNotNull(reportingTaskType)) { + if (common.isDefinedAndNotNull(reportingTaskType)) { // show the selected reporting task $('#reporting-task-description-container').show(); - if (nf.Common.isBlank(reportingTaskType.description)) { + if (common.isBlank(reportingTaskType.description)) { $('#reporting-task-type-description') .attr('title', '') .html('<span class="unset">No description specified</span>'); @@ -507,7 +557,7 @@ nf.Settings = (function () { } }); reportingTaskTypesGrid.onViewportChanged.subscribe(function (e, args) { - nf.Common.cleanUpTooltips($('#reporting-task-types-table'), 'div.view-usage-restriction'); + common.cleanUpTooltips($('#reporting-task-types-table'), 'div.view-usage-restriction'); }); // wire up the dataview to the grid @@ -534,8 +584,8 @@ nf.Settings = (function () { var item = reportingTaskTypesData.getItemById(rowId); // show the tooltip - if (nf.Common.isDefinedAndNotNull(item.usageRestriction)) { - usageRestriction.qtip($.extend({}, nf.Common.config.tooltipConfig, { + if (common.isDefinedAndNotNull(item.usageRestriction)) { + usageRestriction.qtip($.extend({}, common.config.tooltipConfig, { content: item.usageRestriction, position: { container: $('#summary'), @@ -568,10 +618,10 @@ nf.Settings = (function () { // add the documented type reportingTaskTypesData.addItem({ id: id++, - label: nf.Common.substringAfterLast(documentedType.type, '.'), + label: common.substringAfterLast(documentedType.type, '.'), type: documentedType.type, - description: nf.Common.escapeHtml(documentedType.description), - usageRestriction: nf.Common.escapeHtml(documentedType.usageRestriction), + description: common.escapeHtml(documentedType.description), + usageRestriction: common.escapeHtml(documentedType.usageRestriction), tags: documentedType.tags.join(', ') }); @@ -593,36 +643,36 @@ nf.Settings = (function () { select: applyReportingTaskTypeFilter, remove: applyReportingTaskTypeFilter }); - }).fail(nf.ErrorHandler.handleAjaxError); + }).fail(errorHandler.handleAjaxError); // initialize the reporting task dialog $('#new-reporting-task-dialog').modal({ scrollableContentStyle: 'scrollable', headerText: 'Add Reporting Task', buttons: [{ - buttonText: 'Add', - color: { - base: '#728E9B', - hover: '#004849', - text: '#ffffff' - }, - disabled: function () { - var selected = reportingTaskTypesGrid.getSelectedRows(); + buttonText: 'Add', + color: { + base: '#728E9B', + hover: '#004849', + text: '#ffffff' + }, + disabled: function () { + var selected = reportingTaskTypesGrid.getSelectedRows(); - if (selected.length > 0) { - // grid configured with multi-select = false - var item = reportingTaskTypesGrid.getDataItem(selected[0]); - return isSelectable(item) === false; - } else { - return reportingTaskTypesGrid.getData().getLength() === 0; - } - }, - handler: { - click: function () { - addSelectedReportingTask(); - } + if (selected.length > 0) { + // grid configured with multi-select = false + var item = reportingTaskTypesGrid.getDataItem(selected[0]); + return isSelectable(item) === false; + } else { + return reportingTaskTypesGrid.getData().getLength() === 0; } }, + handler: { + click: function () { + addSelectedReportingTask(); + } + } + }, { buttonText: 'Cancel', color: { @@ -682,8 +732,8 @@ nf.Settings = (function () { // always include a button to view the usage markup += '<div title="Usage" class="pointer reporting-task-usage fa fa-book"></div>'; - var hasErrors = !nf.Common.isEmpty(dataContext.component.validationErrors); - var hasBulletins = !nf.Common.isEmpty(dataContext.bulletins); + var hasErrors = !common.isEmpty(dataContext.component.validationErrors); + var hasBulletins = !common.isEmpty(dataContext.bulletins); if (hasErrors) { markup += '<div class="pointer has-errors fa fa-warning" ></div>'; @@ -694,7 +744,7 @@ nf.Settings = (function () { } if (hasErrors || hasBulletins) { - markup += '<span class="hidden row-id">' + nf.Common.escapeHtml(dataContext.component.id) + '</span>'; + markup += '<span class="hidden row-id">' + common.escapeHtml(dataContext.component.id) + '</span>'; } return markup; @@ -707,7 +757,7 @@ nf.Settings = (function () { // determine the appropriate label var icon = '', label = ''; - if (!nf.Common.isEmpty(dataContext.component.validationErrors)) { + if (!common.isEmpty(dataContext.component.validationErrors)) { label = 'Invalid'; icon = 'invalid fa fa-warning'; } else { @@ -725,13 +775,13 @@ nf.Settings = (function () { // include the active thread count if appropriate var activeThreadCount = ''; - if (nf.Common.isDefinedAndNotNull(dataContext.component.activeThreadCount) && dataContext.component.activeThreadCount > 0) { + if (common.isDefinedAndNotNull(dataContext.component.activeThreadCount) && dataContext.component.activeThreadCount > 0) { activeThreadCount = '(' + dataContext.component.activeThreadCount + ')'; } // format the markup var formattedValue = '<div layout="row"><div class="' + icon + '" style="margin-top: 3px;"></div>'; - return formattedValue + '<div class="status-text" style="margin-top: 4px;">' + nf.Common.escapeHtml(label) + '</div><div style="float: left; margin-left: 4px;">' + nf.Common.escapeHtml(activeThreadCount) + '</div></div>'; + return formattedValue + '<div class="status-text" style="margin-top: 4px;">' + common.escapeHtml(label) + '</div><div style="float: left; margin-left: 4px;">' + common.escapeHtml(activeThreadCount) + '</div></div>'; }; var reportingTaskActionFormatter = function (row, cell, value, columnDef, dataContext) { @@ -744,7 +794,7 @@ nf.Settings = (function () { markup += '<div title="Edit" class="pointer edit-reporting-task fa fa-pencil" style="margin-top: 2px; margin-right: 3px;" ></div>'; // support starting when stopped and no validation errors - if (dataContext.component.state === 'STOPPED' && nf.Common.isEmpty(dataContext.component.validationErrors)) { + if (dataContext.component.state === 'STOPPED' && common.isEmpty(dataContext.component.validationErrors)) { markup += '<div title="Start" class="pointer start-reporting-task fa fa-play" style="margin-top: 2px; margin-right: 3px;"></div>'; } } @@ -754,12 +804,12 @@ nf.Settings = (function () { } } - if (dataContext.permissions.canWrite && nf.Common.canModifyController()) { + if (dataContext.permissions.canWrite && common.canModifyController()) { markup += '<div title="Remove" class="pointer delete-reporting-task fa fa-trash" style="margin-top: 2px; margin-right: 3px;" ></div>'; } // allow policy configuration conditionally - if (nf.Canvas.isConfigurableAuthorizer() && nf.Common.canAccessTenants()) { + if (canvasUtils.isConfigurableAuthorizer() && common.canAccessTenants()) { markup += '<div title="Access Policies" class="pointer edit-access-policies fa fa-key" style="margin-top: 2px;"></div>'; } @@ -768,14 +818,37 @@ nf.Settings = (function () { // define the column model for the reporting tasks table var reportingTasksColumnModel = [ - {id: 'moreDetails', name: ' ', resizable: false, formatter: moreReportingTaskDetails, sortable: true, width: 90, maxWidth: 90, toolTip: 'Sorts based on presence of bulletins'}, + { + id: 'moreDetails', + name: ' ', + resizable: false, + formatter: moreReportingTaskDetails, + sortable: true, + width: 90, + maxWidth: 90, + toolTip: 'Sorts based on presence of bulletins' + }, {id: 'name', name: 'Name', sortable: true, resizable: true, formatter: nameFormatter}, {id: 'type', name: 'Type', sortable: true, resizable: true, formatter: typeFormatter}, - {id: 'state', name: 'Run Status', sortable: true, resizeable: true, formatter: reportingTaskRunStatusFormatter} + { + id: 'state', + name: 'Run Status', + sortable: true, + resizeable: true, + formatter: reportingTaskRunStatusFormatter + } ]; // action column should always be last - reportingTasksColumnModel.push({id: 'actions', name: ' ', resizable: false, formatter: reportingTaskActionFormatter, sortable: false, width: 90, maxWidth: 90}); + reportingTasksColumnModel.push({ + id: 'actions', + name: ' ', + resizable: false, + formatter: reportingTaskActionFormatter, + sortable: false, + width: 90, + maxWidth: 90 + }); // initialize the dataview var reportingTasksData = new Slick.Data.DataView({ @@ -811,35 +884,35 @@ nf.Settings = (function () { // determine the desired action if (reportingTasksGrid.getColumns()[args.cell].id === 'actions') { if (target.hasClass('edit-reporting-task')) { - nf.ReportingTask.showConfiguration(reportingTaskEntity); + reportingTask.showConfiguration(reportingTaskEntity); } else if (target.hasClass('start-reporting-task')) { - nf.ReportingTask.start(reportingTaskEntity); + reportingTask.start(reportingTaskEntity); } else if (target.hasClass('stop-reporting-task')) { - nf.ReportingTask.stop(reportingTaskEntity); + reportingTask.stop(reportingTaskEntity); } else if (target.hasClass('delete-reporting-task')) { - nf.ReportingTask.promptToDeleteReportingTask(reportingTaskEntity); + reportingTask.promptToDeleteReportingTask(reportingTaskEntity); } else if (target.hasClass('view-state-reporting-task')) { var canClear = reportingTaskEntity.component.state === 'STOPPED' && reportingTaskEntity.component.activeThreadCount === 0; - nf.ComponentState.showState(reportingTaskEntity, canClear); + componentState.showState(reportingTaskEntity, canClear); } else if (target.hasClass('edit-access-policies')) { // show the policies for this service - nf.PolicyManagement.showReportingTaskPolicy(reportingTaskEntity); + policyManagement.showReportingTaskPolicy(reportingTaskEntity); // close the settings dialog $('#shell-close-button').click(); } } else if (reportingTasksGrid.getColumns()[args.cell].id === 'moreDetails') { if (target.hasClass('view-reporting-task')) { - nf.ReportingTask.showDetails(reportingTaskEntity); + reportingTask.showDetails(reportingTaskEntity); } else if (target.hasClass('reporting-task-usage')) { // close the settings dialog $('#shell-close-button').click(); // open the documentation for this reporting task - nf.Shell.showPage('../nifi-docs/documentation?' + $.param({ - select: nf.Common.substringAfterLast(reportingTaskEntity.component.type, '.') + shell.showPage('../nifi-docs/documentation?' + $.param({ + select: common.substringAfterLast(reportingTaskEntity.component.type, '.') })).done(function () { - nf.Settings.showSettings(); + nfSettings.showSettings(); }); } } @@ -866,12 +939,12 @@ nf.Settings = (function () { var reportingTaskEntity = reportingTasksData.getItemById(taskId); // format the errors - var tooltip = nf.Common.formatUnorderedList(reportingTaskEntity.component.validationErrors); + var tooltip = common.formatUnorderedList(reportingTaskEntity.component.validationErrors); // show the tooltip - if (nf.Common.isDefinedAndNotNull(tooltip)) { + if (common.isDefinedAndNotNull(tooltip)) { errorIcon.qtip($.extend({}, - nf.Common.config.tooltipConfig, + common.config.tooltipConfig, { content: tooltip, position: { @@ -895,13 +968,13 @@ nf.Settings = (function () { var reportingTaskEntity = reportingTasksData.getItemById(taskId); // format the tooltip - var bulletins = nf.Common.getFormattedBulletins(reportingTaskEntity.bulletins); - var tooltip = nf.Common.formatUnorderedList(bulletins); + var bulletins = common.getFormattedBulletins(reportingTaskEntity.bulletins); + var tooltip = common.formatUnorderedList(bulletins); // show the tooltip - if (nf.Common.isDefinedAndNotNull(tooltip)) { + if (common.isDefinedAndNotNull(tooltip)) { bulletinIcon.qtip($.extend({}, - nf.Common.config.tooltipConfig, + common.config.tooltipConfig, { content: tooltip, position: { @@ -927,7 +1000,7 @@ nf.Settings = (function () { $('#read-only-maximum-timer-driven-thread-count-field').addClass('unset').text('Unauthorized'); $('#read-only-maximum-event-driven-thread-count-field').addClass('unset').text('Unauthorized'); }; - + var setEditable = function (editable) { if (editable) { $('#general-settings div.editable').show(); @@ -939,7 +1012,7 @@ nf.Settings = (function () { $('#settings-save').hide(); } }; - + var settings = $.Deferred(function (deferred) { $.ajax({ type: 'GET', @@ -979,21 +1052,21 @@ nf.Settings = (function () { } }); }).promise(); - + // load the controller services var controllerServicesUri = config.urls.api + '/flow/controller/controller-services'; - var controllerServices = nf.ControllerServices.loadControllerServices(controllerServicesUri, getControllerServicesTable()); + var controllerServicesXhr = controllerServices.loadControllerServices(controllerServicesUri, getControllerServicesTable()); // load the reporting tasks var reportingTasks = loadReportingTasks(); // return a deferred for all parts of the settings - return $.when(settings, controllerServices, reportingTasks).done(function (settingsResult, controllerServicesResult) { + return $.when(settings, controllerServicesXhr, reportingTasks).done(function (settingsResult, controllerServicesResult) { var controllerServicesResponse = controllerServicesResult[0]; // update the current time $('#settings-last-refreshed').text(controllerServicesResponse.currentTime); - }).fail(nf.ErrorHandler.handleAjaxError); + }).fail(errorHandler.handleAjaxError); }; /** @@ -1013,8 +1086,8 @@ nf.Settings = (function () { }); var reportingTasksElement = $('#reporting-tasks-table'); - nf.Common.cleanUpTooltips(reportingTasksElement, 'div.has-errors'); - nf.Common.cleanUpTooltips(reportingTasksElement, 'div.has-bulletins'); + common.cleanUpTooltips(reportingTasksElement, 'div.has-errors'); + common.cleanUpTooltips(reportingTasksElement, 'div.has-bulletins'); var reportingTasksGrid = reportingTasksElement.data('gridInstance'); var reportingTasksData = reportingTasksGrid.getData(); @@ -1031,7 +1104,7 @@ nf.Settings = (function () { */ var showSettings = function () { // show the settings dialog - nf.Shell.showContent('#settings').done(function () { + shell.showContent('#settings').done(function () { reset(); }); @@ -1039,7 +1112,7 @@ nf.Settings = (function () { $('#settings-tabs').find('.selected-tab').click(); // adjust the table size - nf.Settings.resetTableSize(); + nfSettings.resetTableSize(); }; /** @@ -1050,7 +1123,7 @@ nf.Settings = (function () { $('#settings-save').mouseout(); }; - return { + var nfSettings = { /** * Initializes the settings page. */ @@ -1077,9 +1150,9 @@ nf.Settings = (function () { $('#settings-save').show(); } else { var canModifyController = false; - if (nf.Common.isDefinedAndNotNull(nf.Common.currentUser)) { + if (common.isDefinedAndNotNull(common.currentUser)) { // only consider write permissions for creating new controller services/reporting tasks - canModifyController = nf.Common.currentUser.controllerPermissions.canWrite === true; + canModifyController = common.currentUser.controllerPermissions.canWrite === true; } if (canModifyController) { @@ -1102,7 +1175,7 @@ nf.Settings = (function () { } // resize the table - nf.Settings.resetTableSize(); + nfSettings.resetTableSize(); } } }); @@ -1117,13 +1190,13 @@ nf.Settings = (function () { var selectedTab = $('#settings-tabs li.selected-tab').text(); if (selectedTab === 'Controller Services') { var controllerServicesUri = config.urls.api + '/controller/controller-services'; - nf.ControllerServices.promptNewControllerService(controllerServicesUri, getControllerServicesTable()); + controllerServices.promptNewControllerService(controllerServicesUri, getControllerServicesTable()); } else if (selectedTab === 'Reporting Tasks') { $('#new-reporting-task-dialog').modal('show'); // reset the canvas size after the dialog is shown var reportingTaskTypesGrid = $('#reporting-task-types-table').data('gridInstance'); - if (nf.Common.isDefinedAndNotNull(reportingTaskTypesGrid)) { + if (common.isDefinedAndNotNull(reportingTaskTypesGrid)) { reportingTaskTypesGrid.setSelectedRows([0]); reportingTaskTypesGrid.resizeCanvas(); } @@ -1132,10 +1205,10 @@ nf.Settings = (function () { $('#reporting-task-type-filter').focus(); } }); - + // initialize each tab initGeneral(); - nf.ControllerServices.init(getControllerServicesTable()); + controllerServices.init(getControllerServicesTable(), nfSettings.showSettings); initReportingTasks(); }, @@ -1143,10 +1216,10 @@ nf.Settings = (function () { * Update the size of the grid based on its container's current size. */ resetTableSize: function () { - nf.ControllerServices.resetTableSize(getControllerServicesTable()); + controllerServices.resetTableSize(getControllerServicesTable()); var reportingTasksGrid = $('#reporting-tasks-table').data('gridInstance'); - if (nf.Common.isDefinedAndNotNull(reportingTasksGrid)) { + if (common.isDefinedAndNotNull(reportingTasksGrid)) { reportingTasksGrid.resizeCanvas(); } }, @@ -1167,7 +1240,7 @@ nf.Settings = (function () { /** * Selects the specified controller service. - * + * * @param {string} controllerServiceId */ selectControllerService: function (controllerServiceId) { @@ -1180,7 +1253,7 @@ nf.Settings = (function () { controllerServiceGrid.scrollRowIntoView(row); // select the controller services tab - $('#settings-tabs').find('li:eq(1)').click(); + $('#settings-tabs').find('li:eq(1)').click(); }, /** @@ -1189,9 +1262,9 @@ nf.Settings = (function () { * @param {object} controllerServiceBulletins * @param {object} reportingTaskBulletins */ - setBulletins: function(controllerServiceBulletins, reportingTaskBulletins) { + setBulletins: function (controllerServiceBulletins, reportingTaskBulletins) { if ($('#controller-services-table').data('gridInstance')) { - nf.ControllerServices.setBulletins(getControllerServicesTable(), controllerServiceBulletins); + controllerServices.setBulletins(getControllerServicesTable(), controllerServiceBulletins); } // reporting tasks @@ -1200,7 +1273,7 @@ nf.Settings = (function () { reportingTasksData.beginUpdate(); // if there are some bulletins process them - if (!nf.Common.isEmpty(reportingTaskBulletins)) { + if (!common.isEmpty(reportingTaskBulletins)) { var reportingTaskBulletinsBySource = d3.nest() .key(function (d) { return d.sourceId; @@ -1209,7 +1282,7 @@ nf.Settings = (function () { reportingTaskBulletinsBySource.forEach(function (sourceId, sourceBulletins) { var reportingTask = reportingTasksData.getItemById(sourceId); - if (nf.Common.isDefinedAndNotNull(reportingTask)) { + if (common.isDefinedAndNotNull(reportingTask)) { reportingTasksData.updateItem(sourceId, $.extend(reportingTask, { bulletins: sourceBulletins })); @@ -1227,4 +1300,6 @@ nf.Settings = (function () { reportingTasksData.endUpdate(); } }; -}()); \ No newline at end of file + + return nfSettings; +})); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-snippet.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-snippet.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-snippet.js index 4275b36..f8c6f83 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-snippet.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-snippet.js @@ -15,9 +15,31 @@ * limitations under the License. */ -/* global nf, d3 */ +/* global define, module, require, exports */ -nf.Snippet = (function () { +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + define(['jquery', + 'd3', + 'nf.CanvasUtils', + 'nf.Client'], + function ($, d3, canvasUtils, client) { + return (nf.Snippet = factory($, d3, canvasUtils, client)); + }); + } else if (typeof exports === 'object' && typeof module === 'object') { + module.exports = (nf.Snippet = + factory(require('jquery'), + require('d3'), + require('nf.CanvasUtils'), + require('nf.Client'))); + } else { + nf.Snippet = factory(root.$, + root.d3, + root.nf.CanvasUtils, + root.nf.Client); + } +}(this, function ($, d3, canvasUtils, client) { + 'use strict'; var config = { urls: { @@ -27,14 +49,15 @@ nf.Snippet = (function () { }; return { + /** * Marshals snippet from the specified selection. - * + * * @argument {selection} selection The selection to marshal */ marshal: function (selection) { var snippet = { - parentGroupId: nf.Canvas.getGroupId(), + parentGroupId: canvasUtils.getGroupId(), processors: {}, funnels: {}, inputPorts: {}, @@ -49,31 +72,31 @@ nf.Snippet = (function () { selection.each(function (d) { var selected = d3.select(this); - if (nf.CanvasUtils.isProcessor(selected)) { - snippet.processors[d.id] = nf.Client.getRevision(selected.datum()); - } else if (nf.CanvasUtils.isFunnel(selected)) { - snippet.funnels[d.id] = nf.Client.getRevision(selected.datum()); - } else if (nf.CanvasUtils.isLabel(selected)) { - snippet.labels[d.id] = nf.Client.getRevision(selected.datum()); - } else if (nf.CanvasUtils.isInputPort(selected)) { - snippet.inputPorts[d.id] = nf.Client.getRevision(selected.datum()); - } else if (nf.CanvasUtils.isOutputPort(selected)) { - snippet.outputPorts[d.id] = nf.Client.getRevision(selected.datum()); - } else if (nf.CanvasUtils.isProcessGroup(selected)) { - snippet.processGroups[d.id] = nf.Client.getRevision(selected.datum()); - } else if (nf.CanvasUtils.isRemoteProcessGroup(selected)) { - snippet.remoteProcessGroups[d.id] = nf.Client.getRevision(selected.datum()); - } else if (nf.CanvasUtils.isConnection(selected)) { - snippet.connections[d.id] = nf.Client.getRevision(selected.datum()); + if (canvasUtils.isProcessor(selected)) { + snippet.processors[d.id] = client.getRevision(selected.datum()); + } else if (canvasUtils.isFunnel(selected)) { + snippet.funnels[d.id] = client.getRevision(selected.datum()); + } else if (canvasUtils.isLabel(selected)) { + snippet.labels[d.id] = client.getRevision(selected.datum()); + } else if (canvasUtils.isInputPort(selected)) { + snippet.inputPorts[d.id] = client.getRevision(selected.datum()); + } else if (canvasUtils.isOutputPort(selected)) { + snippet.outputPorts[d.id] = client.getRevision(selected.datum()); + } else if (canvasUtils.isProcessGroup(selected)) { + snippet.processGroups[d.id] = client.getRevision(selected.datum()); + } else if (canvasUtils.isRemoteProcessGroup(selected)) { + snippet.remoteProcessGroups[d.id] = client.getRevision(selected.datum()); + } else if (canvasUtils.isConnection(selected)) { + snippet.connections[d.id] = client.getRevision(selected.datum()); } }); return snippet; }, - + /** * Creates a snippet. - * + * * @argument {object} snippet The snippet */ create: function (snippet) { @@ -89,10 +112,10 @@ nf.Snippet = (function () { contentType: 'application/json' }); }, - + /** * Copies the snippet to the specified group and origin. - * + * * @argument {string} snippetId The snippet id * @argument {object} origin The origin */ @@ -105,16 +128,16 @@ nf.Snippet = (function () { return $.ajax({ type: 'POST', - url: config.urls.processGroups + '/' + encodeURIComponent(nf.Canvas.getGroupId()) + '/snippet-instance', + url: config.urls.processGroups + '/' + encodeURIComponent(canvasUtils.getGroupId()) + '/snippet-instance', data: JSON.stringify(copySnippetRequestEntity), dataType: 'json', contentType: 'application/json' }); }, - + /** * Removes the specified snippet. - * + * * @argument {string} snippetId The snippet id */ remove: function (snippetId) { @@ -123,10 +146,10 @@ nf.Snippet = (function () { url: config.urls.snippets + '/' + encodeURIComponent(snippetId) }); }, - + /** * Moves the snippet into the specified group. - * + * * @argument {string} snippetId The snippet id * @argument {string} newGroupId The new group id */ @@ -147,4 +170,4 @@ nf.Snippet = (function () { }); } }; -}()); \ No newline at end of file +})); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js index 93fff60..b9b24db 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster-table.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, define, module, require, exports */ +/* global define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster.js index 32e7bb0..543c8dc 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/cluster/nf-cluster.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, top, define, module, require, exports */ +/* global top, define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters-table.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters-table.js index ade8236..9594247 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters-table.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters-table.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, define, module, require, exports */ +/* global define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters.js index be321e6..0a16013 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, top, define, module, require, exports */ +/* global top, define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history-model.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history-model.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history-model.js index a2132ec..bf1e34a 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history-model.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history-model.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, define, module, require, exports */ +/* global define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history-table.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history-table.js index 38f21e8..16b0007 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history-table.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history-table.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, top, define, module, require, exports */ +/* global top, define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history.js index 7f73724..9370c7a 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, top, define, module, require, exports */ +/* global top, define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/login/nf-login.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/login/nf-login.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/login/nf-login.js index a18d5d7..1cdab11 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/login/nf-login.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/login/nf-login.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, top, define, module, require, exports */ +/* global top, define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { @@ -33,7 +33,10 @@ require('nf.Dialog'), require('nf.Storage'))); } else { - nf.Login = factory(root.$, root.nf.Common, root.nf.Dialog, root.nf.Storage); + nf.Login = factory(root.$, + root.nf.Common, + root.nf.Dialog, + root.nf.Storage); } }(this, function ($, common, dialog, storage) { 'use strict'; http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ajax-setup.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ajax-setup.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ajax-setup.js index eaf61cf..16c20e3 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ajax-setup.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ajax-setup.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, define, module, require, exports */ +/* global define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-client.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-client.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-client.js index aedd555..812f20a 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-client.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-client.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, define, module, require, exports */ +/* global define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-cluster-summary.js ---------------------------------------------------------------------- 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 1352843..a06b771 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 @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, define, module, require, exports */ +/* global define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js index 395b5c8..58e5b63 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js @@ -15,24 +15,27 @@ * limitations under the License. */ -/* global nf, define, module, require, exports, parseFloat */ +/* global define, module, require, exports, parseFloat */ // Define a common utility class used across the entire application. (function (root, factory) { if (typeof define === 'function' && define.amd) { define(['jquery', + 'd3', 'nf.Storage'], - function ($, storage) { - return (nf.Common = factory($, storage)); + function ($, d3, storage) { + return (nf.Common = factory($, d3, storage)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.Common = factory(require('jquery'), + require('d3'), require('nf.Storage'))); } else { nf.Common = factory(root.$, + root.d3, root.nf.Storage); } -}(this, function ($, storage) { +}(this, function ($, d3, storage) { 'use strict'; $(document).ready(function () { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-connection-details.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-connection-details.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-connection-details.js index c1f42b7..d06d8a3 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-connection-details.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-connection-details.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, define, module, require, exports */ +/* global define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-dialog.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-dialog.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-dialog.js index ed6667c..fff81b4 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-dialog.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-dialog.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, define, module, require, exports */ +/* global define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-error-handler.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-error-handler.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-error-handler.js index f604fec..0929b76 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-error-handler.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-error-handler.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, define, module, require, exports */ +/* global define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-app-config.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-app-config.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-app-config.js index b0406aa..7ffc560 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-app-config.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-app-config.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, define, module, require, exports */ +/* global define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-app-controller.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-app-controller.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-app-controller.js index ae93c95..fb89f09 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-app-controller.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-app-controller.js @@ -15,28 +15,47 @@ * limitations under the License. */ -/* global nf, define, module, require, exports */ +/* global define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { - define(['nf.ng.Bridge'], - function (angularBridge) { - return (nf.ng.AppCtrl = factory(angularBridge)); + define(['nf.ng.Bridge', + 'nf.Common', + 'nf.CanvasUtils', + 'nf.ClusterSummary', + 'nf.Actions'], + function (angularBridge, canvasUtils, common, clusterSummary, actions) { + return (nf.ng.AppCtrl = factory(angularBridge, canvasUtils, common, clusterSummary, actions)); }); } else if (typeof exports === 'object' && typeof module === 'object') { - module.exports = (nf.ng.AppCtrl = factory(require('nf.ng.Bridge'))); + module.exports = (nf.ng.AppCtrl = + factory(require('nf.ng.Bridge'), + require('nf.CanvasUtils'), + require('nf.Common'), + require('nf.ClusterSummary'), + require('nf.Actions'))); } else { - nf.ng.AppCtrl = factory(root.nf.ng.Bridge); + nf.ng.AppCtrl = factory(root.nf.ng.Bridge, + root.nf.CanvasUtils, + root.nf.Common, + root.nf.ClusterSummary, + root.nf.Actions); } -}(this, function (angularBridge) { +}(this, function (angularBridge, canvasUtils, common, clusterSummary, actions) { 'use strict'; return function ($scope, serviceProvider) { 'use strict'; function AppCtrl(serviceProvider) { - //global nf namespace for reference throughout angular app - this.nf = nf; + //add essential modules to the scope for availability throughout the angular container + this.nf = { + "Common": common, + "ClusterSummary": clusterSummary, + "Actions": actions, + "CanvasUtils": canvasUtils, + }; + //any registered angular service is available through the serviceProvider this.serviceProvider = serviceProvider; } http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-bridge.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-bridge.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-bridge.js index 92de4ec..8d50f64 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-bridge.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-bridge.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, define, module, require, exports */ +/* global define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-service-provider.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-service-provider.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-service-provider.js index acdaba5..9583602 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-service-provider.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-ng-service-provider.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, define, module, require, exports */ +/* global define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js index 87b1e60..3130c86 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, define, module, require, exports */ +/* global define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-shell.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-shell.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-shell.js index d3644ad..9860572 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-shell.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-shell.js @@ -15,26 +15,23 @@ * limitations under the License. */ -/* global nf, define, module, require, exports */ +/* global define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { define(['jquery', - 'nf.Common', - 'nf.ContextMenu'], - function ($, common, contextMenu) { - return (nf.Shell = factory($, common, contextMenu)); + 'nf.Common'], + function ($, common) { + return (nf.Shell = factory($, common)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.Shell = factory(require('jquery'), - require('nf.Common'), - require('nf.ContextMenu'))); + require('nf.Common'))); } else { nf.Shell = factory(root.$, - root.nf.Common, - root.nf.ContextMenu); + root.nf.Common); } -}(this, function ($, common, contextMenu) { +}(this, function ($, common) { 'use strict'; $(document).ready(function () { @@ -70,9 +67,19 @@ var showPageResize = null; var showContentResize = null; + var nfContextMenu = null; return { + /** + * Initialize the shell. + * + * @param contextMenu The reference to the contextMenu controller. + */ + init: function (contextMenu) { + nfContextMenu = contextMenu; + }, + resizeContent: function (shell) { var contentContainer = shell.find('.shell-content-container'); contentContainer.css({ @@ -100,8 +107,8 @@ */ showPage: function (uri, canUndock) { // if the context menu is on this page, attempt to close - if (common.isDefinedAndNotNull(contextMenu)) { - contextMenu.hide(); + if (common.isDefinedAndNotNull(nfContextMenu)) { + nfContextMenu.hide(); } return $.Deferred(function (deferred) { @@ -154,8 +161,8 @@ */ showContent: function (domId) { // if the context menu is on this page, attempt to close - if (common.isDefinedAndNotNull(contextMenu)) { - contextMenu.hide(); + if (common.isDefinedAndNotNull(nfContextMenu)) { + nfContextMenu.hide(); } return $.Deferred(function (deferred) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-status-history.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-status-history.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-status-history.js index 04fbf00..2624319 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-status-history.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-status-history.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, define, module, require, exports */ +/* global define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-storage.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-storage.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-storage.js index b96d61e..56785f3 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-storage.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-storage.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, define, module, require, exports */ +/* global define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-universal-capture.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-universal-capture.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-universal-capture.js index ffadf64..4406918 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-universal-capture.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-universal-capture.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, define, module, require, exports */ +/* global define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-lineage.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-lineage.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-lineage.js index 62e36c6..f46d287 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-lineage.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-lineage.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, top, define, module, require, exports */ +/* global top, define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js index 3d0141b..5bbaa09 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, top, define, module, require, exports */ +/* global top, define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { @@ -1270,7 +1270,7 @@ */ getEventDetails: function (eventId, clusterNodeId) { var url; - if (nf.Common.isDefinedAndNotNull(clusterNodeId)) { + if (common.isDefinedAndNotNull(clusterNodeId)) { url = config.urls.provenanceEvents + encodeURIComponent(eventId) + '?' + $.param({ clusterNodeId: clusterNodeId }); @@ -1282,7 +1282,7 @@ type: 'GET', url: url, dataType: 'json' - }).fail(nf.Common.handleAjaxError); + }).fail(errorHandler.handleAjaxError); }, /** http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance.js index 9dd9983..fd8f7db 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, top, define, module, require, exports */ +/* global top, define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-cluster-search.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-cluster-search.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-cluster-search.js index b4fa88b..b9eeb70 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-cluster-search.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-cluster-search.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, define, module, require, exports */ +/* global define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js index c61dee5..4a5ae22 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* global nf, top, define, module, require, exports */ +/* global top, define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { @@ -1065,8 +1065,8 @@ // determine the desired action if (processGroupsGrid.getColumns()[args.cell].id === 'actions') { if (target.hasClass('go-to')) { - if (common.isDefinedAndNotNull(parent.nf) && common.isDefinedAndNotNull(parent.nf.CanvasUtils) && common.isDefinedAndNotNull(parent.nf.Shell)) { - parent.nf.CanvasUtils.enterGroup(item.id); + if (common.isDefinedAndNotNull(parent.nf) && common.isDefinedAndNotNull(parent.nf.ProcessGroup) && common.isDefinedAndNotNull(parent.nf.Shell)) { + parent.nf.ProcessGroup.enterGroup(item.id); parent.$('#shell-close-button').click(); } } else if (target.hasClass('show-process-group-status-history')) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary.js index 826c4a9..f868663 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, define, module, require, exports */ +/* global define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates-table.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates-table.js index 33722b5..65d9ada 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates-table.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates-table.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, define, module, require, exports */ +/* global define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { @@ -293,7 +293,7 @@ // allow policy configuration conditionally if embedded in if (top !== window && common.canAccessTenants()) { - if (common.isDefinedAndNotNull(parent.nf) && common.isDefinedAndNotNull(parent.nf.Canvas) && parent.nf.Canvas.isConfigurableAuthorizer()) { + if (common.isDefinedAndNotNull(parent.nf) && common.isDefinedAndNotNull(parent.nf.CanvasUtils) && parent.nf.CanvasUtils.isConfigurableAuthorizer()) { markup += '<div title="Access Policies" class="pointer edit-access-policies fa fa-key" style="margin-top: 2px;"></div>'; } } http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates.js index 15af39c..a54e3c2 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/templates/nf-templates.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, top, define, module, require, exports */ +/* global top, define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users-table.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users-table.js index 13cff49..e2d00b0 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users-table.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users-table.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, define, module, require, exports */ +/* global define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) { @@ -79,7 +79,7 @@ url: user.uri + '?' + $.param(client.getRevision(user)), dataType: 'json' }).done(function () { - self.loadUsersTable(); + nfUsersTable.loadUsersTable(); }).fail(errorHandler.handleAjaxError); // hide the dialog @@ -252,7 +252,7 @@ }); $.when.apply(window, xhrs).always(function () { - self.loadUsersTable().done(function () { + nfUsersTable.loadUsersTable().done(function () { // select the new user var row = usersData.getRowById(userEntity.id); usersGrid.setSelectedRows([row]); @@ -330,7 +330,7 @@ }); $.when.apply(window, xhrs).always(function () { - self.loadUsersTable(); + nfUsersTable.loadUsersTable(); }).fail(errorHandler.handleAjaxError); }).fail(errorHandler.handleAjaxError); }; @@ -349,7 +349,7 @@ dataType: 'json', contentType: 'application/json' }).done(function (groupEntity) { - self.loadUsersTable().done(function () { + nfUsersTable.loadUsersTable().done(function () { // add the user var usersGrid = $('#users-table').data('gridInstance'); var usersData = usersGrid.getData(); @@ -385,7 +385,7 @@ dataType: 'json', contentType: 'application/json' }).done(function (groupEntity) { - self.loadUsersTable(); + nfUsersTable.loadUsersTable(); }).fail(errorHandler.handleAjaxError); }; http://git-wip-us.apache.org/repos/asf/nifi/blob/bf3b1640/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users.js index 8cad6cf..bdab85b 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/users/nf-users.js @@ -15,7 +15,7 @@ * limitations under the License. */ -/* global nf, top, define, module, require, exports */ +/* global top, define, module, require, exports */ (function (root, factory) { if (typeof define === 'function' && define.amd) {
