PLT-2863 adding remove user from team (#3429)

* PLT-2863 adding remove user from team

* PLT-2863 adding the client side UI

* Fixing trailing space

* Fixing reported issues

* Adding documentatino

* Switching to final javascript driver
Этот коммит содержится в:
Corey Hulen
2016-07-06 13:40:59 -08:00
коммит произвёл GitHub
родитель 3eee51f74e
Коммит d5f243dad6
24 изменённых файлов: 572 добавлений и 19 удалений

Просмотреть файл

@@ -288,6 +288,13 @@ export function showInviteMemberModal() {
});
}
export function showLeaveTeamModal() {
AppDispatcher.handleViewAction({
type: ActionTypes.TOGGLE_LEAVE_TEAM_MODAL,
value: true
});
}
export function showRegisterAppModal() {
AppDispatcher.handleViewAction({
type: ActionTypes.TOGGLE_REGISTER_APP_MODAL,

Просмотреть файл

@@ -135,6 +135,10 @@ function handleMessage(msg) {
handleNewUserEvent();
break;
case SocketEvents.LEAVE_TEAM:
handleLeaveTeamEvent(msg);
break;
case SocketEvents.USER_ADDED:
handleUserAddedEvent(msg);
break;
@@ -219,6 +223,19 @@ function handleNewUserEvent() {
AsyncClient.getChannelExtraInfo();
}
function handleLeaveTeamEvent(msg) {
if (UserStore.getCurrentId() === msg.user_id) {
TeamStore.removeTeamMember(msg.team_id);
// if the are on the team begin removed redirect them to the root
if (TeamStore.getCurrentId() === msg.team_id) {
browserHistory.push('/');
}
} else if (TeamStore.getCurrentId() === msg.team_id) {
GlobalActions.emitProfilesForDmList();
}
}
function handleDirectAddedEvent(msg) {
AsyncClient.getChannel(msg.channel_id);
AsyncClient.getDirectProfiles();