mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
Inventory group delete -implemented disassociate 'all' when deleteing a subgroup and promoting children.
This commit is contained in:
@@ -1401,16 +1401,18 @@ function($compile, SchedulerInit, Rest, Wait, SetSchedulesInnerDialogSize, Sched
|
|||||||
scope.removeDisassociateGroup();
|
scope.removeDisassociateGroup();
|
||||||
}
|
}
|
||||||
scope.removeDisassociateGroup = scope.$on('DisassociateGroup', function() {
|
scope.removeDisassociateGroup = scope.$on('DisassociateGroup', function() {
|
||||||
var parent, url;
|
var data, parent, url;
|
||||||
if (node.parent === 0) {
|
if (node.parent === 0) {
|
||||||
url = GetBasePath('inventory') + scope.inventory_id + '/groups/';
|
url = GetBasePath('inventory') + scope.inventory_id + '/groups/';
|
||||||
|
data = { id: node.group_id, disassociate: 1 };
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
parent = Find({ list: scope.groups, key: 'id', val: node.parent });
|
parent = Find({ list: scope.groups, key: 'id', val: node.parent });
|
||||||
url = GetBasePath('groups') + parent.group_id + '/children/';
|
url = GetBasePath('groups') + parent.group_id + '/children/' + node.group_id + '/';
|
||||||
|
data = { disassociate: 'all' };
|
||||||
}
|
}
|
||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.post({ id: node.group_id, disassociate: 1 })
|
Rest.post(data)
|
||||||
.success(function () {
|
.success(function () {
|
||||||
scope.$emit('GroupDeleteCompleted'); // Signal a group refresh to start
|
scope.$emit('GroupDeleteCompleted'); // Signal a group refresh to start
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user