mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 09:27:36 -02:30
Merge pull request #6849 from mabashian/6766-hide-disassociate-host
Hide disassociate host from non directly associated group
This commit is contained in:
@@ -29,8 +29,11 @@ export default ['$scope', 'NestedHostsListDefinition', '$rootScope', 'GetBasePat
|
|||||||
|
|
||||||
$scope.$watchCollection(list.name, function() {
|
$scope.$watchCollection(list.name, function() {
|
||||||
$scope[list.name] = _.map($scope.nested_hosts, function(value) {
|
$scope[list.name] = _.map($scope.nested_hosts, function(value) {
|
||||||
value.inventory_name = value.summary_fields.inventory.name;
|
angular.forEach(value.summary_fields.groups.results, function(directParentGroup) {
|
||||||
value.inventory_id = value.summary_fields.inventory.id;
|
if(directParentGroup.id === parseInt($state.params.group_id)) {
|
||||||
|
value.can_disassociate = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
return value;
|
return value;
|
||||||
});
|
});
|
||||||
setJobStatus();
|
setJobStatus();
|
||||||
@@ -72,7 +75,7 @@ export default ['$scope', 'NestedHostsListDefinition', '$rootScope', 'GetBasePat
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setJobStatus(){
|
function setJobStatus(){
|
||||||
_.forEach($scope.hosts, function(value) {
|
_.forEach($scope.nested_hosts, function(value) {
|
||||||
SetStatus({
|
SetStatus({
|
||||||
scope: $scope,
|
scope: $scope,
|
||||||
host: value
|
host: value
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ export default {
|
|||||||
icon: 'icon-trash',
|
icon: 'icon-trash',
|
||||||
awToolTip: 'Disassociate host',
|
awToolTip: 'Disassociate host',
|
||||||
dataPlacement: 'top',
|
dataPlacement: 'top',
|
||||||
ngShow: 'nested_host.summary_fields.user_capabilities.delete'
|
ngShow: 'nested_host.summary_fields.user_capabilities.delete && nested_host.can_disassociate'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user