Add statuses to profiles pictures and remove from header in DMs (#3940)

Этот коммит содержится в:
Joram Wilander
2016-09-06 09:56:46 -04:00
коммит произвёл Harrison Healey
родитель a44a5aadf1
Коммит c201ef1775
2 изменённых файлов: 3 добавлений и 31 удалений

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

@@ -15,7 +15,6 @@ import ChannelNotificationsModal from './channel_notifications_modal.jsx';
import DeleteChannelModal from './delete_channel_modal.jsx';
import RenameChannelModal from './rename_channel_modal.jsx';
import ToggleModalButton from './toggle_modal_button.jsx';
import StatusIcon from './status_icon.jsx';
import ChannelStore from 'stores/channel_store.jsx';
import UserStore from 'stores/user_store.jsx';
@@ -31,7 +30,6 @@ import * as AsyncClient from 'utils/async_client.jsx';
import {getFlaggedPosts} from 'actions/post_actions.jsx';
import Constants from 'utils/constants.jsx';
const UserStatuses = Constants.UserStatuses;
const ActionTypes = Constants.ActionTypes;
import React from 'react';
@@ -87,7 +85,6 @@ export default class ChannelHeader extends React.Component {
SearchStore.addSearchChangeListener(this.onListenerChange);
PreferenceStore.addChangeListener(this.onListenerChange);
UserStore.addChangeListener(this.onListenerChange);
UserStore.addStatusesChangeListener(this.onListenerChange);
$('.sidebar--left .dropdown-menu').perfectScrollbar();
document.addEventListener('keydown', this.openRecentMentions);
}
@@ -98,7 +95,6 @@ export default class ChannelHeader extends React.Component {
SearchStore.removeSearchChangeListener(this.onListenerChange);
PreferenceStore.removeChangeListener(this.onListenerChange);
UserStore.removeChangeListener(this.onListenerChange);
UserStore.removeStatusesChangeListener(this.onListenerChange);
document.removeEventListener('keydown', this.openRecentMentions);
}
@@ -184,21 +180,6 @@ export default class ChannelHeader extends React.Component {
});
}
getTeammateStatus() {
const channel = this.state.channel;
// get status for direct message channels
if (channel.type === 'D') {
const currentUserId = this.state.currentUser.id;
const teammate = this.state.users.find((user) => user.id !== currentUserId);
if (teammate) {
return UserStore.getStatus(teammate.id);
}
return UserStatuses.OFFLINE;
}
return null;
}
showManagementOptions(channel, isAdmin, isSystemAdmin) {
if (global.window.mm_license.IsLicensed !== 'true') {
return true;
@@ -562,7 +543,7 @@ export default class ChannelHeader extends React.Component {
data-toggle='dropdown'
aria-expanded='true'
>
<strong className='heading'><StatusIcon status={this.getTeammateStatus()}/>{channelTitle} </strong>
<strong className='heading'>{channelTitle} </strong>
<span className='fa fa-chevron-down header-dropdown__icon'/>
</a>
<ul