diff --git a/awx/ui/client/src/controllers/Jobs.js b/awx/ui/client/src/controllers/Jobs.js index cbf588200c..0015216389 100644 --- a/awx/ui/client/src/controllers/Jobs.js +++ b/awx/ui/client/src/controllers/Jobs.js @@ -29,7 +29,7 @@ export function JobsListController($state, $rootScope, $log, $scope, $compile, $ $scope.showJobType = true; } - + $scope.$on(`${list.iterator}_options`, function(event, data){ $scope.options = data.data.actions.GET; optionsRequestDataProcessing(); @@ -87,7 +87,7 @@ export function JobsListController($state, $rootScope, $log, $scope, $compile, $ typeId = job.inventory_source; } else if (job.type === 'project_update') { typeId = job.project; - } else if (job.type === 'job' || job.type === "system_job" || job.type === 'ad_hoc_command') { + } else if (job.type === 'job' || job.type === "system_job" || job.type === 'ad_hoc_command' || job.type === 'workflow_job') { typeId = job.id; } RelaunchJob({ scope: $scope, id: typeId, type: job.type, name: job.name }); diff --git a/awx/ui/client/src/helpers/Jobs.js b/awx/ui/client/src/helpers/Jobs.js index 19a206a22c..9f64ac8906 100644 --- a/awx/ui/client/src/helpers/Jobs.js +++ b/awx/ui/client/src/helpers/Jobs.js @@ -29,8 +29,8 @@ export default else if (type === 'ad_hoc_command') { RelaunchAdhoc({ scope: scope, id: id, name: name }); } - else if (type === 'job' || type === 'system_job') { - RelaunchPlaybook({ scope: scope, id: id, name: name }); + else if (type === 'job' || type === 'system_job' || type === 'workflow_job') { + RelaunchPlaybook({ scope: scope, id: id, name: name, job_type: type }); } else if (type === 'project_update') { RelaunchSCM({ scope: scope, id: id }); @@ -289,8 +289,9 @@ export default .factory('RelaunchPlaybook', ['InitiatePlaybookRun', function(InitiatePlaybookRun) { return function(params) { var scope = params.scope, - id = params.id; - InitiatePlaybookRun({ scope: scope, id: id, relaunch: true }); + id = params.id, + job_type = params.job_type; + InitiatePlaybookRun({ scope: scope, id: id, relaunch: true, job_type: job_type }); }; }]) diff --git a/awx/ui/client/src/job-submission/job-submission-factories/launchjob.factory.js b/awx/ui/client/src/job-submission/job-submission-factories/launchjob.factory.js index ac7f9961ad..3c9dbb1c60 100644 --- a/awx/ui/client/src/job-submission/job-submission-factories/launchjob.factory.js +++ b/awx/ui/client/src/job-submission/job-submission-factories/launchjob.factory.js @@ -1,6 +1,6 @@ export default - function LaunchJob(Rest, Wait, ProcessErrors, ToJSON, Empty, GetBasePath, $state, $location) { + function LaunchJob(Rest, Wait, ProcessErrors, ToJSON, Empty, GetBasePath, $state, $location, $rootScope) { // This factory gathers up all the job launch data and POST's it. @@ -121,7 +121,7 @@ export default .success(function(data) { Wait('stop'); var job = data.job || data.system_job || data.project_update || data.inventory_update || data.ad_hoc_command || data.workflow_job; - if((scope.portalMode===false || scope.$parent.portalMode===false ) && Empty(data.system_job) || (base === 'home')){ + if($rootScope.portalMode===false && Empty(data.system_job) || (base === 'home')){ // use $state.go with reload: true option to re-instantiate sockets in var goToJobDetails = function(state) { @@ -207,5 +207,6 @@ LaunchJob.$inject = 'Empty', 'GetBasePath', '$state', - '$location' + '$location', + '$rootScope' ]; diff --git a/awx/ui/client/src/job-submission/job-submission.controller.js b/awx/ui/client/src/job-submission/job-submission.controller.js index 187b00de01..8a8215baef 100644 --- a/awx/ui/client/src/job-submission/job-submission.controller.js +++ b/awx/ui/client/src/job-submission/job-submission.controller.js @@ -145,7 +145,7 @@ export default } } else { - if($scope.submitJobType && $scope.submitJobType === 'workflow_job_template') { + if($scope.submitJobType && $scope.submitJobType === 'workflow_job') { launch_url = GetBasePath('workflow_jobs') + $scope.submitJobId + '/relaunch/'; } else {