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 37af28407b..9231e7a5b2 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 @@ -5,10 +5,10 @@ *************************************************/ export default - ['$scope', '$state', '$stateParams', 'generateList', 'GroupManageService', 'GetBasePath', 'CopyMoveGroupList', 'group', - function($scope, $state, $stateParams, GenerateList, GroupManageService, GetBasePath, CopyMoveGroupList, group){ - var list = CopyMoveGroupList, - view = GenerateList; + ['$scope', '$state', '$stateParams', 'GroupManageService', 'GetBasePath', 'CopyMoveGroupList', 'group', 'Dataset', + function($scope, $state, $stateParams, GroupManageService, GetBasePath, CopyMoveGroupList, group, Dataset){ + var list = CopyMoveGroupList; + $scope.item = group; $scope.submitMode = $stateParams.groups === undefined ? 'move' : 'copy'; $scope['toggle_'+ list.iterator] = function(id){ @@ -58,33 +58,18 @@ $(el).prop('disabled', (idx, value) => !value); }); }; - var init = function(){ - 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; - view.inject(list, { - mode: 'lookup', - id: 'copyMove-list', - scope: $scope, - input_type: 'radio' - }); - // @issue: OLD SEARCH - // SearchInit({ - // scope: $scope, - // set: list.name, - // list: list, - // url: url - // }); - // PaginateInit({ - // scope: $scope, - // list: list, - // url : url, - // mode: 'lookup' - // }); - // $scope.search(list.iterator, null, true, false); - // remove the current group from list - }; + 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 + $scope.list = list; + $scope[`${list.iterator}_dataset`] = Dataset.data; + $scope[list.name] = $scope[`${list.iterator}_dataset`].results; + } + init(); }]; diff --git a/awx/ui/client/src/inventories/manage/copy-move/copy-move-hosts.controller.js b/awx/ui/client/src/inventories/manage/copy-move/copy-move-hosts.controller.js index 9d278fde69..a01387c173 100644 --- a/awx/ui/client/src/inventories/manage/copy-move/copy-move-hosts.controller.js +++ b/awx/ui/client/src/inventories/manage/copy-move/copy-move-hosts.controller.js @@ -5,10 +5,10 @@ *************************************************/ export default - ['$scope', '$state', '$stateParams', 'generateList', 'HostManageService', 'GetBasePath', 'CopyMoveGroupList', 'host', - function($scope, $state, $stateParams, GenerateList, HostManageService, GetBasePath, CopyMoveGroupList, host){ - var list = CopyMoveGroupList, - view = GenerateList; + ['$scope', '$state', '$stateParams', 'generateList', 'HostManageService', 'GetBasePath', 'CopyMoveGroupList', 'host', 'Dataset', + function($scope, $state, $stateParams, GenerateList, HostManageService, GetBasePath, CopyMoveGroupList, host, Dataset){ + var list = CopyMoveGroupList; + $scope.item = host; $scope.submitMode = 'copy'; $scope['toggle_'+ list.iterator] = function(id){ @@ -40,29 +40,11 @@ } }; var init = function(){ - var url = GetBasePath('inventory') + $stateParams.inventory_id + '/groups/'; - list.basePath = url; - view.inject(list, { - mode: 'lookup', - id: 'copyMove-list', - scope: $scope, - input_type: 'radio' - }); + // search init + $scope.list = list; + $scope[`${list.iterator}_dataset`] = Dataset.data; + $scope[list.name] = $scope[`${list.iterator}_dataset`].results; - // @issue: OLD SEARCH - // SearchInit({ - // scope: $scope, - // set: list.name, - // list: list, - // url: url - // }); - // PaginateInit({ - // scope: $scope, - // list: list, - // url : url, - // mode: 'lookup' - // }); - // $scope.search(list.iterator, null, true, false); }; init(); }]; diff --git a/awx/ui/client/src/inventories/manage/copy-move/copy-move.partial.html b/awx/ui/client/src/inventories/manage/copy-move/copy-move.partial.html index 1847837b92..030f0c7e3a 100644 --- a/awx/ui/client/src/inventories/manage/copy-move/copy-move.partial.html +++ b/awx/ui/client/src/inventories/manage/copy-move/copy-move.partial.html @@ -10,7 +10,7 @@ Move -
+