PLT-6214 Move channel store and actions over to redux (#6235)
* Move channel store and actions over to redux * Fix style errors * Fix unit test * Various fixes * More fixes * Revert config changes
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
302ec17bee
Коммит
96906482ce
@@ -5,6 +5,7 @@ import {connect} from 'react-redux';
|
||||
import {bindActionCreators} from 'redux';
|
||||
import {getUser} from 'mattermost-redux/actions/users';
|
||||
import {getTeamStats} from 'mattermost-redux/actions/teams';
|
||||
import {getChannelStats} from 'mattermost-redux/actions/channels';
|
||||
|
||||
import TeamMembersDropdown from './team_members_dropdown.jsx';
|
||||
|
||||
@@ -18,7 +19,8 @@ function mapDispatchToProps(dispatch) {
|
||||
return {
|
||||
actions: bindActionCreators({
|
||||
getUser,
|
||||
getTeamStats
|
||||
getTeamStats,
|
||||
getChannelStats
|
||||
}, dispatch)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import ChannelStore from 'stores/channel_store.jsx';
|
||||
import {removeUserFromTeam, updateTeamMemberRoles} from 'actions/team_actions.jsx';
|
||||
import {loadMyTeamMembers, updateActive} from 'actions/user_actions.jsx';
|
||||
|
||||
import * as AsyncClient from 'utils/async_client.jsx';
|
||||
import * as Utils from 'utils/utils.jsx';
|
||||
|
||||
import React from 'react';
|
||||
@@ -23,7 +22,8 @@ export default class TeamMembersDropdown extends React.Component {
|
||||
teamMember: React.PropTypes.object.isRequired,
|
||||
actions: React.PropTypes.shape({
|
||||
getUser: React.PropTypes.func.isRequired,
|
||||
getTeamStats: React.PropTypes.func.isRequired
|
||||
getTeamStats: React.PropTypes.func.isRequired,
|
||||
getChannelStats: React.PropTypes.func.isRequired
|
||||
}).isRequired
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ export default class TeamMembersDropdown extends React.Component {
|
||||
handleMakeActive() {
|
||||
updateActive(this.props.user.id, true,
|
||||
() => {
|
||||
AsyncClient.getChannelStats(ChannelStore.getCurrentId());
|
||||
this.props.actions.getChannelStats(ChannelStore.getCurrentId());
|
||||
this.props.actions.getTeamStats(this.props.teamMember.team_id);
|
||||
},
|
||||
(err) => {
|
||||
@@ -100,7 +100,7 @@ export default class TeamMembersDropdown extends React.Component {
|
||||
handleMakeNotActive() {
|
||||
updateActive(this.props.user.id, false,
|
||||
() => {
|
||||
AsyncClient.getChannelStats(ChannelStore.getCurrentId());
|
||||
this.props.actions.getChannelStats(ChannelStore.getCurrentId());
|
||||
this.props.actions.getTeamStats(this.props.teamMember.team_id);
|
||||
},
|
||||
(err) => {
|
||||
|
||||
Ссылка в новой задаче
Block a user