Add email invite support
This commit is contained in:
parent
3b72b26836
commit
4a2a4d1b4c
3 changed files with 17 additions and 4 deletions
|
@ -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;
|
||||
|
|
Reference in a new issue