diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts-list.controller.js b/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts-list.controller.js index 54d090a181..a4e449f88b 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts-list.controller.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts-list.controller.js @@ -29,8 +29,11 @@ export default ['$scope', 'NestedHostsListDefinition', '$rootScope', 'GetBasePat $scope.$watchCollection(list.name, function() { $scope[list.name] = _.map($scope.nested_hosts, function(value) { - value.inventory_name = value.summary_fields.inventory.name; - value.inventory_id = value.summary_fields.inventory.id; + angular.forEach(value.summary_fields.groups.results, function(directParentGroup) { + if(directParentGroup.id === parseInt($state.params.group_id)) { + value.can_disassociate = true; + } + }); return value; }); setJobStatus(); @@ -72,7 +75,7 @@ export default ['$scope', 'NestedHostsListDefinition', '$rootScope', 'GetBasePat } function setJobStatus(){ - _.forEach($scope.hosts, function(value) { + _.forEach($scope.nested_hosts, function(value) { SetStatus({ scope: $scope, host: value 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 63afcd758e..ee7048f11d 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 @@ -89,7 +89,7 @@ export default { icon: 'icon-trash', awToolTip: 'Disassociate host', dataPlacement: 'top', - ngShow: 'nested_host.summary_fields.user_capabilities.delete' + ngShow: 'nested_host.summary_fields.user_capabilities.delete && nested_host.can_disassociate' } },