You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by mc...@apache.org on 2014/12/16 14:43:47 UTC
[3/7] incubator-nifi git commit: NIFI-27: - Upgrading jQuery and
jQuery UI. - Replacing all instances of Deferred.then with Deferred.done/fail
due to API change introduced in 1.8. - Restoring line returns between public
methods. - Upgrading jquery.form a
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/bulletin-board/nf-bulletin-board.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/bulletin-board/nf-bulletin-board.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/bulletin-board/nf-bulletin-board.js
index 864eb70..f181016 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/bulletin-board/nf-bulletin-board.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/bulletin-board/nf-bulletin-board.js
@@ -112,14 +112,14 @@ nf.BulletinBoard = (function () {
type: 'GET',
url: config.urls.controllerAbout,
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
var aboutDetails = response.about;
var bulletinBoardTitle = aboutDetails.title + ' Bulletin Board';
// set the document title and the about title
document.title = bulletinBoardTitle;
$('#bulletin-board-header-text').text(bulletinBoardTitle);
- }, nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
// get the banners if we're not in the shell
var loadBanners = $.Deferred(function (deferred) {
@@ -128,7 +128,7 @@ nf.BulletinBoard = (function () {
type: 'GET',
url: config.urls.banners,
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
// ensure the banners response is specified
if (nf.Common.isDefinedAndNotNull(response.banners)) {
if (nf.Common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') {
@@ -160,7 +160,7 @@ nf.BulletinBoard = (function () {
}
deferred.resolve();
- }, function (xhr, status, error) {
+ }).fail(function (xhr, status, error) {
nf.Common.handleAjaxError(xhr, status, error);
deferred.reject();
});
@@ -170,9 +170,9 @@ nf.BulletinBoard = (function () {
});
return $.Deferred(function (deferred) {
- $.when(getTitle, loadBanners).then(function () {
+ $.when(getTitle, loadBanners).done(function () {
deferred.resolve();
- }, function () {
+ }).fail(function () {
deferred.reject();
});
}).promise();
@@ -294,7 +294,7 @@ nf.BulletinBoard = (function () {
url: config.urls.bulletinBoard,
data: data,
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
// ensure the bulletin board was specified
if (nf.Common.isDefinedAndNotNull(response.bulletinBoard)) {
var bulletinBoard = response.bulletinBoard;
@@ -369,7 +369,7 @@ nf.BulletinBoard = (function () {
bulletinContainer.prepend('<div class="bulletin-action">…</div>');
}
}
- }, function (xhr, status, error) {
+ }).fail(function (xhr, status, error) {
// likely caused by a invalid regex
if (xhr.status === 404) {
$('#bulletin-error-message').text(xhr.responseText).show();
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js
index f73545d..dc8ca31 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js
@@ -40,10 +40,10 @@ nf.Actions = (function () {
url: uri,
data: data,
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
// update the revision
nf.Client.setRevision(response.revision);
- }, function (xhr, status, error) {
+ }).fail(function (xhr, status, error) {
if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) {
nf.Dialog.showOkDialog({
dialogContent: nf.Common.escapeHtml(xhr.responseText),
@@ -86,12 +86,14 @@ nf.Actions = (function () {
nf.CanvasUtils.enterGroup(selectionData.component.id);
}
},
+
/**
* Exits the current process group but entering the parent group.
*/
leaveGroup: function () {
nf.CanvasUtils.enterGroup(nf.Canvas.getParentGroupId());
},
+
/**
* Refresh the flow of the remote process group in the specified selection.
*
@@ -153,6 +155,7 @@ nf.Actions = (function () {
poll(1);
}
},
+
/**
* Opens the remote process group in the specified selection.
*
@@ -172,6 +175,7 @@ nf.Actions = (function () {
}
}
},
+
/**
* Shows and selects the source of the connection in the specified selection.
*
@@ -190,6 +194,7 @@ nf.Actions = (function () {
}
}
},
+
/**
* Shows and selects the destination of the connection in the specified selection.
*
@@ -208,6 +213,7 @@ nf.Actions = (function () {
}
}
},
+
/**
* Shows the downstream components from the specified selection.
*
@@ -230,6 +236,7 @@ nf.Actions = (function () {
}
}
},
+
/**
* Shows the upstream components from the specified selection.
*
@@ -252,6 +259,7 @@ nf.Actions = (function () {
}
}
},
+
/**
* Shows and selects the component in the specified selection.
*
@@ -268,6 +276,7 @@ nf.Actions = (function () {
nf.Actions.center(selection);
}
},
+
/**
* Selects all components in the specified selection.
*
@@ -276,12 +285,14 @@ nf.Actions = (function () {
select: function (selection) {
selection.classed('selected', true);
},
+
/**
* Selects all components.
*/
selectAll: function () {
nf.Actions.select(d3.selectAll('g.component, g.connection'));
},
+
/**
* Centers the component in the specified selection.
*
@@ -331,6 +342,7 @@ nf.Actions = (function () {
});
}
},
+
/**
* Enables all eligible selected components.
*/
@@ -360,6 +372,7 @@ nf.Actions = (function () {
});
}
},
+
/**
* Disables all eligible selected components.
*/
@@ -389,6 +402,7 @@ nf.Actions = (function () {
});
}
},
+
/**
* Starts the components in the specified selection.
*
@@ -443,6 +457,7 @@ nf.Actions = (function () {
}
}
},
+
/**
* Stops the components in the specified selection.
*
@@ -496,6 +511,7 @@ nf.Actions = (function () {
}
}
},
+
/**
* Enables transmission for the components in the specified selection.
*
@@ -513,6 +529,7 @@ nf.Actions = (function () {
});
});
},
+
/**
* Disables transmission for the components in the specified selection.
*
@@ -530,6 +547,7 @@ nf.Actions = (function () {
});
});
},
+
/**
* Shows the configuration dialog for the specified selection.
*
@@ -557,6 +575,7 @@ nf.Actions = (function () {
}
}
},
+
// Defines an action for showing component details (like configuration but read only).
showDetails: function (selection) {
if (selection.size() === 1) {
@@ -579,6 +598,7 @@ nf.Actions = (function () {
}
}
},
+
/**
* Shows the usage documentation for the component in the specified selection.
*
@@ -592,6 +612,7 @@ nf.Actions = (function () {
}));
}
},
+
/**
* Shows the stats for the specified selection.
*
@@ -623,6 +644,7 @@ nf.Actions = (function () {
}
}
},
+
/**
* Opens the remote ports dialog for the remote process group in the specified selection.
*
@@ -633,6 +655,7 @@ nf.Actions = (function () {
nf.RemoteProcessGroupPorts.showPorts(selection);
}
},
+
/**
* Hides and open cancellable dialogs.
*/
@@ -646,12 +669,14 @@ nf.Actions = (function () {
}
});
},
+
/**
* Reloads the status for the entire canvas (components and flow.)
*/
reloadStatus: function () {
nf.Canvas.reloadStatus();
},
+
/**
* Deletes the component in the specified selection.
*
@@ -675,7 +700,7 @@ nf.Actions = (function () {
clientId: revision.clientId
}),
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
// update the revision
nf.Client.setRevision(response.revision);
@@ -723,15 +748,15 @@ nf.Actions = (function () {
// refresh the birdseye/toolbar
nf.Birdseye.refresh();
nf.CanvasToolbar.refresh();
- }, nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
} else {
// create a snippet for the specified component and link to the data flow
var snippetDetails = nf.Snippet.marshal(selection, true);
- nf.Snippet.create(snippetDetails).then(function (response) {
+ nf.Snippet.create(snippetDetails).done(function (response) {
var snippet = response.snippet;
// remove the snippet, effectively removing the components
- nf.Snippet.remove(snippet.id).then(function () {
+ nf.Snippet.remove(snippet.id).done(function () {
var components = d3.map();
// add the id to the type's array
@@ -797,7 +822,7 @@ nf.Actions = (function () {
// refresh the birdseye/toolbar
nf.Birdseye.refresh();
nf.CanvasToolbar.refresh();
- }, function (xhr, status, error) {
+ }).fail(function (xhr, status, error) {
// unable to acutally remove the components so attempt to
// unlink and remove just the snippet - if unlinking fails
// just ignore
@@ -807,10 +832,11 @@ nf.Actions = (function () {
nf.Common.handleAjaxError(xhr, status, error);
});
- }, nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
}
}
},
+
/**
* Opens the fill color dialog for the component in the specified selection.
*
@@ -842,6 +868,7 @@ nf.Actions = (function () {
$('#fill-color-dialog').modal('show');
}
},
+
/**
* Groups the currently selected components into a new group.
*/
@@ -865,6 +892,7 @@ nf.Actions = (function () {
});
});
},
+
/**
* Creates a new template based off the currently selected components. If no components
* are selected, a template of the entire canvas is made.
@@ -914,7 +942,7 @@ nf.Actions = (function () {
var snippetDetails = nf.Snippet.marshal(selection, false);
// create the snippet
- nf.Snippet.create(snippetDetails).then(function (response) {
+ nf.Snippet.create(snippetDetails).done(function (response) {
var snippet = response.snippet;
// create the template
@@ -927,21 +955,21 @@ nf.Actions = (function () {
snippetId: snippet.id
},
dataType: 'json'
- }).then(function () {
+ }).done(function () {
// show the confirmation dialog
nf.Dialog.showOkDialog({
dialogContent: "Template '" + nf.Common.escapeHtml(templateName) + "' was successfully created.",
overlayBackground: false
});
- }, nf.Common.handleAjaxError).always(function () {
+ }).always(function () {
// remove the snippet
nf.Snippet.remove(snippet.id);
// clear the template dialog fields
$('#new-template-name').val('');
$('#new-template-description').val('');
- });
- }, nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
}
}
}, {
@@ -956,6 +984,7 @@ nf.Actions = (function () {
// auto focus on the template name
$('#new-template-name').focus();
},
+
/**
* Copies the component in the specified selection.
*
@@ -975,6 +1004,7 @@ nf.Actions = (function () {
origin: origin
});
},
+
/**
* Pastes the currently copied selection.
*
@@ -1009,7 +1039,7 @@ nf.Actions = (function () {
};
// create a snippet from the details
- nf.Snippet.create(data['snippet']).then(function (createResponse) {
+ nf.Snippet.create(data['snippet']).done(function (createResponse) {
var snippet = createResponse.snippet;
// determine the origin of the bounding box of the copy
@@ -1024,7 +1054,7 @@ nf.Actions = (function () {
}
// copy the snippet to the new location
- nf.Snippet.copy(snippet.id, nf.Canvas.getGroupId(), origin).then(function (copyResponse) {
+ nf.Snippet.copy(snippet.id, nf.Canvas.getGroupId(), origin).done(function (copyResponse) {
var snippetContents = copyResponse.contents;
// update the graph accordingly
@@ -1039,7 +1069,7 @@ nf.Actions = (function () {
// remove the original snippet
nf.Snippet.remove(snippet.id).fail(reject);
- }, function () {
+ }).fail(function () {
// an error occured while performing the copy operation, reload the
// graph in case it was a partial success
nf.Canvas.reload().done(function () {
@@ -1054,7 +1084,7 @@ nf.Actions = (function () {
// reject the deferred
reject();
});
- }, reject);
+ }).fail(reject);
}).promise();
// show the appropriate message is the copy fails
@@ -1067,6 +1097,7 @@ nf.Actions = (function () {
});
});
},
+
/**
* Moves the connection in the specified selection to the front.
*
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-birdseye.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-birdseye.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-birdseye.js
index 175b7c3..b409434 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-birdseye.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-birdseye.js
@@ -335,6 +335,7 @@ nf.Birdseye = (function () {
})
.call(brush);
},
+
/**
* Handles rendering of the birdseye tool.
*/
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-header.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-header.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-header.js
index 7d8b7b9..edd2000 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-header.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-header.js
@@ -103,7 +103,7 @@ nf.CanvasHeader = (function () {
// setup the refresh link actions
$('#refresh-required-link').click(function () {
- nf.Canvas.reload().then(function () {
+ nf.Canvas.reload().done(function () {
// update component visibility
nf.Canvas.View.updateVisibility();
@@ -113,7 +113,7 @@ nf.CanvasHeader = (function () {
// hide the refresh link
$('#stats-last-refreshed').removeClass('alert');
$('#refresh-required-container').hide();
- }, function () {
+ }).fail(function () {
nf.Dialog.showOkDialog({
dialogContent: 'Unable to refresh the current group.',
overlayBackground: true
@@ -126,12 +126,12 @@ nf.CanvasHeader = (function () {
type: 'GET',
url: config.urls.controllerAbout,
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
var aboutDetails = response.about;
// set the document title and the about title
document.title = aboutDetails.title;
$('#nf-version').text(aboutDetails.version);
- }, nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
// configure the about dialog
$('#nf-about').modal({
@@ -192,7 +192,7 @@ nf.CanvasHeader = (function () {
'style[background-color]': color
},
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
// update the revision
nf.Client.setRevision(response.revision);
@@ -202,7 +202,7 @@ nf.CanvasHeader = (function () {
} else {
nf.Label.set(response.label);
}
- }, function (xhr, status, error) {
+ }).fail(function (xhr, status, error) {
if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) {
nf.Dialog.showOkDialog({
dialogContent: nf.Common.escapeHtml(xhr.responseText),
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-toolbar.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-toolbar.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-toolbar.js
index ef7486f..23cb20f 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-toolbar.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-toolbar.js
@@ -95,6 +95,7 @@ nf.CanvasToolbar = (function () {
});
}
},
+
/**
* Called when the selection changes to update the toolbar appropriately.
*/
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-toolbox.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-toolbox.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-toolbox.js
index d8cccd0..530c8a2 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-toolbox.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-toolbox.js
@@ -394,7 +394,7 @@ nf.CanvasToolbox = (function () {
y: pt.y
},
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.processor)) {
// update the revision
nf.Client.setRevision(response.revision);
@@ -410,7 +410,7 @@ nf.CanvasToolbox = (function () {
// update the birdseye
nf.Birdseye.refresh();
}
- }, nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
};
/**
@@ -481,7 +481,7 @@ nf.CanvasToolbox = (function () {
y: pt.y
},
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.inputPort)) {
// update the revision
nf.Client.setRevision(response.revision);
@@ -497,7 +497,7 @@ nf.CanvasToolbox = (function () {
// update the birdseye
nf.Birdseye.refresh();
}
- }, nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
};
/**
@@ -568,7 +568,7 @@ nf.CanvasToolbox = (function () {
y: pt.y
},
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.outputPort)) {
// update the revision
nf.Client.setRevision(response.revision);
@@ -584,7 +584,7 @@ nf.CanvasToolbox = (function () {
// update the birdseye
nf.Birdseye.refresh();
}
- }, nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
};
/**
@@ -608,7 +608,7 @@ nf.CanvasToolbox = (function () {
y: pt.y
},
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.processGroup)) {
// update the revision
nf.Client.setRevision(response.revision);
@@ -624,7 +624,7 @@ nf.CanvasToolbox = (function () {
// update the birdseye
nf.Birdseye.refresh();
}
- }, nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
};
/**
@@ -692,7 +692,7 @@ nf.CanvasToolbox = (function () {
y: pt.y
},
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.remoteProcessGroup)) {
// update the revision
nf.Client.setRevision(response.revision);
@@ -708,7 +708,7 @@ nf.CanvasToolbox = (function () {
// update the birdseye
nf.Birdseye.refresh();
}
- }, nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
};
/**
@@ -730,7 +730,7 @@ nf.CanvasToolbox = (function () {
y: pt.y
},
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.funnel)) {
// update the revision
nf.Client.setRevision(response.revision);
@@ -743,7 +743,7 @@ nf.CanvasToolbox = (function () {
// update the birdseye
nf.Birdseye.refresh();
}
- }, nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
};
/**
@@ -756,7 +756,7 @@ nf.CanvasToolbox = (function () {
type: 'GET',
url: config.urls.templates,
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
var templates = response.templates;
if (nf.Common.isDefinedAndNotNull(templates) && templates.length > 0) {
var options = [];
@@ -809,7 +809,7 @@ nf.CanvasToolbox = (function () {
});
}
- }, nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
};
/**
@@ -833,7 +833,7 @@ nf.CanvasToolbox = (function () {
originY: pt.y
},
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
// update the revision
nf.Client.setRevision(response.revision);
@@ -845,7 +845,7 @@ nf.CanvasToolbox = (function () {
// update the birdseye
nf.Birdseye.refresh();
- }, nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
};
/**
@@ -869,7 +869,7 @@ nf.CanvasToolbox = (function () {
height: nf.Label.config.height
},
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.label)) {
// update the revision
nf.Client.setRevision(response.revision);
@@ -880,7 +880,7 @@ nf.CanvasToolbox = (function () {
// update the birdseye
nf.Birdseye.refresh();
}
- }, nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
};
return {
@@ -987,7 +987,7 @@ nf.CanvasToolbox = (function () {
type: 'GET',
url: config.urls.processorTypes,
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
var tagCloud = {};
var tags = [];
@@ -1090,7 +1090,7 @@ nf.CanvasToolbox = (function () {
processorTypesGrid.render();
});
processorTypesData.syncGridSelection(processorTypesGrid, false);
- }, nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
// define the function for filtering the list
$('#processor-type-filter').keyup(function () {
@@ -1146,6 +1146,7 @@ nf.CanvasToolbox = (function () {
$('<div/>').attr('title', nf.Common.config.type.label).addClass('label-icon-disable').addClass('toolbox-icon').appendTo(toolbox);
}
},
+
/**
* Prompts the user to enter the name for the group.
*
@@ -1162,9 +1163,9 @@ nf.CanvasToolbox = (function () {
$('#new-process-group-name').val('');
// create the group and resolve the deferred accordingly
- $.when(createGroup(groupName, pt)).then(function (response) {
+ createGroup(groupName, pt).done(function (response) {
deferred.resolve(response.processGroup);
- }, function () {
+ }).fail(function () {
deferred.reject();
});
};
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js
index 8cb2b33..00142c5 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js
@@ -91,6 +91,7 @@ nf.CanvasUtils = (function () {
}
}
},
+
/**
* Calculates the point on the specified bounding box that is closest to the
* specified point.
@@ -151,6 +152,7 @@ nf.CanvasUtils = (function () {
};
}
},
+
/**
* Shows the specified component in the specified group.
*
@@ -165,9 +167,9 @@ nf.CanvasUtils = (function () {
// load a different group if necessary
if (groupId !== nf.Canvas.getGroupId()) {
nf.Canvas.setGroupId(groupId);
- nf.Canvas.reload().then(function () {
+ nf.Canvas.reload().done(function () {
deferred.resolve();
- }, function () {
+ }).fail(function () {
nf.Dialog.showOkDialog({
dialogContent: 'Unable to load the group for the specified component.',
overlayBackground: false
@@ -194,6 +196,7 @@ nf.CanvasUtils = (function () {
});
}
},
+
/**
* Gets the currently selected components and connections.
*
@@ -221,6 +224,7 @@ nf.CanvasUtils = (function () {
// calculate the difference between the center point and the position of this component and convert to screen space
nf.Canvas.View.translate([(center[0] - boundingBox.x) * scale, (center[1] - boundingBox.y) * scale]);
},
+
/**
* Position the component accordingly.
*
@@ -236,6 +240,7 @@ nf.CanvasUtils = (function () {
return 'translate(' + d.component.position.x + ', ' + d.component.position.y + ')';
});
},
+
/**
* Applies single line ellipsis to the component in the specified selection if necessary.
*
@@ -271,6 +276,7 @@ nf.CanvasUtils = (function () {
selection.text(text.substring(0, i) + String.fromCharCode(8230));
}
},
+
/**
* Applies multiline ellipsis to the component in the specified seleciton. Text will
* wrap for the specified number of lines. The last line will be ellipsis if necessary.
@@ -343,6 +349,7 @@ nf.CanvasUtils = (function () {
word = words.pop();
}
},
+
/**
* Updates the active thread count on the specified selection.
*
@@ -388,6 +395,7 @@ nf.CanvasUtils = (function () {
selection.selectAll('text.active-thread-count, rect.active-thread-count-background').style('display', 'none');
}
},
+
/**
* Disables the default browser behavior of following image href when control clicking.
*
@@ -400,6 +408,7 @@ nf.CanvasUtils = (function () {
}
});
},
+
/**
* Handles component bulletins.
*
@@ -456,6 +465,7 @@ nf.CanvasUtils = (function () {
selection.selectAll('image.bulletin-icon').style('display', 'none');
}
},
+
/**
* Adds the specified tooltip to the specified target.
*
@@ -473,6 +483,7 @@ nf.CanvasUtils = (function () {
tip.style('display', 'none');
});
},
+
/**
* Determines if the specified selection is a connection.
*
@@ -481,6 +492,7 @@ nf.CanvasUtils = (function () {
isConnection: function (selection) {
return selection.classed('connection');
},
+
/**
* Determines if the specified selection is a remote process group.
*
@@ -489,6 +501,7 @@ nf.CanvasUtils = (function () {
isRemoteProcessGroup: function (selection) {
return selection.classed('remote-process-group');
},
+
/**
* Determines if the specified selection is a processor.
*
@@ -497,6 +510,7 @@ nf.CanvasUtils = (function () {
isProcessor: function (selection) {
return selection.classed('processor');
},
+
/**
* Determines if the specified selection is a label.
*
@@ -505,6 +519,7 @@ nf.CanvasUtils = (function () {
isLabel: function (selection) {
return selection.classed('label');
},
+
/**
* Determines if the specified selection is an input port.
*
@@ -513,6 +528,7 @@ nf.CanvasUtils = (function () {
isInputPort: function (selection) {
return selection.classed('input-port');
},
+
/**
* Determines if the specified selection is an output port.
*
@@ -521,6 +537,7 @@ nf.CanvasUtils = (function () {
isOutputPort: function (selection) {
return selection.classed('output-port');
},
+
/**
* Determines if the specified selection is a process group.
*
@@ -529,6 +546,7 @@ nf.CanvasUtils = (function () {
isProcessGroup: function (selection) {
return selection.classed('process-group');
},
+
/**
* Determines if the specified selection is a funnel.
*
@@ -537,6 +555,7 @@ nf.CanvasUtils = (function () {
isFunnel: function (selection) {
return selection.classed('funnel');
},
+
/**
* Determines if the components in the specified selection are runnable.
*
@@ -558,6 +577,7 @@ nf.CanvasUtils = (function () {
return runnable;
},
+
/**
* Determines if the component in the specified selection is runnable.
*
@@ -578,6 +598,7 @@ nf.CanvasUtils = (function () {
return runnable;
},
+
/**
* Determines if the components in the specified selection are stoppable.
*
@@ -599,6 +620,7 @@ nf.CanvasUtils = (function () {
return stoppable;
},
+
/**
* Determines if the component in the specified selection is runnable.
*
@@ -617,6 +639,7 @@ nf.CanvasUtils = (function () {
return stoppable;
},
+
/**
* Determines if the specified selection can all start transmitting.
*
@@ -637,6 +660,7 @@ nf.CanvasUtils = (function () {
});
return canStartTransmitting;
},
+
/**
* Determines if the specified selection supports starting transmission.
*
@@ -645,6 +669,7 @@ nf.CanvasUtils = (function () {
canStartTransmitting: function (selection) {
return nf.CanvasUtils.isRemoteProcessGroup(selection);
},
+
/**
* Determines if the specified selection can all stop transmitting.
*
@@ -665,6 +690,7 @@ nf.CanvasUtils = (function () {
});
return canStopTransmitting;
},
+
/**
* Determines if the specified selection can stop transmission.
*
@@ -673,6 +699,7 @@ nf.CanvasUtils = (function () {
canStopTransmitting: function (selection) {
return nf.CanvasUtils.isRemoteProcessGroup(selection);
},
+
/**
* Determines whether the components in the specified selection are deletable.
*
@@ -686,6 +713,7 @@ nf.CanvasUtils = (function () {
return nf.CanvasUtils.supportsModification(selection);
},
+
/**
* Determines whether the specified selection is in a state to support modification.
*
@@ -741,6 +769,7 @@ nf.CanvasUtils = (function () {
}
return supportsModification;
},
+
/**
* Determines the connectable type for the specified source selection.
*
@@ -761,6 +790,7 @@ nf.CanvasUtils = (function () {
}
return type;
},
+
/**
* Determines the connectable type for the specified destination selection.
*
@@ -781,6 +811,7 @@ nf.CanvasUtils = (function () {
}
return type;
},
+
/**
* Determines if the graph is currently in a state to copy.
*
@@ -813,12 +844,14 @@ nf.CanvasUtils = (function () {
// ensure everything selected is copyable
return selection.size() === copyable.size();
},
+
/**
* Determines if something is currently pastable.
*/
isPastable: function () {
return nf.Clipboard.isCopied();
},
+
/**
* Persists the current user view.
*/
@@ -836,6 +869,7 @@ nf.CanvasUtils = (function () {
// store the item
nf.Storage.setItem(name, item);
},
+
/**
* Gets the name for this connection.
*
@@ -849,6 +883,7 @@ nf.CanvasUtils = (function () {
}
return '';
},
+
/**
* Returns the component id of the source of this processor. If the connection is attached
* to a port in a [sub|remote] group, the component id will be that of the group. Otherwise
@@ -863,6 +898,7 @@ nf.CanvasUtils = (function () {
}
return sourceId;
},
+
/**
* Returns the component id of the source of this processor. If the connection is attached
* to a port in a [sub|remote] group, the component id will be that of the group. Otherwise
@@ -877,6 +913,7 @@ nf.CanvasUtils = (function () {
}
return destinationId;
},
+
/**
* Attempts to restore a persisted view. Returns a flag that indicates if the
* view was restored.
@@ -911,6 +948,7 @@ nf.CanvasUtils = (function () {
return viewRestored;
},
+
/**
* Enters the specified group.
*
@@ -944,6 +982,7 @@ nf.CanvasUtils = (function () {
});
});
},
+
/**
* Gets the origin of the bounding box for the specified selection.
*
@@ -966,6 +1005,7 @@ nf.CanvasUtils = (function () {
return origin;
},
+
/**
* Moves the specified components into the specified group.
*
@@ -979,11 +1019,11 @@ nf.CanvasUtils = (function () {
nf.CanvasUtils.eligibleForMove(components, group).done(function () {
// create a snippet for the specified components and link to the data flow
var snippetDetails = nf.Snippet.marshal(components, true);
- nf.Snippet.create(snippetDetails).then(function (response) {
+ nf.Snippet.create(snippetDetails).done(function (response) {
var snippet = response.snippet;
// move the snippet into the target
- nf.Snippet.move(snippet.id, groupData.component.id).then(function () {
+ nf.Snippet.move(snippet.id, groupData.component.id).done(function () {
var componentMap = d3.map();
// add the id to the type's array
@@ -1006,16 +1046,17 @@ nf.CanvasUtils = (function () {
// reload the target group
nf.ProcessGroup.reload(groupData.component);
- }, nf.Common.handleAjaxError).always(function () {
+ }).fail(nf.Common.handleAjaxError).always(function () {
// unable to acutally move the components so attempt to
// unlink and remove just the snippet
nf.Snippet.unlink(snippet.id).done(function () {
nf.Snippet.remove(snippet.id);
});
});
- }, nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
});
},
+
/**
* Removes any dangling edges. All components are retained as well as any
* edges whose source and destination are also retained.
@@ -1053,6 +1094,7 @@ nf.CanvasUtils = (function () {
}
});
},
+
/**
* Determines if the specified selection is disconnected from other nodes.
*
@@ -1098,6 +1140,7 @@ nf.CanvasUtils = (function () {
return isDisconnected;
},
+
/**
* Ensures components are eligible to be moved. The new target can be optionally specified.
*
@@ -1138,7 +1181,7 @@ nf.CanvasUtils = (function () {
type: 'GET',
url: config.urls.controller + '/process-groups/' + encodeURIComponent(nf.Canvas.getParentGroupId()) + '/connections',
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
var connections = response.connections;
var conflictingPorts = [];
@@ -1173,7 +1216,7 @@ nf.CanvasUtils = (function () {
portConnectionDeferred.resolve();
}
- }, function () {
+ }).fail(function () {
portConnectionDeferred.reject();
});
}
@@ -1193,7 +1236,7 @@ nf.CanvasUtils = (function () {
verbose: true
},
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
var processGroup = response.processGroup;
var processGroupContents = processGroup.contents;
@@ -1224,24 +1267,24 @@ nf.CanvasUtils = (function () {
} else {
portNameDeferred.resolve();
}
- }, function () {
+ }).fail(function () {
portNameDeferred.reject();
});
}).promise();
};
// execute the checks in order
- $.when(portConnectionCheck()).then(function () {
+ portConnectionCheck().done(function () {
if (nf.Common.isDefinedAndNotNull(group)) {
- $.when(portNameCheck()).then(function () {
+ $.when(portNameCheck()).done(function () {
deferred.resolve();
- }, function () {
+ }).fail(function () {
deferred.reject();
});
} else {
deferred.resolve();
}
- }, function () {
+ }).fail(function () {
deferred.reject();
});
} else {
@@ -1249,6 +1292,7 @@ nf.CanvasUtils = (function () {
}
}).promise();
},
+
/**
* Determines if the component in the specified selection is a valid connection source.
*
@@ -1264,6 +1308,7 @@ nf.CanvasUtils = (function () {
nf.CanvasUtils.isRemoteProcessGroup(selection) || nf.CanvasUtils.isInputPort(selection) ||
nf.CanvasUtils.isFunnel(selection);
},
+
/**
* Determines if the component in the specified selection is a valid connection destination.
*
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
index e72b5c8..c4798be 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
@@ -170,7 +170,7 @@ nf.Canvas = (function () {
type: 'GET',
url: config.urls.revision,
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.revision)) {
var revision = response.revision;
var currentRevision = nf.Client.getRevision();
@@ -187,7 +187,7 @@ nf.Canvas = (function () {
}
}
}
- }, nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
};
/**
@@ -534,7 +534,7 @@ nf.Canvas = (function () {
type: 'GET',
url: config.urls.banners,
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
// ensure the banners response is specified
if (nf.Common.isDefinedAndNotNull(response.banners)) {
if (nf.Common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') {
@@ -558,7 +558,7 @@ nf.Canvas = (function () {
// update the graph dimensions
updateGraphSize();
- }, nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
};
/**
@@ -614,7 +614,7 @@ nf.Canvas = (function () {
type: 'GET',
url: config.urls.status,
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
// report the updated status
if (nf.Common.isDefinedAndNotNull(response.controllerStatus)) {
var controllerStatus = response.controllerStatus;
@@ -712,7 +712,7 @@ nf.Canvas = (function () {
$('#has-pending-accounts').hide();
}
}
- }, nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
};
/**
@@ -729,7 +729,7 @@ nf.Canvas = (function () {
verbose: true
},
dataType: 'json'
- }).then(function (processGroupResponse) {
+ }).done(function (processGroupResponse) {
// set the revision
nf.Client.setRevision(processGroupResponse.revision);
@@ -759,7 +759,7 @@ nf.Canvas = (function () {
// update the toolbar
nf.CanvasToolbar.refresh();
- }, nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
};
/**
@@ -777,7 +777,7 @@ nf.Canvas = (function () {
recursive: false
},
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
// report the updated stats
if (nf.Common.isDefinedAndNotNull(response.processGroupStatus)) {
var processGroupStatus = response.processGroupStatus;
@@ -789,7 +789,7 @@ nf.Canvas = (function () {
$('#stats-last-refreshed').text(processGroupStatus.statsLastRefreshed);
}
deferred.resolve();
- }, function (xhr, status, error) {
+ }).fail(function (xhr, status, error) {
// if clustered, a 404 likely means the flow status at the ncm is stale
if (!nf.Canvas.isClustered() || xhr.status !== 404) {
nf.Common.handleAjaxError(xhr, status, error);
@@ -857,9 +857,9 @@ nf.Canvas = (function () {
}
// don't load the status until the graph is loaded
- reloadStatus(nf.Canvas.getGroupId()).then(function () {
+ reloadStatus(nf.Canvas.getGroupId()).done(function () {
deferred.resolve(processGroupResult);
- }, function () {
+ }).fail(function () {
deferred.reject();
});
});
@@ -871,9 +871,9 @@ nf.Canvas = (function () {
reloadStatus: function () {
return $.Deferred(function (deferred) {
// refresh the status and check any bulletins
- $.when(reloadStatus(nf.Canvas.getGroupId()), reloadFlowStatus()).then(function () {
+ $.when(reloadStatus(nf.Canvas.getGroupId()), reloadFlowStatus()).done(function () {
deferred.resolve();
- }, function () {
+ }).fail(function () {
deferred.reject();
});
}).promise();
@@ -900,13 +900,13 @@ nf.Canvas = (function () {
url: config.urls.cluster
}).done(function (response, status, xhr) {
clustered = true;
- deferred.resolveWith(xhr, [response, status, xhr]);
+ deferred.resolve(response, status, xhr);
}).fail(function (xhr, status, error) {
if (xhr.status === 404) {
clustered = false;
- deferred.resolveWith(xhr, ['', 'success', xhr]);
+ deferred.resolve('', 'success', xhr);
} else {
- deferred.rejectWith(xhr, [xhr, status, error]);
+ deferred.reject(xhr, status, error);
}
});
}).promise();
@@ -919,7 +919,7 @@ nf.Canvas = (function () {
});
// ensure the authorities and config request is processed first
- $.when(authoritiesXhr, configXhr).then(function (authoritiesResult, configResult) {
+ $.when(authoritiesXhr, configXhr).done(function (authoritiesResult, configResult) {
var authoritiesResponse = authoritiesResult[0];
var configResponse = configResult[0];
@@ -934,7 +934,7 @@ nf.Canvas = (function () {
var configDetails = configResponse.config;
// when both request complete, load the application
- isClusteredRequest.then(function () {
+ isClusteredRequest.done(function () {
// get the auto refresh interval
var autoRefreshIntervalSeconds = parseInt(configDetails.autoRefreshIntervalSeconds, 10);
@@ -942,7 +942,7 @@ nf.Canvas = (function () {
secureSiteToSite = configDetails.siteToSiteSecure;
// load d3
- loadD3().then(function () {
+ loadD3().done(function () {
nf.Storage.init();
// initialize the application
@@ -982,7 +982,7 @@ nf.Canvas = (function () {
nf.ConnectionDetails.init();
nf.RemoteProcessGroupDetails.init();
nf.GoTo.init();
- nf.Graph.init().then(function () {
+ nf.Graph.init().done(function () {
// determine the split between the polling
var pollingSplit = autoRefreshIntervalSeconds / 2;
@@ -994,10 +994,10 @@ nf.Canvas = (function () {
// hide the splash screen
nf.Canvas.hideSplash();
- }, nf.Common.handleAjaxError);
- }, nf.Common.handleAjaxError);
- }, nf.Common.handleAjaxError);
- }, nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
},
/**
* Defines the gradient colors used to render processors.
@@ -1214,6 +1214,7 @@ nf.Canvas = (function () {
// add the behavior to the canvas and disable dbl click zoom
svg.call(behavior).on('dblclick.zoom', null);
},
+
/**
* Whether or not a component should be rendered based solely on the current scale.
*
@@ -1222,6 +1223,7 @@ nf.Canvas = (function () {
shouldRenderPerScale: function () {
return nf.Canvas.View.scale() >= MIN_SCALE_TO_RENDER;
},
+
/**
* Updates component visibility based on the current translation/scale.
*/
@@ -1229,6 +1231,7 @@ nf.Canvas = (function () {
updateComponentVisibility();
nf.Graph.pan();
},
+
/**
* Sets/gets the current translation.
*
@@ -1241,6 +1244,7 @@ nf.Canvas = (function () {
behavior.translate(translate);
}
},
+
/**
* Sets/gets the current scale.
*
@@ -1253,6 +1257,7 @@ nf.Canvas = (function () {
behavior.scale(scale);
}
},
+
/**
* Zooms in a single zoom increment.
*/
@@ -1277,6 +1282,7 @@ nf.Canvas = (function () {
height: 1
});
},
+
/**
* Zooms out a single zoom increment.
*/
@@ -1301,6 +1307,7 @@ nf.Canvas = (function () {
height: 1
});
},
+
/**
* Zooms to fit the entire graph on the canvas.
*/
@@ -1347,6 +1354,7 @@ nf.Canvas = (function () {
height: canvasHeight / newScale
});
},
+
/**
* Zooms to the actual size (1 to 1).
*/
@@ -1395,6 +1403,7 @@ nf.Canvas = (function () {
// center as appropriate
nf.CanvasUtils.centerBoundingBox(box);
},
+
/**
* Refreshes the view based on the configured translation and scale.
*
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-clipboard.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-clipboard.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-clipboard.js
index d4a035b..4f22d7e 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-clipboard.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-clipboard.js
@@ -34,6 +34,7 @@ nf.Clipboard = (function () {
addListener: function (listener, funct) {
listeners[listener] = funct;
},
+
/**
* Remove the specified listener.
*
@@ -44,6 +45,7 @@ nf.Clipboard = (function () {
delete listeners[listener];
}
},
+
/**
* Copy the specified data.
*
@@ -57,12 +59,14 @@ nf.Clipboard = (function () {
listeners[listener].call(listener, COPY, data);
}
},
+
/**
* Checks to see if any data has been copied.
*/
isCopied: function () {
return nf.Common.isDefinedAndNotNull(data);
},
+
/**
* Gets the most recent data thats copied. This operation
* will remove the corresponding data from the clipboard.
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connectable.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connectable.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connectable.js
index 31370b8..598b2ef 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connectable.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connectable.js
@@ -157,6 +157,7 @@ nf.Connectable = (function () {
d3.select(this).remove();
});
},
+
activate: function (components) {
components
.on('mouseenter.connectable', function (d) {
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection-configuration.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection-configuration.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection-configuration.js
index d9d1f77..a8e4acc 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection-configuration.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection-configuration.js
@@ -250,7 +250,7 @@ nf.ConnectionConfiguration = (function () {
verbose: true
},
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
var processGroup = response.processGroup;
var processGroupContents = processGroup.contents;
@@ -301,7 +301,7 @@ nf.ConnectionConfiguration = (function () {
deferred.reject();
}
- }, function (xhr, status, error) {
+ }).fail(function (xhr, status, error) {
// handle the error
nf.Common.handleAjaxError(xhr, status, error);
@@ -327,7 +327,7 @@ nf.ConnectionConfiguration = (function () {
verbose: true
},
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
var remoteProcessGroup = response.remoteProcessGroup;
var remoteProcessGroupContents = remoteProcessGroup.contents;
@@ -379,7 +379,7 @@ nf.ConnectionConfiguration = (function () {
deferred.reject();
}
- }, function (xhr, status, error) {
+ }).fail(function (xhr, status, error) {
// handle the error
nf.Common.handleAjaxError(xhr, status, error);
@@ -475,7 +475,7 @@ nf.ConnectionConfiguration = (function () {
verbose: true
},
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
var processGroup = response.processGroup;
var processGroupContents = processGroup.contents;
@@ -526,7 +526,7 @@ nf.ConnectionConfiguration = (function () {
deferred.reject();
}
- }, function (xhr, status, error) {
+ }).fail(function (xhr, status, error) {
// handle the error
nf.Common.handleAjaxError(xhr, status, error);
@@ -551,7 +551,7 @@ nf.ConnectionConfiguration = (function () {
verbose: true
},
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
var remoteProcessGroup = response.remoteProcessGroup;
var remoteProcessGroupContents = remoteProcessGroup.contents;
@@ -603,7 +603,7 @@ nf.ConnectionConfiguration = (function () {
deferred.reject();
}
- }, function (xhr, status, error) {
+ }).fail(function (xhr, status, error) {
// handle the error
nf.Common.handleAjaxError(xhr, status, error);
@@ -848,7 +848,7 @@ nf.ConnectionConfiguration = (function () {
destinationType: destinationType
},
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
// update the revision
nf.Client.setRevision(response.revision);
@@ -876,7 +876,7 @@ nf.ConnectionConfiguration = (function () {
// update the birdseye
nf.Birdseye.refresh();
- }, function (xhr, status, error) {
+ }).fail(function (xhr, status, error) {
// handle the error
nf.Common.handleAjaxError(xhr, status, error);
});
@@ -935,7 +935,7 @@ nf.ConnectionConfiguration = (function () {
destinationGroupId: destinationGroupId
},
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.connection)) {
var connection = response.connection;
@@ -959,7 +959,7 @@ nf.ConnectionConfiguration = (function () {
nf.RemoteProcessGroup.reload(destinationData.component);
}
}
- }, function (xhr, status, error) {
+ }).fail(function (xhr, status, error) {
if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) {
nf.Dialog.showOkDialog({
dialogContent: nf.Common.escapeHtml(xhr.responseText),
@@ -1128,7 +1128,7 @@ nf.ConnectionConfiguration = (function () {
type: 'GET',
url: config.urls.prioritizers,
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
// create an element for each available prioritizer
$.each(response.prioritizerTypes, function (i, documentedType) {
nf.ConnectionConfiguration.addAvailablePrioritizer('#prioritizer-available', documentedType);
@@ -1142,8 +1142,9 @@ nf.ConnectionConfiguration = (function () {
opacity: 0.6
});
$('#prioritizer-available, #prioritizer-selected').disableSelection();
- }, nf.Common.handleAjaxError);
+ }).fail(nf.Common.handleAjaxError);
},
+
/**
* Adds the specified prioritizer to the specified container.
*
@@ -1165,6 +1166,7 @@ nf.ConnectionConfiguration = (function () {
}));
}
},
+
/**
* Shows the dialog for creating a new connection.
*
@@ -1209,6 +1211,7 @@ nf.ConnectionConfiguration = (function () {
removeTempEdge();
});
},
+
/**
* Shows the configuration for the specified connection. If a destination is
* specified it will be considered a new destination.
@@ -1232,7 +1235,7 @@ nf.ConnectionConfiguration = (function () {
}
// initialize the connection dialog
- $.when(initializeSourceEditConnectionDialog(source), initializeDestinationEditConnectionDialog(destination)).then(function () {
+ $.when(initializeSourceEditConnectionDialog(source), initializeDestinationEditConnectionDialog(destination)).done(function () {
var availableRelationships = connection.availableRelationships;
var selectedRelationships = connection.selectedRelationships;
@@ -1311,9 +1314,9 @@ nf.ConnectionConfiguration = (function () {
if (nf.CanvasUtils.isProcessor(source)) {
if (selectedRelationships.length > 0) {
// if there are relationships selected update
- updateConnection(selectedRelationships).then(function () {
+ updateConnection(selectedRelationships).done(function () {
deferred.resolve();
- }, function () {
+ }).fail(function () {
deferred.reject();
});
} else {
@@ -1328,9 +1331,9 @@ nf.ConnectionConfiguration = (function () {
}
} else {
// there are no relationships, but the source wasn't a processor, so update anyway
- updateConnection(undefined).then(function () {
+ updateConnection(undefined).done(function () {
deferred.resolve();
- }, function () {
+ }).fail(function () {
deferred.reject();
});
}
@@ -1366,7 +1369,7 @@ nf.ConnectionConfiguration = (function () {
if (relationshipNames.is(':visible') && relationshipNames.get(0).scrollHeight > relationshipNames.innerHeight()) {
relationshipNames.css('border-width', '1px');
}
- }, function () {
+ }).fail(function () {
deferred.reject();
});
}).promise();
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js
index d30eae5..0b0c40a 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js
@@ -945,13 +945,13 @@ nf.Connection = (function () {
data: JSON.stringify(entity),
dataType: 'json',
contentType: 'application/json'
- }).then(function (response) {
+ }).done(function (response) {
// update the revision
nf.Client.setRevision(response.revision);
// request was successful, update the entry
nf.Connection.set(response.connection);
- }, function (xhr, status, error) {
+ }).fail(function (xhr, status, error) {
if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) {
nf.Dialog.showOkDialog({
dialogContent: nf.Common.escapeHtml(xhr.responseText),
@@ -973,6 +973,7 @@ nf.Connection = (function () {
selfLoopXOffset: (dimensions.width / 2) + 5,
selfLoopYOffset: 25
},
+
init: function () {
connectionMap = d3.map();
@@ -1122,7 +1123,7 @@ nf.Connection = (function () {
url: connectionData.component.uri,
data: updatedConnectionData,
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
var connectionData = response.connection;
// update the revision
@@ -1130,7 +1131,7 @@ nf.Connection = (function () {
// refresh to update the label
nf.Connection.set(connectionData);
- }, function (xhr, status, error) {
+ }).fail(function (xhr, status, error) {
if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) {
nf.Dialog.showOkDialog({
dialogContent: nf.Common.escapeHtml(xhr.responseText),
@@ -1268,6 +1269,7 @@ nf.Connection = (function () {
d3.event.sourceEvent.stopPropagation();
});
},
+
/**
* Populates the graph with the specified connections.
*
@@ -1304,12 +1306,14 @@ nf.Connection = (function () {
// apply the selection and handle all new connection
select().enter().call(renderConnections, selectAll);
},
+
/**
* Reorders the connections based on their current z index.
*/
reorder: function () {
d3.selectAll('g.connection').call(sort);
},
+
/**
* Sets the value of the specified connection.
*
@@ -1343,6 +1347,7 @@ nf.Connection = (function () {
set(connection);
}
},
+
/**
* Sets the connection status using the specified status.
*
@@ -1364,6 +1369,7 @@ nf.Connection = (function () {
// update the visible connections
d3.selectAll('g.connection.visible').call(updateConnectionStatus);
},
+
/**
* Refreshes the connection in the UI.
*
@@ -1376,12 +1382,14 @@ nf.Connection = (function () {
d3.selectAll('g.connection').call(updateConnections, true, true);
}
},
+
/**
* Refreshes the components necessary after a pan event.
*/
pan: function () {
d3.selectAll('g.connection.entering, g.connection.leaving').call(updateConnections, false, true);
},
+
/**
* Removes the specified connection.
*
@@ -1399,12 +1407,14 @@ nf.Connection = (function () {
// apply the selection and handle all removed connections
select().exit().call(removeConnections);
},
+
/**
* Removes all processors.
*/
removeAll: function () {
nf.Connection.remove(connectionMap.keys());
},
+
/**
* Reloads the connection state from the server and refreshes the UI.
*
@@ -1421,6 +1431,7 @@ nf.Connection = (function () {
});
}
},
+
/**
* Gets the connection that have a source or destination component with the specified id.
*
@@ -1439,6 +1450,7 @@ nf.Connection = (function () {
});
return connections;
},
+
/**
* If the connection id is specified it is returned. If no connection id
* specified, all connections are returned.
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-context-menu.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-context-menu.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-context-menu.js
index dff1fdd..6365dd5 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-context-menu.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-context-menu.js
@@ -417,12 +417,14 @@ nf.ContextMenu = (function () {
'y': position[1]
});
},
+
/**
* Hides the context menu.
*/
hide: function () {
$('#context-menu').hide();
},
+
/**
* Activates the context menu for the components in the specified selection.
*
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-draggable.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-draggable.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-draggable.js
index 0865e7e..2eb3f1b 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-draggable.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-draggable.js
@@ -57,7 +57,7 @@ nf.Draggable = (function () {
y: newPosition.y
},
dataType: 'json'
- }).then(function (response) {
+ }).done(function (response) {
// update the revision
nf.Client.setRevision(response.revision);
@@ -69,7 +69,7 @@ nf.Draggable = (function () {
type: d.type,
id: d.component.id
});
- }, function (xhr, status, error) {
+ }).fail(function (xhr, status, error) {
if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) {
nf.Dialog.showOkDialog({
dialogContent: nf.Common.escapeHtml(xhr.responseText),
@@ -114,7 +114,7 @@ nf.Draggable = (function () {
data: JSON.stringify(entity),
dataType: 'json',
contentType: 'application/json'
- }).then(function (response) {
+ }).done(function (response) {
// update the revision
nf.Client.setRevision(response.revision);
@@ -132,7 +132,7 @@ nf.Draggable = (function () {
type: d.type,
id: d.component.id
});
- }, function (xhr, status, error) {
+ }).fail(function (xhr, status, error) {
if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) {
nf.Dialog.showOkDialog({
dialogContent: nf.Common.escapeHtml(xhr.responseText),
@@ -300,6 +300,7 @@ nf.Draggable = (function () {
dragSelection.remove();
});
},
+
/**
* Activates the drag behavior for the components in the specified selection.
*
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/2965258e/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-funnel.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-funnel.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-funnel.js
index 84263d6..c21969e 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-funnel.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-funnel.js
@@ -135,6 +135,7 @@ nf.Funnel = (function () {
'class': 'funnels'
});
},
+
/**
* Populates the graph with the specified funnels.
*
@@ -165,6 +166,7 @@ nf.Funnel = (function () {
// apply the selection and handle all new processors
select().enter().call(renderFunnels, selectAll);
},
+
/**
* If the funnel id is specified it is returned. If no funnel id
* specified, all funnels are returned.
@@ -178,6 +180,7 @@ nf.Funnel = (function () {
return funnelMap.get(id);
}
},
+
/**
* If the funnel id is specified it is refresh according to the current
* state. If not funnel id is specified, all funnels are refreshed.
@@ -191,6 +194,7 @@ nf.Funnel = (function () {
d3.selectAll('g.funnel').call(updateFunnels);
}
},
+
/**
* Reloads the funnel state from the server and refreshes the UI.
* If the funnel is currently unknown, this function just returns.
@@ -208,6 +212,7 @@ nf.Funnel = (function () {
});
}
},
+
/**
* Positions the component.
*
@@ -216,6 +221,7 @@ nf.Funnel = (function () {
position: function (id) {
d3.select('#id-' + id).call(nf.CanvasUtils.position);
},
+
/**
* Sets the specified funnel(s). If the is an array, it
* will set each funnel. If it is not an array, it will
@@ -244,6 +250,7 @@ nf.Funnel = (function () {
set(funnels);
}
},
+
/**
* Removes the specified funnel.
*
@@ -261,6 +268,7 @@ nf.Funnel = (function () {
// apply the selection and handle all removed funnels
select().exit().call(removeFunnels);
},
+
/**
* Removes all processors.
*/