From c4bdf0d936f0784eb76309923816a06288fc6262 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Mon, 24 Nov 2014 15:53:11 -0500 Subject: [PATCH] Job submission Fixed some new errors that emerged as a result of adding the prompt for credentials back in and fixing the html generation of code mirror editor for job variables. --- awx/ui/static/js/helpers/JobSubmission.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/awx/ui/static/js/helpers/JobSubmission.js b/awx/ui/static/js/helpers/JobSubmission.js index a4bea23da5..447f33d845 100644 --- a/awx/ui/static/js/helpers/JobSubmission.js +++ b/awx/ui/static/js/helpers/JobSubmission.js @@ -43,8 +43,10 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential } } } - - + delete(job_launch_data.extra_vars); + if(!Empty(scope.credential)){ + job_launch_data.credential = scope.credential; + } Rest.setUrl(url); Rest.post(job_launch_data) .success(function(data) { @@ -386,6 +388,7 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi function buildHtml(extra_vars){ html += GenerateForm.buildHTML(JobVarsPromptForm, { mode: 'edit', modal: true, scope: scope }); + html = html.replace("", ""); scope.helpContainer = "
\n" + "" + @@ -739,6 +742,12 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi if(passwords.length>0){ scope.$emit('PromptForPasswords', passwords, html, url); } + else if (scope.ask_variables_on_launch){ + scope.$emit('PromptForVars', html, url); + } + else if (!Empty(scope.survey_enabled) && scope.survey_enabled===true) { + scope.$emit('PromptForSurvey', html, url); + } else scope.$emit('StartPlaybookRun', url); }) .error(function (data, status) { @@ -758,8 +767,8 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi launch_url = url;//data.related.start; scope.passwords_needed_to_start = data.passwords_needed_to_start; scope.prompt_for_vars = data.ask_variables_on_launch; - // scope.extra_vars = data.variables_needed_to_start; scope.survey_enabled = data.survey_enabled; + scope.ask_variables_on_launch = data.ask_variables_on_launch; html = '
';