1
0
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:
Chris Houseknecht 2013-11-05 20:37:51 +00:00
parent 09e64e3685
commit be74d9d932
2 changed files with 25 additions and 20 deletions

View File

@ -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 {

View File

@ -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,19 +328,24 @@ 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/';
Rest.setUrl(url);
Rest.post({ id: node.attr('data-group-id'), disassociate: 1 })
.success( function(data, status, headers, config) {
cleanUp('success');
})
.error( function(data, status, headers, config) {
cleanUp('fail');
ProcessErrors(scope, data, status, null,
{ hdr: 'Error!', msg: 'Failed to remove ' + node.attr('name') + ' from ' +
parent.attr('name') + '. POST returned status: ' + status });
});
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) {
cleanUp('success');
})
.error( function(data, status, headers, config) {
cleanUp('fail');
ProcessErrors(scope, data, status, null,
{ hdr: 'Error!', msg: 'Failed to remove ' + node.attr('name') + ' from ' +
parent.attr('name') + '. POST returned status: ' + status });
});
}
else {
cleanUp('success');
}
});
if (scope['addToTargetRemove']) {