Merge pull request #2881 from jaredevantabor/completed-jobs

Using $state to determine to launch or relaunch jobs
This commit is contained in:
Jared Tabor
2016-07-08 14:01:44 -07:00
committed by GitHub

View File

@@ -128,12 +128,14 @@ export default
// This gets things started - goes out and hits the launch endpoint (based on launch/relaunch) and // This gets things started - goes out and hits the launch endpoint (based on launch/relaunch) and
// prepares the form fields, defauts, etc. // prepares the form fields, defauts, etc.
$scope.init = function() { $scope.init = function() {
$scope.forms = {}; $scope.forms = {};
$scope.passwords = {}; $scope.passwords = {};
var base = $location.path().replace(/^\//, '').split('/')[0], var base = $state.current.name,
isRelaunch = !(base === 'job_templates' || base === 'portal' || base === 'inventories' || base === 'home'); // As of 3.0, the only place the user can relaunch a
// playbook is on jobTemplates.edit (completed_jobs tab),
// jobs, and jobDetails $states.
isRelaunch = !(base === 'jobTemplates' || base === 'portalMode' || base === 'dashboard');
if (!isRelaunch) { if (!isRelaunch) {
launch_url = GetBasePath('job_templates') + $scope.submitJobId + '/launch/'; launch_url = GetBasePath('job_templates') + $scope.submitJobId + '/launch/';