From 7d2e1de42490aee19d6cdaf89ca3f0f0176ef5c8 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Sat, 1 Jul 2017 22:48:55 -0400 Subject: [PATCH 1/4] Make source field required and don't filter out Manual source type --- .../sources/factories/get-source-type-options.factory.js | 2 +- .../inventories/related/sources/sources.form.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/sources/factories/get-source-type-options.factory.js b/awx/ui/client/src/inventories-hosts/inventories/related/sources/factories/get-source-type-options.factory.js index 659c1c112a..befef8a499 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/sources/factories/get-source-type-options.factory.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/sources/factories/get-source-type-options.factory.js @@ -11,7 +11,7 @@ export default .success(function (data) { var i, choices = data.actions.GET.source.choices; for (i = 0; i < choices.length; i++) { - if (choices[i][0] !== 'file' && choices[i][0] !== "") { + if (choices[i][0] !== 'file') { scope[variable].push({ label: choices[i][1], value: choices[i][0] diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.form.js b/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.form.js index 6a6101f280..4463d8a5d5 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.form.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.form.js @@ -60,6 +60,7 @@ return { source: { label: i18n._('Source'), type: 'select', + required: true, ngOptions: 'source.label for source in source_type_options track by source.value', ngChange: 'sourceChange(source)', ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)', From 0889cbaf3bb3d3aa1ac5c815d94bc3b084d509f8 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Sat, 1 Jul 2017 22:53:22 -0400 Subject: [PATCH 2/4] Remove source required field --- .../inventories/related/sources/sources.form.js | 1 - 1 file changed, 1 deletion(-) diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.form.js b/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.form.js index 4463d8a5d5..6a6101f280 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.form.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.form.js @@ -60,7 +60,6 @@ return { source: { label: i18n._('Source'), type: 'select', - required: true, ngOptions: 'source.label for source in source_type_options track by source.value', ngChange: 'sourceChange(source)', ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)', From 527728176e0262d99c490b4a707a759b0fdae31f Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Sat, 1 Jul 2017 22:59:22 -0400 Subject: [PATCH 3/4] Make source required (again) --- .../inventories/related/sources/sources.form.js | 1 + 1 file changed, 1 insertion(+) diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.form.js b/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.form.js index 6a6101f280..4463d8a5d5 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.form.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.form.js @@ -60,6 +60,7 @@ return { source: { label: i18n._('Source'), type: 'select', + required: true, ngOptions: 'source.label for source in source_type_options track by source.value', ngChange: 'sourceChange(source)', ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)', From d4cd5a958c58e027991debcfd7745b117e01bc20 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Thu, 6 Jul 2017 16:16:05 -0400 Subject: [PATCH 4/4] Added our filter for Manual sources back in --- .../sources/factories/get-source-type-options.factory.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/sources/factories/get-source-type-options.factory.js b/awx/ui/client/src/inventories-hosts/inventories/related/sources/factories/get-source-type-options.factory.js index befef8a499..659c1c112a 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/sources/factories/get-source-type-options.factory.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/sources/factories/get-source-type-options.factory.js @@ -11,7 +11,7 @@ export default .success(function (data) { var i, choices = data.actions.GET.source.choices; for (i = 0; i < choices.length; i++) { - if (choices[i][0] !== 'file') { + if (choices[i][0] !== 'file' && choices[i][0] !== "") { scope[variable].push({ label: choices[i][1], value: choices[i][0]