Better UX for managing teams

- Moves the add team member to an inline box, rather than a popup
- Feedback bar is now used to show when a member is added, invited or removed
- Fixes bugs around using the view on mobile

Fixes #1509
This commit is contained in:
Joseph Schorr 2016-09-15 16:06:56 -04:00
parent 949ceae4eb
commit b272771147
6 changed files with 69 additions and 51 deletions

View file

@ -19,6 +19,7 @@
$scope.addingMember = false;
$scope.memberMap = null;
$scope.allowEmail = Features.MAILING;
$scope.feedback = null;
$rootScope.title = 'Loading...';
@ -49,6 +50,14 @@
$scope.members.push(resp);
$scope.memberMap[resp.email] = resp;
$scope.addingMember = false;
$scope.feedback = {
'kind': 'success',
'message': 'E-mail address {email} was invited to join the team',
'data': {
'email': email
}
};
}, errorHandler);
};
@ -70,6 +79,14 @@
$scope.members.push(resp);
$scope.memberMap[resp.name] = resp;
$scope.addingMember = false;
$scope.feedback = {
'kind': 'success',
'message': 'User {username} was added to the team',
'data': {
'username': member.name
}
};
}, errorHandler);
};
@ -95,6 +112,14 @@
var index = $.inArray($scope.memberMap[email], $scope.members);
$scope.members.splice(index, 1);
delete $scope.memberMap[email];
$scope.feedback = {
'kind': 'success',
'message': 'Invitation to e-amil address {email} was revoked',
'data': {
'email': email
}
};
}, ApiService.errorDisplay('Cannot revoke team invite'));
};
@ -110,6 +135,14 @@
var index = $.inArray($scope.memberMap[username], $scope.members);
$scope.members.splice(index, 1);
delete $scope.memberMap[username];
$scope.feedback = {
'kind': 'success',
'message': 'User {username} was removed from the team',
'data': {
'username': username
}
};
}, ApiService.errorDisplay('Cannot remove team member'));
};
@ -123,6 +156,11 @@
var teaminfo = $scope.organization.teams[teamname];
ApiService.updateOrganizationTeam(teaminfo, params).then(function(resp) {
$scope.feedback = {
'kind': 'success',
'message': 'Team description changed',
'data': {}
};
}, function() {
$('#cannotChangeTeamModal').modal({});
});