NIFI-258:

- Ensuring connection stays up to date when processor configuration changes.
This commit is contained in:
Matt Gilman 2015-01-13 15:54:21 -05:00
parent b142d7a9bd
commit 80793ccbb8
1 changed files with 22 additions and 1 deletions

View File

@ -364,6 +364,20 @@ nf.ProcessorConfiguration = (function () {
}
};
/**
* Reloads the outgoing connections for the specified processor.
*
* @param {object} processor
*/
var reloadProcessorConnections = function (processor) {
var connections = nf.Connection.getComponentConnections(processor.id);
$.each(connections, function (_, connection) {
if (connection.source.id === processor.id) {
nf.Connection.reload(connection);
}
});
};
return {
/**
* Initializes the processor properties tab.
@ -601,9 +615,12 @@ nf.ProcessorConfiguration = (function () {
// update the revision
nf.Client.setRevision(response.revision);
// set the new processor state
// set the new processor state based on the response
nf.Processor.set(response.processor);
// reload the processor's outgoing connections
reloadProcessorConnections(processor);
// close the details panel
$('#processor-configuration').modal('hide');
}
@ -632,7 +649,11 @@ nf.ProcessorConfiguration = (function () {
// show the custom ui
nf.CustomProcessorUi.showCustomUi($('#processor-id').text(), processor.config.customUiUrl, true).done(function () {
// once the custom ui is closed, reload the processor
nf.Processor.reload(processor);
// and reload the processor's outgoing connections
reloadProcessorConnections(processor);
});
};