mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 18:40:01 -03:30
Fix instance group modal selection
This commit is contained in:
parent
abc74fc9b8
commit
4723773354
@ -65,8 +65,13 @@ export default ['templateUrl', '$window', function(templateUrl, $window) {
|
||||
$('#instance-groups-modal-body').append($compile(html)($scope));
|
||||
|
||||
if ($scope.instanceGroups) {
|
||||
$scope.instance_groups.map( (item) => {
|
||||
isSelected(item);
|
||||
$scope.instanceGroups = $scope.instanceGroups.map( (item) => {
|
||||
item.isSelected = true;
|
||||
if (!$scope.igTags) {
|
||||
$scope.igTags = [];
|
||||
}
|
||||
$scope.igTags.push(item);
|
||||
return item;
|
||||
});
|
||||
}
|
||||
|
||||
@ -82,22 +87,10 @@ export default ['templateUrl', '$window', function(templateUrl, $window) {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
init();
|
||||
|
||||
function isSelected(item) {
|
||||
if(_.find($scope.instanceGroups, {id: item.id})){
|
||||
item.isSelected = true;
|
||||
if (!$scope.igTags) {
|
||||
$scope.igTags = [];
|
||||
}
|
||||
$scope.igTags.push(item);
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
$scope.$on("selectedOrDeselected", function(e, value) {
|
||||
let item = value.value;
|
||||
if (value.isSelected) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user