NIFI-2534 Fix JS error when stopping a process group

This closes #867.

Signed-off-by: Bryan Bende <bbende@apache.org>
This commit is contained in:
Scott Aslan 2016-08-15 17:04:28 -04:00 committed by Bryan Bende
parent b22500d0a3
commit 26f5c496d1
No known key found for this signature in database
GPG Key ID: A0DDA9ED50711C39
2 changed files with 24 additions and 10 deletions

View File

@ -948,10 +948,18 @@ nf.PolicyManagement = (function () {
resetPolicy();
loadPolicy();
}
nf.Canvas.reload({
'transition': true
});
}).fail(function (xhr, status, error) {
nf.Common.handleAjaxError(xhr, status, error)
nf.Common.handleAjaxError(xhr, status, error);
resetPolicy();
loadPolicy();
nf.Canvas.reload({
'transition': true
});
});
} else {
nf.Dialog.showOkDialog({

View File

@ -1082,19 +1082,25 @@ nf.ProcessGroup = (function () {
/**
* Reloads the process group state from the server and refreshes the UI.
* If the process group is currently unknown, this function just returns.
* If the process group is currently unknown, this function reloads the canvas.
*
* @param {object} processGroup The process group to reload
*/
reload: function (processGroup) {
if (processGroupMap.has(processGroup.id)) {
var processGroupEntity = processGroupMap.get(processGroup.id);
return $.ajax({
type: 'GET',
url: processGroupEntity.uri,
dataType: 'json'
}).done(function (response) {
nf.ProcessGroup.set(response);
if(nf.Common.isDefinedAndNotNull(processGroup)) {
if (processGroupMap.has(processGroup.id)) {
var processGroupEntity = processGroupMap.get(processGroup.id);
return $.ajax({
type: 'GET',
url: processGroupEntity.uri,
dataType: 'json'
}).done(function (response) {
nf.ProcessGroup.set(response);
});
}
} else {
nf.Canvas.reload({
'transition': true
});
}
},