mirror of
https://github.com/ansible/awx.git
synced 2026-03-26 13:25:02 -02:30
Merge pull request #5998 from mabashian/5947-copy-move-host-pagination
Fixed copy/move groups/hosts pagination bug
This commit is contained in:
@@ -11,11 +11,9 @@
|
|||||||
|
|
||||||
$scope.item = group;
|
$scope.item = group;
|
||||||
$scope.submitMode = $stateParams.groups === undefined ? 'move' : 'copy';
|
$scope.submitMode = $stateParams.groups === undefined ? 'move' : 'copy';
|
||||||
$scope.toggle_row = function(id){
|
|
||||||
// toggle off anything else currently selected
|
$scope.updateSelected = function(selectedGroup) {
|
||||||
_.forEach($scope.groups, (item) => {return item.id === id ? item.checked = 1 : item.checked = null;});
|
$scope.selected = angular.copy(selectedGroup);
|
||||||
// yoink the currently selected thing
|
|
||||||
$scope.selected = _.find($scope.groups, (item) => {return item.id === id;});
|
|
||||||
};
|
};
|
||||||
$scope.formCancel = function(){
|
$scope.formCancel = function(){
|
||||||
$state.go('^');
|
$state.go('^');
|
||||||
|
|||||||
@@ -11,11 +11,9 @@
|
|||||||
|
|
||||||
$scope.item = host;
|
$scope.item = host;
|
||||||
$scope.submitMode = 'copy';
|
$scope.submitMode = 'copy';
|
||||||
$scope.toggle_row = function(id){
|
|
||||||
// toggle off anything else currently selected
|
$scope.updateSelected = function(selectedGroup) {
|
||||||
_.forEach($scope.groups, (item) => {return item.id === id ? item.checked = 1 : item.checked = null;});
|
$scope.selected = angular.copy(selectedGroup);
|
||||||
// yoink the currently selected thing
|
|
||||||
$scope.selected = _.find($scope.groups, (item) => {return item.id === id;});
|
|
||||||
};
|
};
|
||||||
$scope.formCancel = function(){
|
$scope.formCancel = function(){
|
||||||
$state.go('^');
|
$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 CopyMoveGroupsController from './copy-move-groups.controller';
|
||||||
import CopyMoveHostsController from './copy-move-hosts.controller';
|
import CopyMoveHostsController from './copy-move-hosts.controller';
|
||||||
|
import CopyMoveListController from './copy-move-list.controller';
|
||||||
|
|
||||||
var copyMoveGroupRoute = {
|
var copyMoveGroupRoute = {
|
||||||
name: 'inventoryManage.copyMoveGroup',
|
name: 'inventoryManage.copyMoveGroup',
|
||||||
@@ -53,7 +54,8 @@ var copyMoveGroupRoute = {
|
|||||||
input_type: 'radio'
|
input_type: 'radio'
|
||||||
});
|
});
|
||||||
return html;
|
return html;
|
||||||
}
|
},
|
||||||
|
controller: CopyMoveListController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -90,7 +92,8 @@ var copyMoveHostRoute = {
|
|||||||
input_type: 'radio'
|
input_type: 'radio'
|
||||||
});
|
});
|
||||||
return html;
|
return html;
|
||||||
}
|
},
|
||||||
|
controller: CopyMoveListController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user