Merge pull request #4991 from mabashian/2964-delete-nodes

Fixed node deletion/conflict bug
This commit is contained in:
Michael Abashian
2017-01-27 18:17:57 -05:00
committed by GitHub

View File

@@ -296,7 +296,11 @@ export default ['$scope', 'WorkflowService', 'generateList', 'TemplateList', 'Pr
});
});
$q.all(disassociatePromises.concat(editNodePromises))
let deletePromises = $scope.treeData.data.deletedNodes.map(function(nodeId) {
return TemplatesService.deleteWorkflowJobTemplateNode(nodeId);
});
$q.all(disassociatePromises.concat(editNodePromises, deletePromises))
.then(function() {
let associatePromises = $scope.associateRequests.map(function(request) {
@@ -307,11 +311,7 @@ export default ['$scope', 'WorkflowService', 'generateList', 'TemplateList', 'Pr
});
});
let deletePromises = $scope.treeData.data.deletedNodes.map(function(nodeId) {
return TemplatesService.deleteWorkflowJobTemplateNode(nodeId);
});
$q.all(associatePromises.concat(deletePromises))
$q.all(associatePromises)
.then(function() {
$scope.closeDialog();
});