PLT-6213 Move team store and actions over to use redux (#6222)

* Move team store and actions over to user redux

* Fix JS error when inviting by email
Этот коммит содержится в:
Joram Wilander
2017-04-26 15:49:15 -04:00
коммит произвёл GitHub
родитель 1fef5bf5fe
Коммит 7307156c49
27 изменённых файлов: 387 добавлений и 390 удалений

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

@@ -0,0 +1,24 @@
// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import {getTeams} from 'mattermost-redux/actions/teams';
import TeamAnalytics from './team_analytics.jsx';
function mapStateToProps(state, ownProps) {
return {
...ownProps
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
getTeams
}, dispatch)
};
}
export default connect(mapStateToProps, mapDispatchToProps)(TeamAnalytics);

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

@@ -15,14 +15,20 @@ import * as AsyncClient from 'utils/async_client.jsx';
import {StatTypes} from 'utils/constants.jsx';
import {convertTeamMapToList} from 'utils/team_utils.jsx';
import LineChart from './line_chart.jsx';
import StatisticCount from './statistic_count.jsx';
import TableChart from './table_chart.jsx';
import {formatPostsPerDayData, formatUsersWithPostsPerDayData} from './system_analytics.jsx';
import LineChart from 'components/analytics/line_chart.jsx';
import StatisticCount from 'components/analytics/statistic_count.jsx';
import TableChart from 'components/analytics/table_chart.jsx';
import {formatPostsPerDayData, formatUsersWithPostsPerDayData} from 'components/analytics/system_analytics.jsx';
const LAST_ANALYTICS_TEAM = 'last_analytics_team';
export default class TeamAnalytics extends React.Component {
static propTypes = {
actions: React.PropTypes.shape({
getTeams: React.PropTypes.func.isRequired
}).isRequired
}
constructor(props) {
super(props);
@@ -50,7 +56,7 @@ export default class TeamAnalytics extends React.Component {
}
if (this.state.teams.length === 0) {
AsyncClient.getAllTeams();
this.props.actions.getTeams(0, 1000);
}
}