mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 03:10:42 -03:30
Merge pull request #5998 from mabashian/5947-copy-move-host-pagination
Fixed copy/move groups/hosts pagination bug
This commit is contained in:
commit
5e9522322c
@ -11,11 +11,9 @@
|
||||
|
||||
$scope.item = group;
|
||||
$scope.submitMode = $stateParams.groups === undefined ? 'move' : 'copy';
|
||||
$scope.toggle_row = function(id){
|
||||
// toggle off anything else currently selected
|
||||
_.forEach($scope.groups, (item) => {return item.id === id ? item.checked = 1 : item.checked = null;});
|
||||
// yoink the currently selected thing
|
||||
$scope.selected = _.find($scope.groups, (item) => {return item.id === id;});
|
||||
|
||||
$scope.updateSelected = function(selectedGroup) {
|
||||
$scope.selected = angular.copy(selectedGroup);
|
||||
};
|
||||
$scope.formCancel = function(){
|
||||
$state.go('^');
|
||||
|
||||
@ -11,11 +11,9 @@
|
||||
|
||||
$scope.item = host;
|
||||
$scope.submitMode = 'copy';
|
||||
$scope.toggle_row = function(id){
|
||||
// toggle off anything else currently selected
|
||||
_.forEach($scope.groups, (item) => {return item.id === id ? item.checked = 1 : item.checked = null;});
|
||||
// yoink the currently selected thing
|
||||
$scope.selected = _.find($scope.groups, (item) => {return item.id === id;});
|
||||
|
||||
$scope.updateSelected = function(selectedGroup) {
|
||||
$scope.selected = angular.copy(selectedGroup);
|
||||
};
|
||||
$scope.formCancel = function(){
|
||||
$state.go('^');
|
||||
|
||||
@ -0,0 +1,44 @@
|
||||
/*************************************************
|
||||
* Copyright (c) 2016 Ansible, Inc.
|
||||
*
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
export default
|
||||
['$scope', 'CopyMoveGroupList', 'Dataset',
|
||||
function($scope, list, Dataset){
|
||||
init();
|
||||
|
||||
function init() {
|
||||
$scope.list = list;
|
||||
$scope[`${list.iterator}_dataset`] = Dataset.data;
|
||||
$scope[list.name] = $scope[`${list.iterator}_dataset`].results;
|
||||
|
||||
$scope.$watch('groups', function(){
|
||||
if($scope.selectedGroup){
|
||||
$scope.groups.forEach(function(row, i) {
|
||||
if(row.id === $scope.selectedGroup.id) {
|
||||
$scope.groups[i].checked = 1;
|
||||
}
|
||||
else {
|
||||
$scope.groups[i].checked = 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$scope.toggle_row = function(id) {
|
||||
// toggle off anything else currently selected
|
||||
_.forEach($scope.groups, (item) => {
|
||||
if(item.id === id) {
|
||||
item.checked = 1;
|
||||
$scope.selectedGroup = item;
|
||||
$scope.updateSelected(item);
|
||||
}
|
||||
else {
|
||||
item.checked = null;
|
||||
}
|
||||
});
|
||||
};
|
||||
}];
|
||||
@ -8,6 +8,7 @@ import { N_ } from '../../../i18n';
|
||||
|
||||
import CopyMoveGroupsController from './copy-move-groups.controller';
|
||||
import CopyMoveHostsController from './copy-move-hosts.controller';
|
||||
import CopyMoveListController from './copy-move-list.controller';
|
||||
|
||||
var copyMoveGroupRoute = {
|
||||
name: 'inventoryManage.copyMoveGroup',
|
||||
@ -53,7 +54,8 @@ var copyMoveGroupRoute = {
|
||||
input_type: 'radio'
|
||||
});
|
||||
return html;
|
||||
}
|
||||
},
|
||||
controller: CopyMoveListController
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -90,7 +92,8 @@ var copyMoveHostRoute = {
|
||||
input_type: 'radio'
|
||||
});
|
||||
return html;
|
||||
}
|
||||
},
|
||||
controller: CopyMoveListController
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user