From 33e08dbaaa2b491545e89c39aa067d469341bde7 Mon Sep 17 00:00:00 2001 From: mabashian Date: Tue, 1 Aug 2017 13:34:55 -0400 Subject: [PATCH] Take the user to a groups groups tab when clicked from a groups list --- .../hosts/related/groups/hosts-related-groups.controller.js | 4 ++++ .../hosts/related/groups/hosts-related-groups.list.js | 2 +- .../inventories/related/groups/groups.list.js | 2 +- .../inventories/related/groups/list/groups-list.controller.js | 3 +++ .../nested-groups/group-nested-groups-list.controller.js | 4 ++++ .../groups/related/nested-groups/group-nested-groups.list.js | 2 +- .../nested-groups/host-nested-groups-list.controller.js | 4 ++++ .../hosts/related/nested-groups/host-nested-groups.list.js | 2 +- 8 files changed, 19 insertions(+), 4 deletions(-) diff --git a/awx/ui/client/src/inventories-hosts/hosts/related/groups/hosts-related-groups.controller.js b/awx/ui/client/src/inventories-hosts/hosts/related/groups/hosts-related-groups.controller.js index f2fe567cd3..6e346c5b4f 100644 --- a/awx/ui/client/src/inventories-hosts/hosts/related/groups/hosts-related-groups.controller.js +++ b/awx/ui/client/src/inventories-hosts/hosts/related/groups/hosts-related-groups.controller.js @@ -56,6 +56,10 @@ $state.go('inventories.edit.groups.edit', {inventory_id: $scope.inventory_id, group_id: id}); }; + $scope.goToGroupGroups = function(id){console.log(); + $state.go('inventories.edit.groups.edit.nested_groups', {inventory_id: $scope.inventory_id, group_id: id}); + }; + $scope.associateGroup = function() { $state.go('.associate', {inventory_id: $scope.inventory_id}); }; diff --git a/awx/ui/client/src/inventories-hosts/hosts/related/groups/hosts-related-groups.list.js b/awx/ui/client/src/inventories-hosts/hosts/related/groups/hosts-related-groups.list.js index 468c38273f..47840e3179 100644 --- a/awx/ui/client/src/inventories-hosts/hosts/related/groups/hosts-related-groups.list.js +++ b/awx/ui/client/src/inventories-hosts/hosts/related/groups/hosts-related-groups.list.js @@ -30,7 +30,7 @@ export default ['i18n', function(i18n) { name: { label: i18n._('Groups'), key: true, - ngClick: "editGroup(group.id)", + ngClick: "goToGroupGroups(group.id)", columnClass: 'col-lg-6 col-md-6 col-sm-6 col-xs-6', class: 'InventoryManage-breakWord', } diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/groups/groups.list.js b/awx/ui/client/src/inventories-hosts/inventories/related/groups/groups.list.js index 2183cea7db..1c71d327cb 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/groups/groups.list.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/groups/groups.list.js @@ -31,7 +31,7 @@ name: { label: i18n._('Groups'), key: true, - ngClick: "editGroup(group.id)", + ngClick: "goToGroupGroups(group.id)", columnClass: 'col-lg-6 col-md-6 col-sm-6 col-xs-6', class: 'InventoryManage-breakWord', } 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 cddd4b276b..2eaffe2ad6 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 @@ -84,6 +84,9 @@ $scope.editGroup = function(id){ $state.go('inventories.edit.groups.edit', {group_id: id}); }; + $scope.goToGroupGroups = function(id){ + $state.go('inventories.edit.groups.edit.nested_groups', {group_id: id}); + }; $scope.deleteGroup = function(group){ $scope.toDelete = {}; angular.extend($scope.toDelete, group); 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 0b645ba12d..b4dcfe8736 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 @@ -128,6 +128,10 @@ $state.go('inventories.edit.groups.edit', {group_id: id}); }; + $scope.goToGroupGroups = function(id){ + $state.go('inventories.edit.groups.edit.nested_groups', {group_id: id}); + }; + var cleanUpStateChangeListener = $rootScope.$on('$stateChangeSuccess', function(event, toState, toParams) { if (toState.name === "inventories.edit.groups.edit.nested_groups.edit") { $scope.rowBeingEdited = toParams.group_id; diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-groups/group-nested-groups.list.js b/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-groups/group-nested-groups.list.js index 2f8b315f68..22f65aac94 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-groups/group-nested-groups.list.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-groups/group-nested-groups.list.js @@ -31,7 +31,7 @@ name: { label: i18n._('Groups'), key: true, - ngClick: "editGroup(nested_group.id)", + ngClick: "goToGroupGroups(nested_group.id)", columnClass: 'col-lg-6 col-md-6 col-sm-6 col-xs-6', class: 'InventoryManage-breakWord', } diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/hosts/related/nested-groups/host-nested-groups-list.controller.js b/awx/ui/client/src/inventories-hosts/inventories/related/hosts/related/nested-groups/host-nested-groups-list.controller.js index 288d86da2c..72a841dc76 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/hosts/related/nested-groups/host-nested-groups-list.controller.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/hosts/related/nested-groups/host-nested-groups-list.controller.js @@ -118,6 +118,10 @@ $state.go('inventories.edit.groups.edit', {group_id: id}); }; + $scope.goToGroupGroups = function(id){ + $state.go('inventories.edit.groups.edit.nested_groups', {group_id: id}); + }; + $scope.setAdhocPattern = function(){ var pattern = _($scope.groupsSelected) .map(function(item){ diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/hosts/related/nested-groups/host-nested-groups.list.js b/awx/ui/client/src/inventories-hosts/inventories/related/hosts/related/nested-groups/host-nested-groups.list.js index 161ed64e03..62bef5d028 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/hosts/related/nested-groups/host-nested-groups.list.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/hosts/related/nested-groups/host-nested-groups.list.js @@ -31,7 +31,7 @@ name: { label: i18n._('Groups'), key: true, - ngClick: "editGroup(nested_group.id)", + ngClick: "goToGroupGroups(nested_group.id)", columnClass: 'col-lg-6 col-md-6 col-sm-6 col-xs-6', class: 'InventoryManage-breakWord', }