From 2f440a037b8a95d2395a5a99c4f1ff123e86acc5 Mon Sep 17 00:00:00 2001 From: jaredevantabor Date: Thu, 12 Jan 2017 16:22:25 -0800 Subject: [PATCH] fixing copy/move routes, as well as the search on those routes --- .../manage/copy-move/copy-move-groups.controller.js | 3 --- .../src/inventories/manage/copy-move/copy-move.route.js | 4 ++-- awx/ui/client/src/lists/Groups.js | 3 ++- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/awx/ui/client/src/inventories/manage/copy-move/copy-move-groups.controller.js b/awx/ui/client/src/inventories/manage/copy-move/copy-move-groups.controller.js index 9231e7a5b2..8c5549addb 100644 --- a/awx/ui/client/src/inventories/manage/copy-move/copy-move-groups.controller.js +++ b/awx/ui/client/src/inventories/manage/copy-move/copy-move-groups.controller.js @@ -60,9 +60,6 @@ }; function init(){ - var url = GetBasePath('inventory') + $stateParams.inventory_id + '/groups/'; - url += $stateParams.group ? '?not__id__in=' + group.id + ',' + _.last($stateParams.group) : '?not__id=' + group.id; - list.basePath = url; $scope.atRootLevel = $stateParams.group ? false : true; // search init diff --git a/awx/ui/client/src/inventories/manage/copy-move/copy-move.route.js b/awx/ui/client/src/inventories/manage/copy-move/copy-move.route.js index f15705778d..e4a7534be8 100644 --- a/awx/ui/client/src/inventories/manage/copy-move/copy-move.route.js +++ b/awx/ui/client/src/inventories/manage/copy-move/copy-move.route.js @@ -30,8 +30,8 @@ var copyMoveGroupRoute = { resolve: { Dataset: ['CopyMoveGroupList', 'QuerySet', '$stateParams', 'GetBasePath', 'group', function(list, qs, $stateParams, GetBasePath, group) { - $stateParams.copy_search.not__id__in = ($stateParams.group.length > 0 ? group.id + ',' + _.last($stateParams.group) : group.id); - let path = GetBasePath(list.name); + $stateParams.copy_search.not__id__in = ($stateParams.group && $stateParams.group.length > 0 ? group.id + ',' + _.last($stateParams.group) : group.id.toString()); + let path = GetBasePath('inventory') + $stateParams.inventory_id + '/groups/'; return qs.search(path, $stateParams.copy_search); } ], diff --git a/awx/ui/client/src/lists/Groups.js b/awx/ui/client/src/lists/Groups.js index 0bfc6a9f3f..205adde477 100644 --- a/awx/ui/client/src/lists/Groups.js +++ b/awx/ui/client/src/lists/Groups.js @@ -22,5 +22,6 @@ export default key: true, label: 'Target Group Name' } - } + }, + basePath: 'api/v1/inventories/{{$stateParams.inventory_id}}/groups' });