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
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
1fef5bf5fe
Коммит
7307156c49
24
webapp/components/analytics/team_analytics/index.js
Обычный файл
24
webapp/components/analytics/team_analytics/index.js
Обычный файл
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user