NIFI-6118 - Fix: UI - Not all calls to nfCanvasUtil.reloadConnectionSourceAndDestination are made with the proper component IDs

This closes #3368
This commit is contained in:
Rob Fellows 2019-03-13 13:07:15 -04:00 committed by Matt Gilman
parent 6401e32a33
commit 0cb15cfb1a
No known key found for this signature in database
GPG Key ID: DF61EC19432AEE37
1 changed files with 10 additions and 5 deletions

View File

@ -1630,7 +1630,9 @@
var removeConnections = function (removed) { var removeConnections = function (removed) {
// consider reloading source/destination of connection being removed // consider reloading source/destination of connection being removed
removed.each(function (d) { removed.each(function (d) {
nfCanvasUtils.reloadConnectionSourceAndDestination(d.sourceId, d.destinationId); var sourceComponentId = nfCanvasUtils.getConnectionSourceComponentId(d);
var destinationComponentId = nfCanvasUtils.getConnectionDestinationComponentId(d);
nfCanvasUtils.reloadConnectionSourceAndDestination(sourceComponentId, destinationComponentId);
}); });
// remove the connection // remove the connection
@ -1767,7 +1769,7 @@
// get the corresponding connection // get the corresponding connection
var connection = d3.select(this.parentNode); var connection = d3.select(this.parentNode);
var connectionData = connection.datum(); var connectionData = connection.datum();
var previousDestinationId = connectionData.destinationId; var previousDestinationComponentId = nfCanvasUtils.getConnectionDestinationComponentId(connectionData);
// attempt to select a new destination // attempt to select a new destination
var destination = d3.select('g.connectable-destination'); var destination = d3.select('g.connectable-destination');
@ -1784,7 +1786,7 @@
// user will select new port and updated connect details will be set accordingly // user will select new port and updated connect details will be set accordingly
nfConnectionConfiguration.showConfiguration(connection, destination).done(function () { nfConnectionConfiguration.showConfiguration(connection, destination).done(function () {
// reload the previous destination // reload the previous destination
nfCanvasUtils.reloadConnectionSourceAndDestination(null, previousDestinationId); nfCanvasUtils.reloadConnectionSourceAndDestination(null, previousDestinationComponentId);
}).fail(function () { }).fail(function () {
// reset the connection // reset the connection
connection.call(updateConnections, { connection.call(updateConnections, {
@ -1843,8 +1845,11 @@
nfConnection.set(response); nfConnection.set(response);
// reload the previous destination and the new source/destination // reload the previous destination and the new source/destination
nfCanvasUtils.reloadConnectionSourceAndDestination(null, previousDestinationId); nfCanvasUtils.reloadConnectionSourceAndDestination(null, previousDestinationComponentId);
nfCanvasUtils.reloadConnectionSourceAndDestination(response.sourceId, response.destinationId);
var sourceComponentId = nfCanvasUtils.getConnectionSourceComponentId(response);
var destinationComponentId = nfCanvasUtils.getConnectionSourceComponentId(response);
nfCanvasUtils.reloadConnectionSourceAndDestination(sourceComponentId, destinationComponentId);
}).fail(function (xhr, status, error) { }).fail(function (xhr, status, error) {
if (xhr.status === 400 || xhr.status === 401 || xhr.status === 403 || xhr.status === 404 || xhr.status === 409) { if (xhr.status === 400 || xhr.status === 401 || xhr.status === 403 || xhr.status === 404 || xhr.status === 409) {
nfDialog.showOkDialog({ nfDialog.showOkDialog({