From 2ccbf5a8176c28822ccd86d1b7ec5990e66869eb Mon Sep 17 00:00:00 2001 From: mabashian Date: Thu, 29 Mar 2018 15:09:31 -0400 Subject: [PATCH 1/2] Fixed bug relaunching job on successful/failed hosts --- .../relaunchButton/relaunchButton.component.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/awx/ui/client/lib/components/relaunchButton/relaunchButton.component.js b/awx/ui/client/lib/components/relaunchButton/relaunchButton.component.js index 045afd3585..8afa1e2057 100644 --- a/awx/ui/client/lib/components/relaunchButton/relaunchButton.component.js +++ b/awx/ui/client/lib/components/relaunchButton/relaunchButton.component.js @@ -101,9 +101,19 @@ function atRelaunchCtrl ( }; }); } else { - jobObj.postRelaunch({ - id: vm.job.id - }).then((launchRes) => { + + let launchParams = { + id: vm.job.id, + }; + + if (_.has(option, 'name')) { + launchParams.relaunchData = { + hosts: (option.name).toLowerCase() + }; + } + + jobObj.postRelaunch(launchParams) + .then((launchRes) => { if (!$state.includes('jobs')) { $state.go('jobResult', { id: launchRes.data.id }, { reload: true }); } From 1cf8e3cc20f71f2826346db3964015d7c6d2d27d Mon Sep 17 00:00:00 2001 From: mabashian Date: Thu, 29 Mar 2018 15:15:47 -0400 Subject: [PATCH 2/2] Fixed linting errors --- .../relaunchButton/relaunchButton.component.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/awx/ui/client/lib/components/relaunchButton/relaunchButton.component.js b/awx/ui/client/lib/components/relaunchButton/relaunchButton.component.js index 8afa1e2057..1d88abdb8b 100644 --- a/awx/ui/client/lib/components/relaunchButton/relaunchButton.component.js +++ b/awx/ui/client/lib/components/relaunchButton/relaunchButton.component.js @@ -101,8 +101,7 @@ function atRelaunchCtrl ( }; }); } else { - - let launchParams = { + const launchParams = { id: vm.job.id, }; @@ -113,11 +112,11 @@ function atRelaunchCtrl ( } jobObj.postRelaunch(launchParams) - .then((launchRes) => { - if (!$state.includes('jobs')) { - $state.go('jobResult', { id: launchRes.data.id }, { reload: true }); - } - }); + .then((launchRes) => { + if (!$state.includes('jobs')) { + $state.go('jobResult', { id: launchRes.data.id }, { reload: true }); + } + }); } }); };