Display group name instead of id

This commit is contained in:
Girish Ramakrishnan
2016-09-30 10:35:11 -07:00
parent 93fb01a9b9
commit d62cecff88
2 changed files with 10 additions and 1 deletions

View File

@@ -315,7 +315,11 @@
<span class="text-muted" uib-tooltip="User is not activated yet">{{ user.alternateEmail || user.email }}</span>
</td>
<td class="text-left hand elide-table-cell hidden-xs hidden-sm" ng-click="useredit.show(user)">
<span class="group-badge" ng-repeat="groupId in user.groupIds | ignoreAdminGroup">{{ groupId }}</span>
<span class="group-badge" ng-repeat="groupId in user.groupIds | ignoreAdminGroup">
{{ groupsById[groupId].name }}
</span>
</td>
</td>
<td class="text-right no-wrap" style="vertical-align: bottom">
<button ng-show="!isMe(user)" class="btn btn-xs btn-default" ng-click="sendInvite(user)" title="Send Invite"><i class="fa fa-paper-plane-o"></i></button>

View File

@@ -6,6 +6,7 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
$scope.ready = false;
$scope.users = [];
$scope.groups = [];
$scope.groupsById = { };
$scope.config = Client.getConfig();
$scope.userInfo = Client.getUserInfo();
$scope.mailConfig = {};
@@ -405,6 +406,10 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
if (error) return console.error('Unable to get group listing.', error);
$scope.groups = result;
$scope.groupsById = { };
for (var i = 0; i < result.length; i++) {
$scope.groupsById[result[i].id] = result[i];
}
Client.getUsers(function (error, result) {
if (error) return console.error('Unable to get user listing.', error);