diff --git a/awx/ui/static/js/helpers/Hosts.js b/awx/ui/static/js/helpers/Hosts.js index b39377f3af..b389146eb1 100644 --- a/awx/ui/static/js/helpers/Hosts.js +++ b/awx/ui/static/js/helpers/Hosts.js @@ -56,7 +56,6 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', 'H SearchInit({ scope: scope, set: 'hosts', list: InventoryHosts, url: url }); PaginateInit({ scope: scope, list: InventoryHosts, url: url }); - console.log('before call to hosts search') scope.search(InventoryHosts.iterator); } }]) diff --git a/awx/ui/static/less/ansible-ui.less b/awx/ui/static/less/ansible-ui.less index 7f6f4865b0..5aa4167c55 100644 --- a/awx/ui/static/less/ansible-ui.less +++ b/awx/ui/static/less/ansible-ui.less @@ -1063,17 +1063,14 @@ input[type="checkbox"].checkbox-no-label { } .draggable-clone { - /* padding: 4px; - border-radius: 6px; - background: transparent; - border: 1px solid @grey; */ + opacity: .60; font-weight: bold; } .droppable-hover { background-color: @info; color: @info-color; - padding: 4px; + padding: 5px; border: 1px solid @info-border; border-radius: 4px; } diff --git a/awx/ui/static/lib/ansible/InventoryTree.js b/awx/ui/static/lib/ansible/InventoryTree.js index 4be48c1837..5b4b3a2d46 100644 --- a/awx/ui/static/lib/ansible/InventoryTree.js +++ b/awx/ui/static/lib/ansible/InventoryTree.js @@ -222,8 +222,8 @@ angular.module('InventoryTree', ['Utilities', 'RestServices', 'GroupsHelper', 'P // Copy or Move a group on the tree after drag-n-drop - .factory('CopyMoveGroup', ['$compile', 'Alert', 'ProcessErrors', 'Find', 'Wait', 'Rest', 'Empty', - function($compile, Alert, ProcessErrors, Find, Wait, Rest, Empty) { + .factory('CopyMoveGroup', ['$compile', 'Alert', 'ProcessErrors', 'Find', 'Wait', 'Rest', 'Empty', 'GetBasePath', + function($compile, Alert, ProcessErrors, Find, Wait, Rest, Empty, GetBasePath) { return function(params) { var scope = params.scope; @@ -248,20 +248,23 @@ angular.module('InventoryTree', ['Utilities', 'RestServices', 'GroupsHelper', 'P } html += "\n"; - html += "
\n"; + html += "
\n"; if (target.id == 1) { html += "

Are you sure you want to move group " + inbound.name + " to the top level?

"; } else if (inbound.parent == 0) { - html += "

Are you sure you want to move group " + inbound.name + " away from the top level?

"; + html += "

Are you sure you want to move group " + inbound.name + " from the top level and make it a child of " + + target.name + "?

"; } else { + html += "
\n"; html += "

Would you like to copy or move group " + inbound.name + " to group " + target.name + "?

\n"; html += "
\n"; html += " Move\n"; html += " Copy\n"; html += "
\n"; + html += "
\n"; } html += "
\n"; @@ -280,7 +283,7 @@ angular.module('InventoryTree', ['Utilities', 'RestServices', 'GroupsHelper', 'P // Inject our custom dialog var e = angular.element(document.getElementById('inventory-modal-container')); - e.append(html); + e.empty().append(html); $compile(e)(scope); // Display it @@ -303,7 +306,8 @@ angular.module('InventoryTree', ['Utilities', 'RestServices', 'GroupsHelper', 'P scope.removeGroupRemove = scope.$on('removeGroup', function() { if (inbound.parent > 0) { // Only remove a group from a parent when the parent is a group and not the inventory root - var url = GetBasePath('base') + 'groups/' + inbound.parent + '/children/'; + var parent = Find({ list: scope.groups, key: 'id', val: inbound.parent }) + var url = GetBasePath('base') + 'groups/' + parent.group_id + '/children/'; Rest.setUrl(url); Rest.post({ id: inbound.group_id, disassociate: 1 }) .success( function(data, status, headers, config) { @@ -311,9 +315,10 @@ angular.module('InventoryTree', ['Utilities', 'RestServices', 'GroupsHelper', 'P scope.$emit('GroupDeleteCompleted'); }) .error( function(data, status, headers, config) { + Wait('stop'); ProcessErrors(scope, data, status, null, { hdr: 'Error!', msg: 'Failed to remove ' + inbound.name + - ' from ' + target.name + '. POST returned status: ' + status }); + ' from ' + parent.name + '. POST returned status: ' + status }); }); } else { @@ -325,7 +330,7 @@ angular.module('InventoryTree', ['Utilities', 'RestServices', 'GroupsHelper', 'P // add the new group to the target parent var url = (!Empty(target.group_id)) ? GetBasePath('base') + 'groups/' + target.group_id + '/children/' : - GetBasePath('inventory') + inv_id + '/groups/'; + GetBasePath('inventory') + scope.inventory_id + '/groups/'; var group = { id: inbound.group_id, name: inbound.name, @@ -339,6 +344,7 @@ angular.module('InventoryTree', ['Utilities', 'RestServices', 'GroupsHelper', 'P }) .error( function(data, status, headers, config) { var target_name = (Empty(target.group_id)) ? 'inventory' : target.name; + Wait('stop'); ProcessErrors(scope, data, status, null, { hdr: 'Error!', msg: 'Failed to add ' + node.attr('name') + ' to ' + target_name + '. POST returned status: ' + status }); @@ -348,10 +354,11 @@ angular.module('InventoryTree', ['Utilities', 'RestServices', 'GroupsHelper', 'P scope.copyGroup = function() { $('#copy-prompt-modal').modal('hide'); + Wait('start'); // add the new group to the target parent var url = (!Empty(target.group_id)) ? GetBasePath('base') + 'groups/' + target.group_id + '/children/' : - GetBasePath('inventory') + inv_id + '/groups/'; + GetBasePath('inventory') + scope.inventory_id + '/groups/'; var group = { id: inbound.group_id, name: inbound.name, @@ -366,6 +373,7 @@ angular.module('InventoryTree', ['Utilities', 'RestServices', 'GroupsHelper', 'P }) .error( function(data, status, headers, config) { var target_name = (Empty(target.group_id)) ? 'inventory' : target.name; + Wait('stop'); ProcessErrors(scope, data, status, null, { hdr: 'Error!', msg: 'Failed to add ' + node.attr('name') + ' to ' + target_name + '. POST returned status: ' + status }); diff --git a/awx/ui/static/lib/ansible/directives.js b/awx/ui/static/lib/ansible/directives.js index df59f15942..e28c132148 100644 --- a/awx/ui/static/lib/ansible/directives.js +++ b/awx/ui/static/lib/ansible/directives.js @@ -533,7 +533,8 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService']) helper: "clone", start: function(e, ui) { ui.helper.addClass('draggable-clone'); - } + }, + zIndex: 100 }); } @@ -573,7 +574,8 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService']) // Drag-n-drop succeeded. Trigger a response from the inventory.edit controller $(this).removeClass('droppable-hover'); scope.$emit('CopyMoveGroup', ui.draggable.attr('data-tree-id'), $(this).attr('data-tree-id')); - } + }, + tolerance: 'touch' }); }