diff --git a/awx/ui/client/src/dashboard/lists/job-templates/job-templates-list.directive.js b/awx/ui/client/src/dashboard/lists/job-templates/job-templates-list.directive.js index 13fbfd8d6f..5d4a8a11fd 100644 --- a/awx/ui/client/src/dashboard/lists/job-templates/job-templates-list.directive.js +++ b/awx/ui/client/src/dashboard/lists/job-templates/job-templates-list.directive.js @@ -28,13 +28,13 @@ export default function createList(list) { // smartStatus?, launchUrl, editUrl, name - scope.job_templates = _.map(list, function(job_template){ return { - recent_jobs: job_template.summary_fields.recent_jobs, - launch_url: job_template.url, - edit_url: job_template.url.replace('api/v1', '#'), - name: job_template.name, - id: job_template.id, - type: job_template.type + scope.templates = _.map(list, function(template){ return { + recent_jobs: template.summary_fields.recent_jobs, + launch_url: template.url, + edit_url: template.url.replace('api/v1', '#'), + name: template.name, + id: template.id, + type: template.type }; }); scope.snapRows = (list.length < 4); @@ -44,7 +44,7 @@ export default return (status === "successful"); }; - scope.launchJobTemplate = function(template){ + scope.launchTemplate = function(template){ if(template) { if(template.type && (template.type === 'Job Template' || template.type === 'job_template')) { InitiatePlaybookRun({ scope: scope, id: template.id, job_type: 'job_template' }); @@ -63,8 +63,15 @@ export default } }; - scope.editJobTemplate = function (jobTemplateId) { - $state.go('templates.editJobTemplate', {job_template_id: jobTemplateId}); + scope.editTemplate = function (template) { + if(template) { + if(template.type && (template.type === 'Job Template' || template.type === 'job_template')) { + $state.go('templates.editJobTemplate', {job_template_id: template.id}); + } + else if(template.type && (template.type === 'Workflow Job Template' || template.type === 'workflow_job_template')) { + $state.go('templates.editWorkflowJobTemplate', {workflow_job_template_id: template.id}); + } + } }; } }]; diff --git a/awx/ui/client/src/dashboard/lists/job-templates/job-templates-list.partial.html b/awx/ui/client/src/dashboard/lists/job-templates/job-templates-list.partial.html index 2606649d87..846b268c29 100644 --- a/awx/ui/client/src/dashboard/lists/job-templates/job-templates-list.partial.html +++ b/awx/ui/client/src/dashboard/lists/job-templates/job-templates-list.partial.html @@ -23,21 +23,21 @@ + ng-repeat = "template in templates"> - - {{ job_template.name }} + + {{ template.name }} - +
- -
diff --git a/awx/ui/client/src/lists/Templates.js b/awx/ui/client/src/lists/Templates.js index d32d102dcc..c19d7a7052 100644 --- a/awx/ui/client/src/lists/Templates.js +++ b/awx/ui/client/src/lists/Templates.js @@ -25,7 +25,7 @@ export default key: true, label: i18n._('Name'), columnClass: 'col-lg-2 col-md-2 col-sm-4 col-xs-9', - ngClick: "editJobTemplate(template)" + ngHref: '#/templates/{{template.type}}/{{template.id}}' }, type: { label: i18n._('Type'), diff --git a/awx/ui/client/src/workflow-results/workflow-results.controller.js b/awx/ui/client/src/workflow-results/workflow-results.controller.js index 5151690f74..8ed95ea880 100644 --- a/awx/ui/client/src/workflow-results/workflow-results.controller.js +++ b/awx/ui/client/src/workflow-results/workflow-results.controller.js @@ -46,7 +46,7 @@ export default ['workflowData', $scope.workflow_template_link = '/#/templates/workflow_job_template/'+$scope.workflow.workflow_job_template; $scope.created_by_link = getTowerLink('created_by'); - $scope.scheduled_by_link = getTowerLink('schedule');console.log($scope.scheduled_by_link); + $scope.scheduled_by_link = getTowerLink('schedule'); $scope.cloud_credential_link = getTowerLink('cloud_credential'); $scope.network_credential_link = getTowerLink('network_credential'); };