mirror of
https://github.com/ansible/awx.git
synced 2026-01-18 13:11:19 -03:30
Hide disassociate host from group when the host is not directly associated with the currently viewed group
This commit is contained in:
parent
8c834daf46
commit
708d0698bc
@ -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…
x
Reference in New Issue
Block a user