From 1cda0dd1a9a9bc990c6d5f4a9c94686464407cbc Mon Sep 17 00:00:00 2001 From: chouseknecht Date: Tue, 15 Oct 2013 21:14:57 +0000 Subject: [PATCH] AC-286 Now using /api/v1/groups/N/potential_children to build list of possible groups for copy. --- awx/ui/static/js/helpers/Groups.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/awx/ui/static/js/helpers/Groups.js b/awx/ui/static/js/helpers/Groups.js index 7f4ac3a2ae..502512fe14 100644 --- a/awx/ui/static/js/helpers/Groups.js +++ b/awx/ui/static/js/helpers/Groups.js @@ -70,6 +70,8 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', ' ProcessErrors, GetBasePath, GroupsAdd, RefreshTree, SelectionInit) { return function(params) { + // build and present the list of groups we can add to an existing group + var inventory_id = params.inventory_id; var group_id = (params.group_id !== undefined) ? params.group_id : null; @@ -92,8 +94,8 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', ' $('.popover').popover('hide'); //remove any lingering pop-overs $('#form-modal .btn-none').removeClass('btn-none').addClass('btn-success'); $('#form-modal').modal({ backdrop: 'static', keyboard: false }); - - var url = (group_id) ? GetBasePath('groups') + group_id + '/children/' : + + var url = (group_id) ? GetBasePath('groups') + group_id + '/potential_children/' : GetBasePath('inventory') + inventory_id + '/groups/'; SelectionInit({ scope: scope, list: list, url: url }); @@ -140,6 +142,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', ' } } + /* Now using /potential_children resource, so should not need to do this any longer. if (scope.PostRefreshRemove) { scope.PostRefreshRemove(); } @@ -150,9 +153,10 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', ' } } }); + */ - SearchInit({ scope: scope, set: 'groups', list: list, url: defaultUrl }); - PaginateInit({ scope: scope, list: list, url: defaultUrl, mode: 'lookup' }); + SearchInit({ scope: scope, set: 'groups', list: list, url: url }); + PaginateInit({ scope: scope, list: list, url: url, mode: 'lookup' }); scope.search(list.iterator); if (!scope.$$phase) {