diff --git a/awx/main/models/jobs.py b/awx/main/models/jobs.py index e70b3d9c2f..32361f64a4 100644 --- a/awx/main/models/jobs.py +++ b/awx/main/models/jobs.py @@ -198,7 +198,7 @@ class JobTemplate(UnifiedJobTemplate, JobOptions): def _get_unified_job_field_names(cls): return ['name', 'description', 'job_type', 'inventory', 'project', 'playbook', 'credential', 'cloud_credential', 'forks', - 'limit', 'verbosity', 'extra_vars', 'job_tags', + 'limit', 'verbosity', 'extra_vars', 'job_tags', 'launch_type', 'force_handlers', 'skip_tags', 'start_at_task'] def create_job(self, **kwargs): diff --git a/awx/main/models/unified_jobs.py b/awx/main/models/unified_jobs.py index 4c6bc3d235..80e31d7e78 100644 --- a/awx/main/models/unified_jobs.py +++ b/awx/main/models/unified_jobs.py @@ -301,7 +301,7 @@ class UnifiedJobTemplate(PolymorphicModel, CommonModelNameNotUnique): continue # Foreign keys can be specified as field_name or field_name_id. if hasattr(self, '%s_id' % field_name) and ('%s_id' % field_name) in kwargs: - create_kwargs['%s_id' % field_name] = kwargs['%s_id' % field_name] = kwargs[field_name] + create_kwargs['%s_id' % field_name] = kwargs['%s_id' % field_name] = kwargs["%s_id" % field_name] continue create_kwargs[field_name] = getattr(self, field_name) kwargs = self._update_unified_job_kwargs(**create_kwargs) diff --git a/awx/ui/static/js/helpers/ConfigureTower.js b/awx/ui/static/js/helpers/ConfigureTower.js index 0117e0672f..cd240f951d 100644 --- a/awx/ui/static/js/helpers/ConfigureTower.js +++ b/awx/ui/static/js/helpers/ConfigureTower.js @@ -16,9 +16,9 @@ angular.module('ConfigureTowerHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', 'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'ModalDialog', 'GeneratorHelpers']) - .factory('ConfigureTower', ['Wait', 'CreateDialog', 'ConfigureTowerJobsList', 'GenerateList', 'GetBasePath' , 'SearchInit' , 'PaginateInit', 'PlaybookRun', 'LoadSchedulesScope', + .factory('ConfigureTower', ['Wait', '$location' , '$compile', 'CreateDialog', 'ConfigureTowerJobsList', 'GenerateList', 'GetBasePath' , 'SearchInit' , 'PaginateInit', 'PlaybookRun', 'LoadSchedulesScope', 'SchedulesList', 'SchedulesControllerInit' , 'ConfigureTowerSchedule', 'Rest' , 'ProcessErrors', - function(Wait, CreateDialog, ConfigureTowerJobsList, GenerateList, GetBasePath, SearchInit, PaginateInit, PlaybookRun, LoadSchedulesScope, + function(Wait, $location, $compile, CreateDialog, ConfigureTowerJobsList, GenerateList, GetBasePath, SearchInit, PaginateInit, PlaybookRun, LoadSchedulesScope, SchedulesList, SchedulesControllerInit, ConfigureTowerSchedule, Rest, ProcessErrors) { return function(params) { // Set modal dimensions based on viewport width @@ -28,7 +28,7 @@ angular.module('ConfigureTowerHelper', [ 'Utilities', 'RestServices', 'Schedules callback = 'OpenConfig', defaultUrl = GetBasePath('system_job_templates'), list = ConfigureTowerJobsList, - view = GenerateList, + view = GenerateList, e, scheduleUrl = GetBasePath('system_job_templates'), buttons = [ { @@ -147,7 +147,12 @@ angular.module('ConfigureTowerHelper', [ 'Utilities', 'RestServices', 'Schedules minWidth: 200, callback: 'PromptForDays', onOpen: function(){ - $("#days_to_keep").val(30); + e = angular.element(document.getElementById('prompt_for_days_form')); + scope.prompt_for_days_form.days_to_keep.$setViewValue(30); + $compile(e)(scope); + $('#prompt-for-days-launch').attr("ng-disabled", 'prompt_for_days_form.$invalid'); + e = angular.element(document.getElementById('prompt-for-days-launch')); + $compile(e)(scope); }, buttons: [{ "label": "Cancel", @@ -157,11 +162,11 @@ angular.module('ConfigureTowerHelper', [ 'Utilities', 'RestServices', 'Schedules }, "icon": "fa-times", "class": "btn btn-default", - "id": "prompt-for-days-button" + "id": "prompt-for-days-cancel" },{ "label": "Launch", "onClick": function() { - var extra_vars = {"days": $("#days_to_keep").val() }, + var extra_vars = {"days": scope.days_to_keep }, data = {}; data.extra_vars = JSON.stringify(extra_vars); @@ -171,6 +176,7 @@ angular.module('ConfigureTowerHelper', [ 'Utilities', 'RestServices', 'Schedules Wait('stop'); $("#prompt-for-days").dialog("close"); $("#configure-tower-dialog").dialog('close'); + $location.path('/jobs/'); }) .error(function(data, status) { ProcessErrors(scope, data, status, null, { hdr: 'Error!', @@ -179,7 +185,7 @@ angular.module('ConfigureTowerHelper', [ 'Utilities', 'RestServices', 'Schedules }, "icon": "fa-rocket", "class": "btn btn-primary", - "id": "prompt-for-days-button" + "id": "prompt-for-days-launch" }] }); diff --git a/awx/ui/static/js/helpers/CustomInventory.js b/awx/ui/static/js/helpers/CustomInventory.js index 93cd236e2b..896d840e70 100644 --- a/awx/ui/static/js/helpers/CustomInventory.js +++ b/awx/ui/static/js/helpers/CustomInventory.js @@ -84,7 +84,7 @@ angular.module('CreateCustomInventoryHelper', [ 'Utilities', 'RestServices', 'Sc CreateDialog({ id: 'custom-script-dialog', - title: 'Inventory Script', + title: 'Inventory Scripts', target: 'custom-script-dialog', scope: scope, buttons: buttons, @@ -297,7 +297,7 @@ function($compile, CustomInventoryList, Rest, Wait, GenerateList, CustomInventor SearchInit({ scope: scope, - set: 'custum_inventories', + set: 'custom_inventories', list: list, url: url }); @@ -308,6 +308,7 @@ function($compile, CustomInventoryList, Rest, Wait, GenerateList, CustomInventor }); scope.search(list.iterator); + Wait('stop'); }) diff --git a/awx/ui/static/js/helpers/Groups.js b/awx/ui/static/js/helpers/Groups.js index 9410b0027c..e64092ed9c 100644 --- a/awx/ui/static/js/helpers/Groups.js +++ b/awx/ui/static/js/helpers/Groups.js @@ -1174,6 +1174,7 @@ function($compile, SchedulerInit, Rest, Wait, SetSchedulesInnerDialogSize, Sched var parseError = false, regions, r, i, + group_by, data = { group: group_id, source: ((sources_scope.source && sources_scope.source.value) ? sources_scope.source.value : ''), @@ -1197,7 +1198,7 @@ function($compile, SchedulerInit, Rest, Wait, SetSchedulesInnerDialogSize, Sched if (sources_scope.source && (sources_scope.source.value === 'ec2')) { data.instance_filters = sources_scope.instance_filters; // Create a string out of selected list of regions - var group_by = $('#s2id_source_group_by').select2("data"); + group_by = $('#s2id_source_group_by').select2("data"); r = []; for (i = 0; i < group_by.length; i++) { r.push(group_by[i].id); diff --git a/awx/ui/static/js/helpers/JobSubmission.js b/awx/ui/static/js/helpers/JobSubmission.js index f402e64ca2..20931a4e26 100644 --- a/awx/ui/static/js/helpers/JobSubmission.js +++ b/awx/ui/static/js/helpers/JobSubmission.js @@ -150,7 +150,7 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi // html+='
job_launch_form.$valid = {{job_launch_form.$valid}}
'; html+=''; $('#password-modal').empty().html(html); - $('#password-modal').find('textarea').before(scope.helpContainer); + $('#password-modal').find('#job_extra_vars').before(scope.helpContainer); e = angular.element(document.getElementById('password-modal')); $compile(e)(scope); diff --git a/awx/ui/static/js/helpers/Survey.js b/awx/ui/static/js/helpers/Survey.js index 334e5d624d..43bed88548 100644 --- a/awx/ui/static/js/helpers/Survey.js +++ b/awx/ui/static/js/helpers/Survey.js @@ -633,16 +633,17 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', }; scope.typeChange = function() { - // alert('typechange'); - scope.default = null; - scope.default_multiselect = null; - scope.default_float = null; - scope.default_int = null; - scope.default_textarea = null; - scope.int_min = null; - scope.int_max = null; - scope.float_min = null; - scope.float_max = null; + scope.default = ""; + scope.default_multiselect = ""; + scope.default_float = ""; + scope.default_int = ""; + scope.default_textarea = ""; + scope.survey_question_form.choices.$setPristine(); + scope.choices = ""; + scope.int_min = ""; + scope.int_max = ""; + scope.float_min = ""; + scope.float_max = ""; }; scope.submitQuestion = function(){ diff --git a/awx/ui/static/js/helpers/Variables.js b/awx/ui/static/js/helpers/Variables.js index a03d359dc2..a1b2047eef 100644 --- a/awx/ui/static/js/helpers/Variables.js +++ b/awx/ui/static/js/helpers/Variables.js @@ -103,7 +103,9 @@ angular.module('VariablesHelper', ['Utilities']) } } else { try { - + if(variables=== ""){ + variables = '---'; + } json_data = jsyaml.load(variables); if(json_data!==null){ $.each( json_data, function( key, value ) { diff --git a/awx/ui/static/partials/portal.html b/awx/ui/static/partials/portal.html index a6b295ebdd..5c94a97337 100644 --- a/awx/ui/static/partials/portal.html +++ b/awx/ui/static/partials/portal.html @@ -24,3 +24,4 @@ + diff --git a/awx/ui/templates/ui/index.html b/awx/ui/templates/ui/index.html index 1f8604ffdb..8626e5c6dd 100644 --- a/awx/ui/templates/ui/index.html +++ b/awx/ui/templates/ui/index.html @@ -200,7 +200,7 @@ About Tower Account Settings Contact Support - Inventory Script + Inventory Scripts Management Jobs Monitor Tower Portal Mode @@ -242,7 +242,7 @@
  • About Tower
  • Account Settings
  • Contact Support
  • -
  • Inventory Script
  • +
  • Inventory Scripts
  • Management Jobs
  • Monitor Tower
  • Portal Mode
  • @@ -262,7 +262,7 @@
  • About Tower
  • Account Settings
  • Contact Support
  • -
  • Inventory Script
  • +
  • Inventory Scripts
  • Management Jobs
  • Monitor Tower
  • Portal Mode
  • @@ -425,8 +425,10 @@