summaryrefslogtreecommitdiffstats
path: root/webapp/components/analytics
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-04-26 15:49:15 -0400
committerGitHub <noreply@github.com>2017-04-26 15:49:15 -0400
commit7307156c49b194c4afd946cd9e57715d45b5b21d (patch)
tree1601a0026859ff40e631b4aee9632b022ed6f40f /webapp/components/analytics
parent1fef5bf5fe37f161959fbef5d53deccf0168cced (diff)
downloadchat-7307156c49b194c4afd946cd9e57715d45b5b21d.tar.gz
chat-7307156c49b194c4afd946cd9e57715d45b5b21d.tar.bz2
chat-7307156c49b194c4afd946cd9e57715d45b5b21d.zip
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
Diffstat (limited to 'webapp/components/analytics')
-rw-r--r--webapp/components/analytics/team_analytics/index.js24
-rw-r--r--webapp/components/analytics/team_analytics/team_analytics.jsx (renamed from webapp/components/analytics/team_analytics.jsx)16
2 files changed, 35 insertions, 5 deletions
diff --git a/webapp/components/analytics/team_analytics/index.js b/webapp/components/analytics/team_analytics/index.js
new file mode 100644
index 000000000..270967a1b
--- /dev/null
+++ b/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);
diff --git a/webapp/components/analytics/team_analytics.jsx b/webapp/components/analytics/team_analytics/team_analytics.jsx
index 700dc5a10..828f29f51 100644
--- a/webapp/components/analytics/team_analytics.jsx
+++ b/webapp/components/analytics/team_analytics/team_analytics.jsx
@@ -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);
}
}