From a02521a0bda7ab1eee1e92d441b95a39352d1fea Mon Sep 17 00:00:00 2001 From: mabashian Date: Wed, 9 May 2018 13:03:58 -0400 Subject: [PATCH] Only initialize extra vars if they are promptable --- .../src/scheduler/schedulerAdd.controller.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/awx/ui/client/src/scheduler/schedulerAdd.controller.js b/awx/ui/client/src/scheduler/schedulerAdd.controller.js index 49e143fa1a..72d7137ae7 100644 --- a/awx/ui/client/src/scheduler/schedulerAdd.controller.js +++ b/awx/ui/client/src/scheduler/schedulerAdd.controller.js @@ -92,14 +92,6 @@ export default ['$filter', '$state', '$stateParams', '$http', 'Wait', // extra_data field is not manifested in the UI when scheduling a Management Job if ($state.current.name === 'jobTemplateSchedules.add'){ $scope.parseType = 'yaml'; - $scope.extraVars = ParentObject.extra_vars === '' ? '---' : ParentObject.extra_vars; - - ParseTypeChange({ - scope: $scope, - variable: 'extraVars', - parse_variable: 'parseType', - field_id: 'SchedulerForm-extraVars' - }); let jobTemplate = new JobTemplate(); @@ -126,7 +118,16 @@ export default ['$filter', '$state', '$stateParams', '$http', 'Wait', }); }; - if (!launchConf.ask_variables_on_launch) { + if (launchConf.ask_variables_on_launch) { + $scope.extraVars = ParentObject.extra_vars === '' ? '---' : ParentObject.extra_vars; + + ParseTypeChange({ + scope: $scope, + variable: 'extraVars', + parse_variable: 'parseType', + field_id: 'SchedulerForm-extraVars' + }); + } else { $scope.noVars = true; }