diff --git a/awx/ui/client/src/templates/main.js b/awx/ui/client/src/templates/main.js index d712faa3d8..d18b1e5fc2 100644 --- a/awx/ui/client/src/templates/main.js +++ b/awx/ui/client/src/templates/main.js @@ -184,6 +184,12 @@ angular.module('templates', [surveyMaker.name, templatesList.name, jobTemplatesA } } }); + + $scope.$on('clearWorkflowLists', function() { + $scope.job_templates.forEach(function(row, i) { + $scope.job_templates[i].checked = 0; + }); + }); } ] }, @@ -258,6 +264,12 @@ angular.module('templates', [surveyMaker.name, templatesList.name, jobTemplatesA } } }); + + $scope.$on('clearWorkflowLists', function() { + $scope.workflow_inventory_sources.forEach(function(row, i) { + $scope.workflow_inventory_sources[i].checked = 0; + }); + }); } ] }, @@ -330,6 +342,12 @@ angular.module('templates', [surveyMaker.name, templatesList.name, jobTemplatesA } } }); + + $scope.$on('clearWorkflowLists', function() { + $scope.projects.forEach(function(row, i) { + $scope.projects[i].checked = 0; + }); + }); } ] }, diff --git a/awx/ui/client/src/templates/templates.service.js b/awx/ui/client/src/templates/templates.service.js index a26e45f962..825dc5deb6 100644 --- a/awx/ui/client/src/templates/templates.service.js +++ b/awx/ui/client/src/templates/templates.service.js @@ -84,11 +84,15 @@ export default ['Rest', 'GetBasePath', '$q', function(Rest, GetBasePath, $q){ Rest.setUrl(url); return Rest.get(); }, - getWorkflowJobTemplateNodes: function(id) { + getWorkflowJobTemplateNodes: function(id, page) { var url = GetBasePath('workflow_job_templates'); url = url + id + '/workflow_nodes'; + if(page) { + url += '/?page=' + page; + } + Rest.setUrl(url); return Rest.get(); }, diff --git a/awx/ui/client/src/templates/workflows/edit-workflow/workflow-edit.controller.js b/awx/ui/client/src/templates/workflows/edit-workflow/workflow-edit.controller.js index 18dd35a37d..93ea82d27d 100644 --- a/awx/ui/client/src/templates/workflows/edit-workflow/workflow-edit.controller.js +++ b/awx/ui/client/src/templates/workflows/edit-workflow/workflow-edit.controller.js @@ -149,12 +149,12 @@ $scope.url = workflowJobTemplateData.url; $scope.survey_enabled = workflowJobTemplateData.survey_enabled; - // Get the workflow nodes - TemplatesService.getWorkflowJobTemplateNodes(id) - .then(function(data){ + let allNodes = []; + let page = 1; + let buildTreeFromNodes = function(){ $scope.workflowTree = WorkflowService.buildTree({ - workflowNodes: data.data.results + workflowNodes: allNodes }); // TODO: I think that the workflow chart directive (and eventually d3) is meddling with @@ -169,14 +169,34 @@ // In the partial, the workflow maker directive has an ng-if attribute which is pointed at this scope variable. // It won't get included until this the tree has been built - I'm open to better ways of doing this. $scope.includeWorkflowMaker = true; + }; - }, function(error){ - ProcessErrors($scope, error.data, error.status, form, { - hdr: 'Error!', - msg: 'Failed to get workflow job template nodes. GET returned ' + - 'status: ' + error.status + let getNodes = function(){ + // Get the workflow nodes + TemplatesService.getWorkflowJobTemplateNodes(id, page) + .then(function(data){ + for(var i=0; i