From 8e1e33735abb7d7d9695ce4b62477a7513b1e200 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 5 Aug 2019 11:18:56 -0400 Subject: [PATCH] Allow enable/disable of hosts in dynamic inventory from the UI. The API lets you do it, so we shouldn't block it from the UI. --- awx/ui/client/src/inventories-hosts/hosts/host.form.js | 5 ++--- awx/ui/client/src/inventories-hosts/hosts/host.list.js | 5 ++--- .../groups/related/nested-hosts/group-nested-hosts.form.js | 5 ++--- .../groups/related/nested-hosts/group-nested-hosts.list.js | 6 +++--- .../inventories/related/hosts/related-host.form.js | 6 +++--- .../inventories/related/hosts/related-host.list.js | 6 +++--- 6 files changed, 15 insertions(+), 18 deletions(-) diff --git a/awx/ui/client/src/inventories-hosts/hosts/host.form.js b/awx/ui/client/src/inventories-hosts/hosts/host.form.js index 64a1c88db9..e8d42123a3 100644 --- a/awx/ui/client/src/inventories-hosts/hosts/host.form.js +++ b/awx/ui/client/src/inventories-hosts/hosts/host.form.js @@ -34,11 +34,10 @@ function(i18n) { i18n._("Indicates if a host is available and should be included in running jobs.") + "

" + i18n._("For hosts that are part of an external" + - " inventory, this flag cannot be changed. It will be" + - " set by the inventory sync process.") + + " inventory, this may be" + + " reset by the inventory sync process.") + "

", dataTitle: i18n._('Host Enabled'), - ngDisabled: 'host.has_inventory_sources' } }, fields: { diff --git a/awx/ui/client/src/inventories-hosts/hosts/host.list.js b/awx/ui/client/src/inventories-hosts/hosts/host.list.js index fbc4ea48ad..9cf8f98274 100644 --- a/awx/ui/client/src/inventories-hosts/hosts/host.list.js +++ b/awx/ui/client/src/inventories-hosts/hosts/host.list.js @@ -27,7 +27,6 @@ export default ['i18n', function(i18n) { { field: 'toggleHost', content: { - ngDisabled: 'host.has_inventory_sources', label: '', columnClass: 'List-staticColumn--toggle', type: "toggle", @@ -36,8 +35,8 @@ export default ['i18n', function(i18n) { i18n._("Indicates if a host is available and should be included in running jobs.") + "

" + i18n._("For hosts that are part of an external" + - " inventory, this flag cannot be changed. It will be" + - " set by the inventory sync process.") + + " inventory, this flag may be" + + " reset by the inventory sync process.") + "

", dataPlacement: "right", nosort: true, diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts.form.js b/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts.form.js index df84c40e33..4f9d8512ab 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts.form.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts.form.js @@ -33,11 +33,10 @@ function(i18n) { i18n._("Indicates if a host is available and should be included in running jobs.") + "

" + i18n._("For hosts that are part of an external" + - " inventory, this flag cannot be changed. It will be" + - " set by the inventory sync process.") + + " inventory, this may be" + + " reset by the inventory sync process.") + "

", dataTitle: i18n._('Host Enabled'), - ngDisabled: 'host.has_inventory_sources' } }, fields: { diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts.list.js b/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts.list.js index b2038dc3d9..d0722dcf9e 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts.list.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts.list.js @@ -23,7 +23,7 @@ export default ['i18n', function(i18n) { { field: 'toggleHost', content: { - ngDisabled: '!nested_host.summary_fields.user_capabilities.edit || nested_host.has_inventory_sources', + ngDisabled: '!nested_host.summary_fields.user_capabilities.edit', label: '', columnClass: 'List-staticColumn--toggle', type: "toggle", @@ -32,8 +32,8 @@ export default ['i18n', function(i18n) { i18n._("Indicates if a host is available and should be included in running jobs.") + "

" + i18n._("For hosts that are part of an external" + - " inventory, this flag cannot be changed. It will be" + - " set by the inventory sync process.") + + " inventory, this flag may be" + + " reset by the inventory sync process.") + "

", dataPlacement: "right", nosort: true, diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/hosts/related-host.form.js b/awx/ui/client/src/inventories-hosts/inventories/related/hosts/related-host.form.js index 2d8616e87f..1e1b935fa7 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/hosts/related-host.form.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/hosts/related-host.form.js @@ -33,12 +33,12 @@ function(i18n) { i18n._("Indicates if a host is available and should be included in running jobs.") + "

" + i18n._("For hosts that are part of an external" + - " inventory, this flag cannot be changed. It will be" + - " set by the inventory sync process.") + + " inventory, this may be" + + " reset by the inventory sync process.") + "

", dataTitle: i18n._('Host Enabled'), dataPlacement: "right", - ngDisabled: '!host.summary_fields.user_capabilities.edit || host.has_inventory_sources || isSmartInvHost' + ngDisabled: '!host.summary_fields.user_capabilities.edit || isSmartInvHost' } }, fields: { diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/hosts/related-host.list.js b/awx/ui/client/src/inventories-hosts/inventories/related/hosts/related-host.list.js index 09d7a6ae1a..fdef44a350 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/hosts/related-host.list.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/hosts/related-host.list.js @@ -22,7 +22,7 @@ export default ['i18n', function(i18n) { { field: 'toggleHost', content: { - ngDisabled: '!host.summary_fields.user_capabilities.edit || host.has_inventory_sources', + ngDisabled: '!host.summary_fields.user_capabilities.edit', label: '', type: "toggle", ngClick: "toggleHost($event, host)", @@ -30,8 +30,8 @@ export default ['i18n', function(i18n) { i18n._("Indicates if a host is available and should be included in running jobs.") + "

" + i18n._("For hosts that are part of an external" + - " inventory, this flag cannot be changed. It will be" + - " set by the inventory sync process.") + + " inventory, this may be" + + " reset by the inventory sync process.") + "

", dataPlacement: "right", nosort: true,