diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js index c148a02cdf..fe74ff27a0 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js @@ -643,9 +643,21 @@ module.config([ '$routeProvider', function($routeProvider) { group : function(GroupLoader) { return GroupLoader(); } - }, + }, controller : 'GroupDetailCtrl' }) + .when('/realms/:realm/groups/:group/members', { + templateUrl : resourceUrl + '/partials/group-members.html', + resolve : { + realm : function(RealmLoader) { + return RealmLoader(); + }, + group : function(GroupLoader) { + return GroupLoader(); + } + }, + controller : 'GroupMembersCtrl' + }) .when('/realms/:realm/groups/:group/role-mappings', { templateUrl : resourceUrl + '/partials/group-role-mappings.html', resolve : { diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/groups.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/groups.js index 7e82f32b36..4e3b98634c 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/groups.js +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/groups.js @@ -319,3 +319,50 @@ module.controller('GroupRoleMappingCtrl', function($scope, $http, realm, group, }); + +module.controller('GroupMembersCtrl', function($scope, realm, group, GroupMembership) { + $scope.realm = realm; + $scope.page = 0; + + + $scope.query = { + realm: realm.realm, + groupId: group.id, + max : 5, + first : 0 + } + + + $scope.firstPage = function() { + $scope.query.first = 0; + $scope.searchQuery(); + } + + $scope.previousPage = function() { + $scope.query.first -= parseInt($scope.query.max); + if ($scope.query.first < 0) { + $scope.query.first = 0; + } + $scope.searchQuery(); + } + + $scope.nextPage = function() { + $scope.query.first += parseInt($scope.query.max); + $scope.searchQuery(); + } + + $scope.searchQuery = function() { + console.log("query.search: " + $scope.query.search); + $scope.searchLoaded = false; + + $scope.users = GroupMembership.query($scope.query, function() { + console.log('search loaded'); + $scope.searchLoaded = true; + $scope.lastSearch = $scope.query.search; + }); + }; + + $scope.searchQuery(); + +}); + diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/services.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/services.js index c2d8c32b0b..065f831877 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/services.js +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/services.js @@ -1512,6 +1512,14 @@ module.factory('GroupCompositeClientRoleMapping', function($resource) { }); }); +module.factory('GroupMembership', function($resource) { + return $resource(authUrl + '/admin/realms/:realm/groups/:groupId/members', { + realm : '@realm', + groupId : '@groupId' + }); +}); + + module.factory('UserGroupMembership', function($resource) { return $resource(authUrl + '/admin/realms/:realm/users/:userId/groups', { realm : '@realm', diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/group-members.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/group-members.html new file mode 100755 index 0000000000..6c20930275 --- /dev/null +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/group-members.html @@ -0,0 +1,50 @@ +
Username | +Last Name | +First Name | +Actions | +|||
---|---|---|---|---|---|---|
+
+
+
+
+
+ |
+ ||||||
{{user.username}} | +{{user.lastName}} | +{{user.firstName}} | +{{user.email}} | ++ + | +||
No group members | +No group members | +