From ac42f7a0d592bc458cea8df70a22e12581adece4 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Fri, 8 Jul 2016 10:38:00 -0700 Subject: [PATCH] Using $state to determine to launch or relaunch jobs instead of $location --- .../src/job-submission/job-submission.controller.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/awx/ui/client/src/job-submission/job-submission.controller.js b/awx/ui/client/src/job-submission/job-submission.controller.js index acefe6aa07..00c7e971d3 100644 --- a/awx/ui/client/src/job-submission/job-submission.controller.js +++ b/awx/ui/client/src/job-submission/job-submission.controller.js @@ -128,12 +128,14 @@ export default // This gets things started - goes out and hits the launch endpoint (based on launch/relaunch) and // prepares the form fields, defauts, etc. $scope.init = function() { - $scope.forms = {}; $scope.passwords = {}; - var base = $location.path().replace(/^\//, '').split('/')[0], - isRelaunch = !(base === 'job_templates' || base === 'portal' || base === 'inventories' || base === 'home'); + var base = $state.current.name, + // 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) { launch_url = GetBasePath('job_templates') + $scope.submitJobId + '/launch/';