From 4721805b4b8a5afc467a73b48a4e09f5c4a1c755 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Fri, 5 May 2017 11:11:09 -0400 Subject: [PATCH 1/2] Added store_facts to the job template form --- awx/ui/client/src/templates/job-template.form.js | 12 ++++++++++++ .../add-job-template/job-template-add.controller.js | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/awx/ui/client/src/templates/job-template.form.js b/awx/ui/client/src/templates/job-template.form.js index 732bc5767e..bf0e911b65 100644 --- a/awx/ui/client/src/templates/job-template.form.js +++ b/awx/ui/client/src/templates/job-template.form.js @@ -322,6 +322,18 @@ function(NotificationsList, CompletedJobsList, i18n) { dataContainer: "body", labelClass: 'stack-inline', ngDisabled: '!(job_template_obj.summary_fields.user_capabilities.edit || canAddJobTemplate)' + }, { + name: 'store_facts', + label: i18n._('Store Ansible Facts'), + type: 'checkbox', + column: 2, + awPopOver: "

" + i18n._("If enabled, a fact scan will be done when this job is launched.") + "

", + dataPlacement: 'right', + dataTitle: i18n._('Store Ansible Facts'), + dataContainer: "body", + labelClass: 'stack-inline', + ngDisabled: '!(job_template_obj.summary_fields.user_capabilities.edit || canAddJobTemplate)', + ngShow: "!job_type.value || job_type.value === 'run'" }] }, callback_url: { diff --git a/awx/ui/client/src/templates/job_templates/add-job-template/job-template-add.controller.js b/awx/ui/client/src/templates/job_templates/add-job-template/job-template-add.controller.js index 735dc4d421..f5b640c528 100644 --- a/awx/ui/client/src/templates/job_templates/add-job-template/job-template-add.controller.js +++ b/awx/ui/client/src/templates/job_templates/add-job-template/job-template-add.controller.js @@ -413,6 +413,10 @@ $scope.survey_enabled = false; } + if($scope.job_type.value !== "run") { + $scope.store_facts = null; + } + generator.clearApiErrors($scope); Wait('start'); From 5628a0737dc070a9da520a60bb5c63ea8d041b36 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Mon, 8 May 2017 10:06:27 -0400 Subject: [PATCH 2/2] Removed scan job type logic for store_facts --- awx/ui/client/src/templates/job-template.form.js | 3 +-- .../add-job-template/job-template-add.controller.js | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/awx/ui/client/src/templates/job-template.form.js b/awx/ui/client/src/templates/job-template.form.js index bf0e911b65..5a3d5e0754 100644 --- a/awx/ui/client/src/templates/job-template.form.js +++ b/awx/ui/client/src/templates/job-template.form.js @@ -332,8 +332,7 @@ function(NotificationsList, CompletedJobsList, i18n) { dataTitle: i18n._('Store Ansible Facts'), dataContainer: "body", labelClass: 'stack-inline', - ngDisabled: '!(job_template_obj.summary_fields.user_capabilities.edit || canAddJobTemplate)', - ngShow: "!job_type.value || job_type.value === 'run'" + ngDisabled: '!(job_template_obj.summary_fields.user_capabilities.edit || canAddJobTemplate)' }] }, callback_url: { diff --git a/awx/ui/client/src/templates/job_templates/add-job-template/job-template-add.controller.js b/awx/ui/client/src/templates/job_templates/add-job-template/job-template-add.controller.js index f5b640c528..735dc4d421 100644 --- a/awx/ui/client/src/templates/job_templates/add-job-template/job-template-add.controller.js +++ b/awx/ui/client/src/templates/job_templates/add-job-template/job-template-add.controller.js @@ -413,10 +413,6 @@ $scope.survey_enabled = false; } - if($scope.job_type.value !== "run") { - $scope.store_facts = null; - } - generator.clearApiErrors($scope); Wait('start');