Fix delete domain button in the UI to update only after job finishes (#2905)

When the “deleteDomain” command is sent via UI, the HTML is already updated assuming that the “deleteDomain” command will actually delete it. However, there are cases (domain with allocated resources) that will not allow ACS to remove the command; as a consequence, the UI will not be in sync with ACS state, which can lead to misunderstandings.
This commit is contained in:
Rafael Weingärtner 2018-11-11 18:41:37 -02:00 committed by GitHub
parent f36e0c77aa
commit 63094b2fbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,11 +69,23 @@
async: false,
success: function(json) {
var jid = json.deletedomainresponse.jobid;
var wasDomainDeletedWithSuccess = false;
$.ajax({
url: createURL("queryAsyncJobResult&jobId=" + jid),
dataType: "json",
async: false,
success: function(json) {
wasDomainDeletedWithSuccess = json.queryasyncjobresultresponse.jobresultcode == 0;
}
});
args.response.success({
_custom: {
jobId: jid
}
});
if(!wasDomainDeletedWithSuccess){
return;
}
// Quick fix for proper UI reaction to delete domain
var $item = $('.name.selected').closest('li');