1
0
mirror of https://github.com/bitwarden/web synced 2026-01-02 16:43:24 +00:00

enum filters and org accept state

This commit is contained in:
Kyle Spearrin
2017-03-30 22:06:01 -04:00
parent 2692bbaa63
commit 11002c2881
10 changed files with 102 additions and 35 deletions

View File

@@ -92,35 +92,6 @@
type: list.Data[i].Type
};
switch (user.type) {
case 0:
user.typeName = 'Owner';
break;
case 1:
user.typeName = 'Admin';
break;
case 2:
/* falls through */
default:
user.typeName = 'User';
}
switch (user.status) {
case 0:
user.statusName = 'Invited';
user.statusClass = { 'label-default': true };
break;
case 1:
user.statusName = 'Accepted';
user.statusClass = { 'label-warning': true };
break;
case 2:
/* falls through */
default:
user.statusName = 'Confirmed';
user.statusClass = { 'label-success': true };
}
users.push(user);
}

View File

@@ -32,7 +32,7 @@
<table class="table table-striped table-hover table-vmiddle">
<tbody>
<tr ng-repeat="user in filteredUsers = (users | filter: (filterSearch || '') |
orderBy: ['name', 'email'])">
orderBy: ['type', 'name', 'email'])">
<td style="width: 70px;">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
@@ -66,10 +66,12 @@
<div ng-if="user.name"><small class="text-muted">{{user.name}}</small></div>
</td>
<td style="width: 100px;">
{{user.typeName}}
{{user.type | enumName: 'OrgUserType'}}
</td>
<td style="width: 120px;">
<span class="label" ng-class="{{user.statusClass}}">{{user.statusName}}</span>
<span class="label {{user.status | enumLabelClass: 'OrgUserStatus'}}">
{{user.status | enumName: 'OrgUserStatus'}}
</span>
</td>
</tr>
</tbody>