mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 11:00:03 -03:30
Properly relaunch a workflow job from the jobs list
This commit is contained in:
parent
78b07c8d10
commit
75334a4ea8
@ -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 });
|
||||
|
||||
@ -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 });
|
||||
};
|
||||
}])
|
||||
|
||||
|
||||
@ -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'
|
||||
];
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user