From 7f23aa81e6f266950f9593ff4742204c392245ab Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Tue, 26 Jun 2018 11:30:23 -0400 Subject: [PATCH] clear job event search on relaunch --- .../relaunchButton.component.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/awx/ui/client/lib/components/relaunchButton/relaunchButton.component.js b/awx/ui/client/lib/components/relaunchButton/relaunchButton.component.js index 561664185b..e27d1b130e 100644 --- a/awx/ui/client/lib/components/relaunchButton/relaunchButton.component.js +++ b/awx/ui/client/lib/components/relaunchButton/relaunchButton.component.js @@ -23,6 +23,13 @@ function atRelaunchCtrl ( const jobObj = new Job(); const jobTemplate = new JobTemplate(); + const transitionOptions = { reload: true }; + + if ($state.includes('output')) { + transitionOptions.inherit = false; + transitionOptions.location = 'replace'; + } + const updateTooltip = () => { if (vm.job.type === 'job' && vm.job.status === 'failed') { vm.tooltip = strings.get('relaunch.HOSTS'); @@ -128,7 +135,7 @@ function atRelaunchCtrl ( .then((launchRes) => { if (!$state.is('jobs')) { const relaunchType = launchRes.data.type === 'job' ? 'playbook' : launchRes.data.type; - $state.go('output', { id: launchRes.data.id, type: relaunchType }, { reload: true }); + $state.go('output', { id: launchRes.data.id, type: relaunchType }, transitionOptions); } }).catch(({ data, status, config }) => { ProcessErrors($scope, data, status, null, { @@ -173,7 +180,7 @@ function atRelaunchCtrl ( inventorySource.postUpdate(vm.job.inventory_source) .then((postUpdateRes) => { if (!$state.is('jobs')) { - $state.go('output', { id: postUpdateRes.data.id, type: 'inventory' }, { reload: true }); + $state.go('output', { id: postUpdateRes.data.id, type: 'inventory' }, transitionOptions); } }).catch(({ data, status, config }) => { ProcessErrors($scope, data, status, null, { @@ -197,7 +204,7 @@ function atRelaunchCtrl ( project.postUpdate(vm.job.project) .then((postUpdateRes) => { if (!$state.is('jobs')) { - $state.go('output', { id: postUpdateRes.data.id, type: 'project' }, { reload: true }); + $state.go('output', { id: postUpdateRes.data.id, type: 'project' }, transitionOptions); } }).catch(({ data, status, config }) => { ProcessErrors($scope, data, status, null, { @@ -219,7 +226,7 @@ function atRelaunchCtrl ( id: vm.job.id }).then((launchRes) => { if (!$state.is('jobs')) { - $state.go('workflowResults', { id: launchRes.data.id }, { reload: true }); + $state.go('workflowResults', { id: launchRes.data.id }, transitionOptions); } }).catch(({ data, status, config }) => { ProcessErrors($scope, data, status, null, { @@ -243,7 +250,7 @@ function atRelaunchCtrl ( id: vm.job.id }).then((launchRes) => { if (!$state.is('jobs')) { - $state.go('output', { id: launchRes.data.id, type: 'command' }, { reload: true }); + $state.go('output', { id: launchRes.data.id, type: 'command' }, transitionOptions); } }).catch(({ data, status, config }) => { ProcessErrors($scope, data, status, null, { @@ -268,7 +275,7 @@ function atRelaunchCtrl ( relaunchData: PromptService.bundlePromptDataForRelaunch(vm.promptData) }).then((launchRes) => { if (!$state.is('jobs')) { - $state.go('output', { id: launchRes.data.job, type: 'playbook' }, { reload: true }); + $state.go('output', { id: launchRes.data.job, type: 'playbook' }, transitionOptions); } }).catch(({ data, status }) => { ProcessErrors($scope, data, status, null, {