Skip to content

Commit 8a15d9e

Browse files
author
Dushyant Bhalgami
committed
updates related to the v5 groups-api
1 parent 229c492 commit 8a15d9e

14 files changed

+555
-448
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ The following configuration parameters are available:
3838
| OAUTH2_TOKEN_EXPIRETIME_TAGNAME | OAuth2 token expire time tag name |
3939
| SPIGIT_API_URL | SPIGIT api base url |
4040
|SPIGIT_API_VERSION_PATH | SPIGIT api version path |
41+
|GROUP_V5_API_URL | URL of the v5 Groups API |
4142

4243
## Start the Application
4344

config.json

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"local": {
3-
"API_URL" : "https://127.0.0.1:8443",
4-
"ADMIN_TOOL_URL" : "http://localhost:8080/api/v2",
5-
"API_VERSION_PATH" : "v3",
3+
"API_URL": "https://api.topcoder-dev.com",
4+
"ADMIN_TOOL_URL": "https://api.topcoder-dev.com/v2",
5+
"API_VERSION_PATH": "v3",
66
"COOKIES_SECURE": false,
77
"AUTH_URL": "https://accounts.topcoder-dev.com/member",
88
"ACCOUNTS_CONNECTOR_URL": "https://accounts.topcoder-dev.com/connector.html",
@@ -11,12 +11,13 @@
1111
"OAUTH2_TOKEN_NAME": "oa2spigit",
1212
"OAUTH2_TOKEN_EXPIRETIME_TAGNAME": "oa2expire",
1313
"SPIGIT_API_URL": "spigit.com",
14-
"SPIGIT_API_VERSION_PATH" : "/api/v1"
14+
"SPIGIT_API_VERSION_PATH": "/api/v1",
15+
"GROUP_V5_API_URL": "http://localhost:3000/v5"
1516
},
1617
"dev": {
17-
"API_URL" : "https://api.topcoder-dev.com",
18-
"ADMIN_TOOL_URL" : "https://api.topcoder-dev.com/v2",
19-
"API_VERSION_PATH" : "v3",
18+
"API_URL": "https://api.topcoder-dev.com",
19+
"ADMIN_TOOL_URL": "https://api.topcoder-dev.com/v2",
20+
"API_VERSION_PATH": "v3",
2021
"COOKIES_SECURE": false,
2122
"AUTH_URL": "https://accounts.topcoder-dev.com/member",
2223
"ACCOUNTS_CONNECTOR_URL": "https://accounts.topcoder-dev.com/connector.html",
@@ -25,12 +26,13 @@
2526
"OAUTH2_TOKEN_NAME": "oa2spigit",
2627
"OAUTH2_TOKEN_EXPIRETIME_TAGNAME": "oa2expire",
2728
"SPIGIT_API_URL": "spigit.com",
28-
"SPIGIT_API_VERSION_PATH" : "/api/v1"
29+
"SPIGIT_API_VERSION_PATH": "/api/v1",
30+
"GROUP_V5_API_URL": "https://api.topcoder-dev.com/v5"
2931
},
3032
"qa": {
31-
"API_URL" : "https://api.topcoder-qa.com",
32-
"ADMIN_TOOL_URL" : "https://api.topcoder-qa.com/v2",
33-
"API_VERSION_PATH" : "v3",
33+
"API_URL": "https://api.topcoder-qa.com",
34+
"ADMIN_TOOL_URL": "https://api.topcoder-qa.com/v2",
35+
"API_VERSION_PATH": "v3",
3436
"COOKIES_SECURE": false,
3537
"AUTH_URL": "https://accounts.topcoder-qa.com/member",
3638
"ACCOUNTS_CONNECTOR_URL": "https://accounts.topcoder-qa.com/connector.html",
@@ -39,12 +41,13 @@
3941
"OAUTH2_TOKEN_NAME": "oa2spigit",
4042
"OAUTH2_TOKEN_EXPIRETIME_TAGNAME": "oa2expire",
4143
"SPIGIT_API_URL": "spigit.com",
42-
"SPIGIT_API_VERSION_PATH" : "/api/v1"
44+
"SPIGIT_API_VERSION_PATH": "/api/v1",
45+
"GROUP_V5_API_URL": "http://localhost:9000"
4346
},
4447
"prod": {
45-
"API_URL" : "https://api.topcoder.com",
46-
"ADMIN_TOOL_URL" : "https://api.topcoder.com/v2",
47-
"API_VERSION_PATH" : "v3",
48+
"API_URL": "https://api.topcoder.com",
49+
"ADMIN_TOOL_URL": "https://api.topcoder.com/v2",
50+
"API_VERSION_PATH": "v3",
4851
"COOKIES_SECURE": false,
4952
"AUTH_URL": "https://accounts.topcoder.com/member",
5053
"ACCOUNTS_CONNECTOR_URL": "https://accounts.topcoder.com/connector.html",
@@ -53,6 +56,7 @@
5356
"OAUTH2_TOKEN_NAME": "oa2spigit",
5457
"OAUTH2_TOKEN_EXPIRETIME_TAGNAME": "oa2expire",
5558
"SPIGIT_API_URL": "spigit.com",
56-
"SPIGIT_API_VERSION_PATH" : "/api/v1"
59+
"SPIGIT_API_VERSION_PATH": "/api/v1",
60+
"GROUP_V5_API_URL": "http://localhost:9000"
5761
}
5862
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"angular-storage": "~0.0.11",
1616
"angular-touch": "~1.4.4",
1717
"angular-ui-bootstrap": "~2.5.0",
18-
"angular-ui-router": "~0.2.13",
18+
"@uirouter/angularjs": "~0.2.13",
1919
"auth0-angular": "~4.0.4",
2020
"auth0-js": "~6.4.2",
2121
"auth0-lock": "~7.6.2",

