diff --git a/awx/ui/static/js/helpers/Hosts.js b/awx/ui/static/js/helpers/Hosts.js index b389146eb1..07d7f3c4f9 100644 --- a/awx/ui/static/js/helpers/Hosts.js +++ b/awx/ui/static/js/helpers/Hosts.js @@ -417,7 +417,7 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', 'H }) .error( function(data, status, headers, config) { ProcessErrors(scope, data, status, form, - { hdr: 'Error!', msg: 'Failed to retrieve host: ' + id + '. GET returned status: ' + status }); + { hdr: 'Error!', msg: 'Failed to retrieve host: ' + host_id + '. GET returned status: ' + status }); }); diff --git a/awx/ui/static/less/ansible-ui.less b/awx/ui/static/less/ansible-ui.less index 5aa4167c55..d115c33e7d 100644 --- a/awx/ui/static/less/ansible-ui.less +++ b/awx/ui/static/less/ansible-ui.less @@ -376,12 +376,12 @@ dd { .help-link, .help-link:active, .help-link:visited { - color: #49afcd; + color: @grey; text-decoration: none; } .help-link:hover { - color: @blue; + color: @black; text-decoration: none; } diff --git a/awx/ui/static/lib/ansible/InventoryTree.js b/awx/ui/static/lib/ansible/InventoryTree.js index 5b4b3a2d46..becda0f682 100644 --- a/awx/ui/static/lib/ansible/InventoryTree.js +++ b/awx/ui/static/lib/ansible/InventoryTree.js @@ -75,7 +75,7 @@ angular.module('InventoryTree', ['Utilities', 'RestServices', 'GroupsHelper', 'P var children = []; for (var j=0; j < sorted[i].children.length; j++) { - children.push(sorted[i].children[j]); + children.push(sorted[i].children[j].id); } var group = { diff --git a/awx/ui/static/lib/ansible/directives.js b/awx/ui/static/lib/ansible/directives.js index e28c132148..b5306c67b4 100644 --- a/awx/ui/static/lib/ansible/directives.js +++ b/awx/ui/static/lib/ansible/directives.js @@ -554,14 +554,30 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService']) // the following is inventory specific accept checking and // drop processing. accept: function(draggable) { - var node = Find({ list: scope.groups, key: 'id', val: parseInt($(this).attr('data-tree-id')) }); - if (node) { - var group = draggable.attr('data-group-id'); - return (node.children.indexOf(group) > -1) ? false : true; + if ($(this).attr('data-group-id') == draggable.attr('data-group-id')) { + // No dropping a node onto itself (or a copy) + return false; } else { - // this shouldn't be possible - return false; + // No dropping a node into a group that already has the node + var node = Find({ list: scope.groups, key: 'id', val: parseInt($(this).attr('data-tree-id')) }); + if (node) { + var group = parseInt(draggable.attr('data-group-id')); + var found = false; + // For whatever reason indexOf() would not work... + for (var i=0; i < node.children.length; i++) { + if (node.children[i] == group) { + found = true; + break; + } + + } + return (found) ? false : true; + } + else { + // this shouldn't be possible + return false; + } } }, over: function(e, ui) {