mirror of
https://github.com/ansible/awx.git
synced 2024-10-28 10:55:30 +03:00
AC-536 No longer dissaociating hosts from /inventories/N/groups, so no more cases where dragging-n-dropping groups results in lost hosts. Fixed tree styling to better align nodes.
This commit is contained in:
parent
09e64e3685
commit
be74d9d932
@ -1060,7 +1060,7 @@ input[type="checkbox"].checkbox-no-label {
|
||||
|
||||
ul {
|
||||
list-style-type: none;
|
||||
padding-left: 16px;
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
.tree-root {
|
||||
@ -1105,13 +1105,14 @@ input[type="checkbox"].checkbox-no-label {
|
||||
|
||||
.expand-container {
|
||||
width: 14px;
|
||||
text-align: center;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.badge-container {
|
||||
vertical-align: none;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
#root-badge-container {
|
||||
|
@ -252,12 +252,11 @@ angular.module('TreeSelector', ['Utilities', 'RestServices', 'TreeSelector', 'Gr
|
||||
var sublist, subicon;
|
||||
if (childlists && childlists.length > 0) {
|
||||
// has childen
|
||||
for (var i=0; i < childlists.length; i++) {
|
||||
sublist = angular.element(childlists[i]);
|
||||
sublist.addClass('hidden');
|
||||
subicon = list.find('li')[0].children()[0];
|
||||
childlists.each(function(idx) {
|
||||
$(this).addClass('hidden');
|
||||
subicon = $(this).find('li').first().find('.expand-container i');
|
||||
subicon.removeClass('icon-caret-down').addClass('icon-caret-right');
|
||||
}
|
||||
});
|
||||
}
|
||||
/* When the active node's parent is closed, activate the parent */
|
||||
if ($(parent).find('.active').length > 0) {
|
||||
@ -329,8 +328,9 @@ angular.module('TreeSelector', ['Utilities', 'RestServices', 'TreeSelector', 'Gr
|
||||
scope.removeGroupRemove();
|
||||
}
|
||||
scope.removeGroupRemove = scope.$on('removeGroup', function() {
|
||||
var url = (parent.attr('data-group-id')) ? GetBasePath('base') + 'groups/' + parent.attr('data-group-id') + '/children/' :
|
||||
GetBasePath('inventory') + inv_id + '/groups/';
|
||||
if (parent.attr('data-group-id')) {
|
||||
// Only remove a group from a parent when the parent is a group and not the inventory root
|
||||
var url = GetBasePath('base') + 'groups/' + parent.attr('data-group-id') + '/children/';
|
||||
Rest.setUrl(url);
|
||||
Rest.post({ id: node.attr('data-group-id'), disassociate: 1 })
|
||||
.success( function(data, status, headers, config) {
|
||||
@ -342,6 +342,10 @@ angular.module('TreeSelector', ['Utilities', 'RestServices', 'TreeSelector', 'Gr
|
||||
{ hdr: 'Error!', msg: 'Failed to remove ' + node.attr('name') + ' from ' +
|
||||
parent.attr('name') + '. POST returned status: ' + status });
|
||||
});
|
||||
}
|
||||
else {
|
||||
cleanUp('success');
|
||||
}
|
||||
});
|
||||
|
||||
if (scope['addToTargetRemove']) {
|
||||
|
Loading…
Reference in New Issue
Block a user