summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Abashian <mabashian@users.noreply.github.com>2017-07-27 14:54:40 +0200
committerGitHub <noreply@github.com>2017-07-27 14:54:40 +0200
commitfde3e41042c220a9aeff8136e990cd460872b028 (patch)
treed057b0cadddcd66a98c13809e4e25a9e11774a7c
parentMerge pull request #74 from mabashian/7299-pmrun (diff)
parentMaintain selected host/group rows on pagination and search changes (diff)
downloadawx-fde3e41042c220a9aeff8136e990cd460872b028.tar.xz
awx-fde3e41042c220a9aeff8136e990cd460872b028.zip
Merge pull request #78 from mabashian/7266-run-commands
Maintain selected host/group rows on pagination and search changes
-rw-r--r--awx/ui/client/src/inventories-hosts/inventories/related/groups/list/groups-list.controller.js10
-rw-r--r--awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-groups/group-nested-groups-list.controller.js10
-rw-r--r--awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts-list.controller.js5
-rw-r--r--awx/ui/client/src/inventories-hosts/inventories/related/hosts/list/host-list.controller.js5
4 files changed, 26 insertions, 4 deletions
diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/groups/list/groups-list.controller.js b/awx/ui/client/src/inventories-hosts/inventories/related/groups/list/groups-list.controller.js
index 78a0969009..cddd4b276b 100644
--- a/awx/ui/client/src/inventories-hosts/inventories/related/groups/list/groups-list.controller.js
+++ b/awx/ui/client/src/inventories-hosts/inventories/related/groups/list/groups-list.controller.js
@@ -33,7 +33,7 @@
$scope.inventory_id = $stateParams.inventory_id;
$scope.$watchCollection(list.name, function(){
- _.forEach($scope[list.name], buildStatusIndicators);
+ _.forEach($scope[list.name], processRow);
});
$scope.$on('selectedOrDeselected', function(e, value) {
@@ -54,11 +54,17 @@
}
- function buildStatusIndicators(group){
+ function processRow(group){
if (group === undefined || group === null) {
group = {};
}
+ angular.forEach($scope.groupsSelected, function(selectedGroup){
+ if(selectedGroup.id === group.id) {
+ group.isSelected = true;
+ }
+ });
+
let hosts_status;
hosts_status = GetHostsStatusMsg({
diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-groups/group-nested-groups-list.controller.js b/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-groups/group-nested-groups-list.controller.js
index d5e5c39ffb..0b645ba12d 100644
--- a/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-groups/group-nested-groups-list.controller.js
+++ b/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-groups/group-nested-groups-list.controller.js
@@ -34,7 +34,7 @@
$scope.inventory_id = $stateParams.inventory_id;
$scope.$watchCollection(list.name, function(){
- _.forEach($scope[list.name], buildStatusIndicators);
+ _.forEach($scope[list.name], processRow);
});
$scope.$on('selectedOrDeselected', function(e, value) {
@@ -55,11 +55,17 @@
}
- function buildStatusIndicators(group){
+ function processRow(group){
if (group === undefined || group === null) {
group = {};
}
+ angular.forEach($scope.groupsSelected, function(selectedGroup){
+ if(selectedGroup.id === group.id) {
+ group.isSelected = true;
+ }
+ });
+
let hosts_status;
hosts_status = GetHostsStatusMsg({
diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts-list.controller.js b/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts-list.controller.js
index a4e449f88b..a6adaad5a2 100644
--- a/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts-list.controller.js
+++ b/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts-list.controller.js
@@ -34,6 +34,11 @@ export default ['$scope', 'NestedHostsListDefinition', '$rootScope', 'GetBasePat
value.can_disassociate = true;
}
});
+ angular.forEach($scope.hostsSelected, function(selectedHost){
+ if(selectedHost.id === value.id) {
+ value.isSelected = true;
+ }
+ });
return value;
});
setJobStatus();
diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/hosts/list/host-list.controller.js b/awx/ui/client/src/inventories-hosts/inventories/related/hosts/list/host-list.controller.js
index d1dfbbaac1..7f51502a20 100644
--- a/awx/ui/client/src/inventories-hosts/inventories/related/hosts/list/host-list.controller.js
+++ b/awx/ui/client/src/inventories-hosts/inventories/related/hosts/list/host-list.controller.js
@@ -31,6 +31,11 @@ export default ['$scope', 'ListDefinition', '$rootScope', 'GetBasePath',
$scope[list.name] = _.map($scope.hosts, function(value) {
value.inventory_name = value.summary_fields.inventory.name;
value.inventory_id = value.summary_fields.inventory.id;
+ angular.forEach($scope.hostsSelected, function(selectedHost){
+ if(selectedHost.id === value.id) {
+ value.isSelected = true;
+ }
+ });
return value;
});
setJobStatus();