From 993855f70aa7fcc811ee9f3994a23beba0c26413 Mon Sep 17 00:00:00 2001 From: mabashian Date: Wed, 7 Aug 2019 11:15:42 -0400 Subject: [PATCH] Remove restriction on toggling dynamic hosts on/off from the host form view. --- .../inventories-hosts/hosts/edit/host-edit.controller.js | 7 ++----- .../nested-hosts/group-nested-hosts-add.controller.js | 7 ++----- .../inventories/related/hosts/add/host-add.controller.js | 7 ++----- .../inventories/related/hosts/edit/host-edit.controller.js | 7 ++----- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/awx/ui/client/src/inventories-hosts/hosts/edit/host-edit.controller.js b/awx/ui/client/src/inventories-hosts/hosts/edit/host-edit.controller.js index e32e1d5374..ab304cb37c 100644 --- a/awx/ui/client/src/inventories-hosts/hosts/edit/host-edit.controller.js +++ b/awx/ui/client/src/inventories-hosts/hosts/edit/host-edit.controller.js @@ -5,16 +5,13 @@ *************************************************/ export default - ['$scope', '$state', '$stateParams', 'GenerateForm', 'HostsService', 'host', '$rootScope', - function($scope, $state, $stateParams, GenerateForm, HostsService, host, $rootScope){ + ['$scope', '$state', 'HostsService', 'host', '$rootScope', + function($scope, $state, HostsService, host, $rootScope){ $scope.parseType = 'yaml'; $scope.formCancel = function(){ $state.go('^', null, {reload: true}); }; $scope.toggleHostEnabled = function(){ - if ($scope.host.has_inventory_sources){ - return; - } $scope.host.enabled = !$scope.host.enabled; }; $scope.toggleEnabled = function(){ diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts-add.controller.js b/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts-add.controller.js index 4cb3e840bb..85019412e2 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts-add.controller.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts-add.controller.js @@ -5,9 +5,9 @@ *************************************************/ export default ['$state', '$stateParams', '$scope', 'RelatedHostsFormDefinition', 'ParseTypeChange', - 'GenerateForm', 'HostsService', 'rbacUiControlService', 'GetBasePath', 'ToJSON', 'canAdd', 'GroupsService', + 'GenerateForm', 'HostsService', 'ToJSON', 'canAdd', 'GroupsService', function($state, $stateParams, $scope, RelatedHostsFormDefinition, ParseTypeChange, - GenerateForm, HostsService, rbacUiControlService, GetBasePath, ToJSON, canAdd, GroupsService) { + GenerateForm, HostsService, ToJSON, canAdd, GroupsService) { init(); @@ -29,9 +29,6 @@ export default ['$state', '$stateParams', '$scope', 'RelatedHostsFormDefinition' $state.go('^'); }; $scope.toggleHostEnabled = function() { - if ($scope.host.has_inventory_sources){ - return; - } $scope.host.enabled = !$scope.host.enabled; }; $scope.formSave = function(){ diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/hosts/add/host-add.controller.js b/awx/ui/client/src/inventories-hosts/inventories/related/hosts/add/host-add.controller.js index 80105c6eaa..37f3eefc8f 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/hosts/add/host-add.controller.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/hosts/add/host-add.controller.js @@ -5,9 +5,9 @@ *************************************************/ export default ['$state', '$stateParams', '$scope', 'RelatedHostsFormDefinition', - 'GenerateForm', 'HostsService', 'GetBasePath', 'ToJSON', 'canAdd', + 'GenerateForm', 'HostsService', 'ToJSON', 'canAdd', function($state, $stateParams, $scope, RelatedHostsFormDefinition, - GenerateForm, HostsService, GetBasePath, ToJSON, canAdd) { + GenerateForm, HostsService, ToJSON, canAdd) { init(); @@ -21,9 +21,6 @@ export default ['$state', '$stateParams', '$scope', 'RelatedHostsFormDefinition' $state.go('^'); }; $scope.toggleHostEnabled = function() { - if ($scope.host.has_inventory_sources){ - return; - } $scope.host.enabled = !$scope.host.enabled; }; $scope.formSave = function(){ diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/hosts/edit/host-edit.controller.js b/awx/ui/client/src/inventories-hosts/inventories/related/hosts/edit/host-edit.controller.js index 81755c1b17..098a6113a2 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/hosts/edit/host-edit.controller.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/hosts/edit/host-edit.controller.js @@ -5,17 +5,14 @@ *************************************************/ export default - ['$scope', '$state', '$stateParams', 'GenerateForm', 'ParseTypeChange', 'HostsService', 'host', '$rootScope', - function($scope, $state, $stateParams, GenerateForm, ParseTypeChange, HostsService, host, $rootScope){ + ['$scope', '$state', 'HostsService', 'host', '$rootScope', + function($scope, $state, HostsService, host, $rootScope){ $scope.isSmartInvHost = $state.includes('inventories.editSmartInventory.hosts.edit'); $scope.parseType = 'yaml'; $scope.formCancel = function(){ $state.go('^', null, {reload: true}); }; $scope.toggleHostEnabled = function(){ - if ($scope.host.has_inventory_sources){ - return; - } $scope.host.enabled = !$scope.host.enabled; }; $scope.toggleEnabled = function(){