mirror of
https://github.com/ansible/awx.git
synced 2026-03-18 17:37:30 -02:30
Merge pull request #2845 from marshmalien/fix-org-ig-modal
Fix instance group modal selection Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
@@ -65,8 +65,13 @@ export default ['templateUrl', '$window', function(templateUrl, $window) {
|
|||||||
$('#instance-groups-modal-body').append($compile(html)($scope));
|
$('#instance-groups-modal-body').append($compile(html)($scope));
|
||||||
|
|
||||||
if ($scope.instanceGroups) {
|
if ($scope.instanceGroups) {
|
||||||
$scope.instance_groups.map( (item) => {
|
$scope.instanceGroups = $scope.instanceGroups.map( (item) => {
|
||||||
isSelected(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();
|
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) {
|
$scope.$on("selectedOrDeselected", function(e, value) {
|
||||||
let item = value.value;
|
let item = value.value;
|
||||||
if (value.isSelected) {
|
if (value.isSelected) {
|
||||||
|
|||||||
Reference in New Issue
Block a user