mirror of
https://github.com/apache/nifi.git
synced 2025-02-16 06:55:28 +00:00
[NIFI-3360] resolve clashing variable name for connection and nf.Connection. This closes #1506
This commit is contained in:
parent
855743f933
commit
d9828c240b
@ -28,8 +28,8 @@
|
||||
'nf.Dialog',
|
||||
'nf.Client',
|
||||
'nf.ErrorHandler'],
|
||||
function ($, d3, connection, birdseye, canvasUtils, common, dialog, client, errorHandler) {
|
||||
return (nf.Draggable = factory($, d3, connection, birdseye, canvasUtils, common, dialog, client, errorHandler));
|
||||
function ($, d3, nfConnection, birdseye, canvasUtils, common, dialog, client, errorHandler) {
|
||||
return (nf.Draggable = factory($, d3, nfConnection, birdseye, canvasUtils, common, dialog, client, errorHandler));
|
||||
});
|
||||
} else if (typeof exports === 'object' && typeof module === 'object') {
|
||||
module.exports = (nf.Draggable =
|
||||
@ -53,7 +53,7 @@
|
||||
root.nf.Client,
|
||||
root.nf.ErrorHandler);
|
||||
}
|
||||
}(this, function ($, d3, connection, birdseye, canvasUtils, common, dialog, client, errorHandler) {
|
||||
}(this, function ($, d3, nfConnection, birdseye, canvasUtils, common, dialog, client, errorHandler) {
|
||||
'use strict';
|
||||
|
||||
var nfCanvas;
|
||||
@ -102,10 +102,10 @@
|
||||
// go through each selected component
|
||||
selectedComponents.each(function (d) {
|
||||
// consider any self looping connections
|
||||
var connections = connection.getComponentConnections(d.id);
|
||||
var connections = nfConnection.getComponentConnections(d.id);
|
||||
$.each(connections, function (_, connection) {
|
||||
if (!updates.has(connection.id) && canvasUtils.getConnectionSourceComponentId(connection) === canvasUtils.getConnectionDestinationComponentId(connection)) {
|
||||
var connectionUpdate = nfDraggable.updateConnectionPosition(connection.get(connection.id), delta);
|
||||
var connectionUpdate = nfDraggable.updateConnectionPosition(nfConnection.get(connection.id), delta);
|
||||
if (connectionUpdate !== null) {
|
||||
updates.set(connection.id, connectionUpdate);
|
||||
}
|
||||
@ -335,7 +335,7 @@
|
||||
contentType: 'application/json'
|
||||
}).done(function (response) {
|
||||
// update the component
|
||||
connection.set(response);
|
||||
nfConnection.set(response);
|
||||
|
||||
// resolve with an object so we can refresh when finished
|
||||
deferred.resolve({
|
||||
@ -363,6 +363,7 @@
|
||||
* @param updates
|
||||
*/
|
||||
refreshConnections: function (updates) {
|
||||
if (updates.size() > 0) {
|
||||
// wait for all updates to complete
|
||||
$.when.apply(window, updates.values()).done(function () {
|
||||
var dragged = $.makeArray(arguments);
|
||||
@ -375,7 +376,7 @@
|
||||
connections.add(component.id);
|
||||
} else {
|
||||
// get connections that need to be refreshed because its attached to this component
|
||||
var componentConnections = connection.getComponentConnections(component.id);
|
||||
var componentConnections = nfConnection.getComponentConnections(component.id);
|
||||
$.each(componentConnections, function (_, connection) {
|
||||
connections.add(connection.id);
|
||||
});
|
||||
@ -384,11 +385,12 @@
|
||||
|
||||
// refresh the connections
|
||||
connections.forEach(function (connectionId) {
|
||||
connection.refresh(connectionId);
|
||||
nfConnection.refresh(connectionId);
|
||||
});
|
||||
}).always(function () {
|
||||
birdseye.refresh();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user