1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 09:51:09 +03:00

navigate to new job results view on relaunch

This commit is contained in:
Jake McDermott 2018-03-19 12:01:48 -04:00
parent b577f50930
commit faa33e0bec
No known key found for this signature in database
GPG Key ID: 3B02CAD476EECB35

View File

@ -149,8 +149,8 @@ export default
if(base !== 'portal' && Empty(data.system_job) || (base === 'home')){
// use $state.go with reload: true option to re-instantiate sockets in
var goTojobResults = function(state) {
$state.go(state, {id: job}, {reload:true});
var goTojobResults = function(type) {
$state.go('jobz', {id: job, type}, {reload:true});
};
if($state.includes('jobs')) {
@ -159,23 +159,23 @@ export default
else {
if(_.has(data, 'job')) {
goTojobResults('jobResult');
goTojobResults('playbook');
} else if(data.type && data.type === 'workflow_job') {
job = data.id;
goTojobResults('workflowResults');
goTojobResults('workflow_job');
}
else if(_.has(data, 'ad_hoc_command')) {
goTojobResults('adHocJobStdout');
goTojobResults('ad_hoc_command');
}
else if(_.has(data, 'system_job')) {
goTojobResults('managementJobStdout');
goTojobResults('system_job');
}
else if(_.has(data, 'project_update')) {
// If we are on the projects list or any child state of that list
// then we want to stay on that page. Otherwise go to the stdout
// view.
if(!$state.includes('projects')) {
goTojobResults('scmUpdateStdout');
goTojobResults('project_update');
}
}
else if(_.has(data, 'inventory_update')) {
@ -183,7 +183,7 @@ export default
// page then we want to stay on that page. Otherwise go to the stdout
// view.
if(!$state.includes('inventories.edit')) {
goTojobResults('inventorySyncStdout');
goTojobResults('playbook');
}
}
}