Add email invite support
This commit is contained in:
parent
3b72b26836
commit
4a2a4d1b4c
3 changed files with 17 additions and 4 deletions
|
@ -4654,6 +4654,11 @@ i.quay-icon {
|
|||
display: inline-block;
|
||||
}
|
||||
|
||||
.member-listing .invite-listing {
|
||||
margin-bottom: 10px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.team-view .organization-header .popover {
|
||||
max-width: none !important;
|
||||
}
|
||||
|
|
|
@ -2288,7 +2288,9 @@ function TeamViewCtrl($rootScope, $scope, Restangular, ApiService, $routeParams)
|
|||
|
||||
$scope.filterFunction = function(invited, robots) {
|
||||
return function(item) {
|
||||
return item.is_robot == robots && item.invited == invited;
|
||||
// Note: The !! is needed because is_robot will be undefined for invites.
|
||||
var robot_check = (!!item.is_robot == robots);
|
||||
return robot_check && item.invited == invited;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -2309,7 +2311,7 @@ function TeamViewCtrl($rootScope, $scope, Restangular, ApiService, $routeParams)
|
|||
|
||||
ApiService.inviteTeamMemberEmail(null, params).then(function(resp) {
|
||||
$scope.members.push(resp);
|
||||
$scope.memberMap[resp.name] = resp;
|
||||
$scope.memberMap[resp.email] = resp;
|
||||
$scope.addingMember = false;
|
||||
}, errorHandler);
|
||||
};
|
||||
|
@ -2401,7 +2403,7 @@ function TeamViewCtrl($rootScope, $scope, Restangular, ApiService, $routeParams)
|
|||
$scope.memberMap = {};
|
||||
for (var i = 0; i < $scope.members.length; ++i) {
|
||||
var current = $scope.members[i];
|
||||
$scope.memberMap[current.name] = current;
|
||||
$scope.memberMap[current.name || current.email] = current;
|
||||
}
|
||||
|
||||
return resp.members;
|
||||
|
|
|
@ -65,7 +65,13 @@
|
|||
|
||||
<tr ng-repeat="member in members | filter:search | filter: filterFunction(true, false) | orderBy: 'name'">
|
||||
<td class="user entity">
|
||||
<span ng-if="member.kind != 'invite'">
|
||||
<span class="entity-reference" entity="member" namespace="organization.name" show-gravatar="true" gravatar-size="32"></span>
|
||||
</span>
|
||||
<span class="invite-listing" ng-if="member.kind == 'invite'">
|
||||
<img class="gravatar"ng-src="//www.gravatar.com/avatar/{{ member.gravatar }}?s=32&d=identicon">
|
||||
{{ member.email }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
|
|
Reference in a new issue