diff --git a/awx/ui/static/js/helpers/Groups.js b/awx/ui/static/js/helpers/Groups.js index 625b8a68f1..57ee0402fe 100644 --- a/awx/ui/static/js/helpers/Groups.js +++ b/awx/ui/static/js/helpers/Groups.js @@ -1290,10 +1290,12 @@ function($compile, SchedulerInit, Rest, Wait, SetSchedulesInnerDialogSize, Sched scope.deleteOption = "preserve-all"; - scope.helpText = "
Delete
Deletes all groups and hosts associated with the group being deleted. " + + scope.helpText = "
Delete
Deletes groups and hosts associated with the group being deleted. " + "If a group or host is associated with other groups, it will still exist within those groups. Otherwise, " + "the associated groups and hosts will no longer appear in the inventory.
\n" + - "
Promote
Groups and hosts associated with the group being removed will be promoted one level.
\n" + + "
Promote
Groups and hosts associated with the group being removed will be " + + "promoted one level. Note: groups already associated with other groups cannot be promoted to the top level of the " + + "tree.
\n" + "
esc or click to close
"; buttonSet = [{ @@ -1399,7 +1401,14 @@ function($compile, SchedulerInit, Rest, Wait, SetSchedulesInnerDialogSize, Sched scope.removeDisassociateGroup(); } scope.removeDisassociateGroup = scope.$on('DisassociateGroup', function() { - var url = GetBasePath('inventory') + scope.inventory_id + '/groups/'; + var parent, url; + if (node.parent === 0) { + url = GetBasePath('inventory') + scope.inventory_id + '/groups/'; + } + else { + parent = Find({ list: scope.groups, key: 'id', val: node.parent }); + url = GetBasePath('groups') + parent.group_id + '/children/'; + } Rest.setUrl(url); Rest.post({ id: node.group_id, disassociate: 1 }) .success(function () {