src/app/groupmembers/groupmembers.list.controller.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ module.controller('permissionmanagement.GroupMembersListController', [
6565
};
6666
});
6767

68+
// used to get all groups
69+
$scope.page = 1;
70+
$scope.perPage = 1000;
71+
6872
/**
6973
* Return membership records which are selected in the table by checkboxes
7074
*
@@ -89,9 +93,9 @@ module.controller('permissionmanagement.GroupMembersListController', [
8993
$scope.isLoading[memberType] = true;
9094
});
9195

92-
GroupMemberService.fetch(groupId).then(function(data) {
96+
GroupMemberService.fetch(groupId, {page: $scope.page, perPage: $scope.perPage}).then(function(data) {
9397
$scope.memberTypes.forEach(function(memberType) {
94-
$scope.memberships[memberType] = data.content.filter(function(membership) { return membership.membershipType === memberType });
98+
$scope.memberships[memberType] = data.filter(function(membership) { return membership.membershipType === memberType });
9599
allMemberships[memberType] = _.clone($scope.memberships[memberType]);
96100
$scope.memberships[memberType].forEach(function(membership) {
97101
loadUser(membership.createdBy);
@@ -152,7 +156,7 @@ module.controller('permissionmanagement.GroupMembersListController', [
152156
*/
153157
$scope.removeMember = function(membership) {
154158
membership.isRemoving = true;
155-
return GroupMemberService.removeMember($stateParams.groupId, membership.id).then(function() {
159+
return GroupMemberService.removeMember($stateParams.groupId, membership.memberId).then(function() {
156160
$scope.memberships[membership.membershipType] = $scope.memberships[membership.membershipType].filter(function(record) {
157161
return record.id !== membership.id;
158162
});
@@ -273,8 +277,8 @@ module.controller('permissionmanagement.GroupMembersListController', [
273277
*/
274278
function getGroupIdsFilteredByName(groupName, valueType) {
275279
if (!groupIdsByNamePromise) {
276-
groupIdsByNamePromise = GroupService.fetch().then(function(data) {
277-
return data.content;
280+
groupIdsByNamePromise = GroupService.fetch({page: $scope.page, perPage: $scope.perPage}).then(function(data) {
281+
return data;
278282
});
279283
}
280284

src/app/groupmembers/groupmembers.list.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,14 @@ <h2>{{memberType === 'user' ? 'Users' : 'Groups'}}</h2>
148148
</td>
149149
</tr>
150150
</tbody>
151+
152+
<tfoot>
153+
<tr>
154+
<td colspan="12">
155+
<ul class="pagination pull-right"></ul>
156+
</td>
157+
</tr>
158+
</tfoot>
151159
</table>
152160
</div>
153161
<!-- table-responsive -->

0 commit comments

Comments
 (0)