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 4fd209c9d1..b4d633874b 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 @@ -107,10 +107,32 @@ export default Rest.post(job_launch_data) .success(function(data) { Wait('stop'); - var job = data.job || data.system_job; + var job = data.job || data.system_job || data.project_update || data.inventory_update || data.ad_hoc_command, + key = Object.keys(data); if((scope.portalMode===false || scope.$parent.portalMode===false ) && Empty(data.system_job) || (base === 'home')){ // use $state.go with reload: true option to re-instantiate sockets in - $state.go('jobDetail', {id: job}, {reload: true}); + + var goToJobDetails = function(state) { + $state.go(state, {id: job}, {reload:true}); + }; + + switch(key[0]) { + case 'job': + goToJobDetails('jobDetail'); + break; + case 'ad_hoc_command': + goToJobDetails('adHocJobStdout'); + break; + case 'system_job': + goToJobDetails('managementJobStdout'); + break; + case 'project_update': + goToJobDetails('scmUpdateStdout'); + break; + case 'inventory_update': + goToJobDetails('inventorySyncStdout'); + break; + } } if(scope.clearDialog) { scope.clearDialog(); diff --git a/awx/ui/client/src/lists/AllJobs.js b/awx/ui/client/src/lists/AllJobs.js index eb6556e9c0..1f05eaea8b 100644 --- a/awx/ui/client/src/lists/AllJobs.js +++ b/awx/ui/client/src/lists/AllJobs.js @@ -107,7 +107,7 @@ export default ngClick: 'deleteJob(all_job.id)', awToolTip: 'Cancel the job', dataPlacement: 'top', - ngShow: "all_job.status === 'running'|| all_job.status == 'waiting' || all_job.status == 'pending'" + ngShow: "all_job.status === 'running'|| all_job.status === 'waiting' || all_job.status === 'pending'" }, "delete": { mode: 'all', diff --git a/awx/ui/client/src/management-jobs/card/card.controller.js b/awx/ui/client/src/management-jobs/card/card.controller.js index 5bc335514d..e497f0c1d3 100644 --- a/awx/ui/client/src/management-jobs/card/card.controller.js +++ b/awx/ui/client/src/management-jobs/card/card.controller.js @@ -7,11 +7,11 @@ // import listGenerator from 'tower/shared/list-generator/main'; export default - [ 'Wait', '$location' , '$compile', 'CreateDialog', 'GetBasePath' , + [ 'Wait', '$compile', 'CreateDialog', 'GetBasePath' , 'SearchInit' , 'PaginateInit', 'SchedulesList', 'Rest' , 'ProcessErrors', 'managementJobsListObject', '$rootScope', '$state', '$scope', 'CreateSelect2', - function( Wait, $location, $compile, CreateDialog, GetBasePath, + function( Wait, $compile, CreateDialog, GetBasePath, SearchInit, PaginateInit, SchedulesList, Rest, ProcessErrors, managementJobsListObject, $rootScope, $state, $scope, CreateSelect2) { @@ -129,11 +129,11 @@ export default Rest.setUrl(defaultUrl); Rest.post(data) - .success(function() { + .success(function(data) { Wait('stop'); $("#prompt-for-days-facts").dialog("close"); $("#configure-tower-dialog").dialog('close'); - $location.path('/jobs/'); + $state.go('managementJobStdout', {id: data.system_job}, {reload:true}); }) .error(function(data, status) { ProcessErrors(scope, data, status, null, { hdr: 'Error!', @@ -217,11 +217,11 @@ export default Rest.setUrl(defaultUrl); Rest.post(data) - .success(function() { + .success(function(data) { Wait('stop'); $("#prompt-for-days").dialog("close"); // $("#configure-tower-dialog").dialog('close'); - $location.path('/jobs/'); + $state.go('managementJobStdout', {id: data.system_job}, {reload:true}); }) .error(function(data, status) { ProcessErrors(scope, data, status, null, { hdr: 'Error!', diff --git a/awx/ui/client/src/standard-out/adhoc/standard-out-adhoc.partial.html b/awx/ui/client/src/standard-out/adhoc/standard-out-adhoc.partial.html index ad7bd4d139..04c762e436 100644 --- a/awx/ui/client/src/standard-out/adhoc/standard-out-adhoc.partial.html +++ b/awx/ui/client/src/standard-out/adhoc/standard-out-adhoc.partial.html @@ -4,7 +4,14 @@