Building workflow node tree now returns a promise. Code needed to be updated accordingly

This commit is contained in:
Michael Abashian 2017-01-25 10:46:28 -05:00
parent 8650b69c9e
commit a380830861

View File

@ -85,27 +85,23 @@ export default ['workflowData',
// Click binding for the expand/collapse button on the standard out log
$scope.stdoutFullScreen = false;
$scope.treeData = WorkflowService.buildTree({
WorkflowService.buildTree({
workflowNodes: workflowNodes
}).then(function(data){
$scope.treeData = data;
// TODO: I think that the workflow chart directive (and eventually d3) is meddling with
// this treeData object and removing the children object for some reason (?)
// This happens on occasion and I think is a race condition (?)
if(!$scope.treeData.data.children) {
$scope.treeData.data.children = [];
}
$scope.canAddWorkflowJobTemplate = false;
});
// TODO: I think that the workflow chart directive (and eventually d3) is meddling with
// this treeData object and removing the children object for some reason (?)
// This happens on occasion and I think is a race condition (?)
if(!$scope.treeData.data.children) {
$scope.treeData.data.children = [];
}
$scope.canAddWorkflowJobTemplate = false;
}
// var getTotalHostCount = function(count) {
// return Object
// .keys(count).reduce((acc, i) => acc += count[i], 0);
// };
$scope.toggleStdoutFullscreen = function() {
$scope.stdoutFullScreen = !$scope.stdoutFullScreen;