mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 16:51:11 +03:00
Merge pull request #6849 from mabashian/6766-hide-disassociate-host
Hide disassociate host from non directly associated group
This commit is contained in:
commit
8ed1091f44
@ -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
|
||||
|
@ -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'
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user