From b4c5e31a1dadf4ce8de4d30f2cc32ca7c6b07bea Mon Sep 17 00:00:00 2001 From: mabashian Date: Mon, 3 Oct 2016 09:56:57 -0400 Subject: [PATCH] Stay on the projects/inv manage pages when syncs are launched from those pages. Otherwise, direct the user to the stdout pages for those individual updates. --- .../job-submission-factories/launchjob.factory.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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 3968eaf484..6c3d861afa 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 @@ -130,12 +130,20 @@ export default goToJobDetails('managementJobStdout'); } else if(_.has(data, 'project_update')) { - if($state.current.name !== 'projects') { + // 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')) { goToJobDetails('scmUpdateStdout'); } } else if(_.has(data, 'inventory_update')) { - goToJobDetails('inventorySyncStdout'); + // If we are on the inventory manage page or any child state of that + // page then we want to stay on that page. Otherwise go to the stdout + // view. + if(!$state.includes('inventoryManage')) { + goToJobDetails('inventorySyncStdout'); + } } } if(scope.clearDialog) {