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(); resetPolicy();
loadPolicy(); loadPolicy();
} }
nf.Canvas.reload({
'transition': true
});
}).fail(function (xhr, status, error) { }).fail(function (xhr, status, error) {
nf.Common.handleAjaxError(xhr, status, error) nf.Common.handleAjaxError(xhr, status, error);
resetPolicy(); resetPolicy();
loadPolicy(); loadPolicy();
nf.Canvas.reload({
'transition': true
});
}); });
} else { } else {
nf.Dialog.showOkDialog({ nf.Dialog.showOkDialog({

View File

@ -1082,19 +1082,25 @@ nf.ProcessGroup = (function () {
/** /**
* Reloads the process group state from the server and refreshes the UI. * 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 * @param {object} processGroup The process group to reload
*/ */
reload: function (processGroup) { reload: function (processGroup) {
if (processGroupMap.has(processGroup.id)) { if(nf.Common.isDefinedAndNotNull(processGroup)) {
var processGroupEntity = processGroupMap.get(processGroup.id); if (processGroupMap.has(processGroup.id)) {
return $.ajax({ var processGroupEntity = processGroupMap.get(processGroup.id);
type: 'GET', return $.ajax({
url: processGroupEntity.uri, type: 'GET',
dataType: 'json' url: processGroupEntity.uri,
}).done(function (response) { dataType: 'json'
nf.ProcessGroup.set(response); }).done(function (response) {
nf.ProcessGroup.set(response);
});
}
} else {
nf.Canvas.reload({
'transition': true
}); });
} }
}, },