summaryrefslogtreecommitdiffstats
path: root/webapp/components/select_team
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/select_team
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/select_team')
-rw-r--r--webapp/components/select_team/index.js24
-rw-r--r--webapp/components/select_team/select_team.jsx8
2 files changed, 30 insertions, 2 deletions
diff --git a/webapp/components/select_team/index.js b/webapp/components/select_team/index.js
new file mode 100644
index 000000000..87691a853
--- /dev/null
+++ b/webapp/components/select_team/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 SelectTeam from './select_team.jsx';
+
+function mapStateToProps(state, ownProps) {
+ return {
+ ...ownProps
+ };
+}
+
+function mapDispatchToProps(dispatch) {
+ return {
+ actions: bindActionCreators({
+ getTeams
+ }, dispatch)
+ };
+}
+
+export default connect(mapStateToProps, mapDispatchToProps)(SelectTeam);
diff --git a/webapp/components/select_team/select_team.jsx b/webapp/components/select_team/select_team.jsx
index 43472bdad..e6179a2fd 100644
--- a/webapp/components/select_team/select_team.jsx
+++ b/webapp/components/select_team/select_team.jsx
@@ -7,7 +7,6 @@ import * as UserAgent from 'utils/user_agent.jsx';
import * as Utils from 'utils/utils.jsx';
import ErrorBar from 'components/error_bar.jsx';
import LoadingScreen from 'components/loading_screen.jsx';
-import * as AsyncClient from 'utils/async_client.jsx';
import * as GlobalActions from 'actions/global_actions.jsx';
import SelectTeamItem from './components/select_team_item.jsx';
@@ -19,6 +18,11 @@ import React from 'react';
import logoImage from 'images/logo.png';
export default class SelectTeam extends React.Component {
+ static propTypes = {
+ actions: React.PropTypes.shape({
+ getTeams: React.PropTypes.func.isRequired
+ }).isRequired
+ }
constructor(props) {
super(props);
@@ -33,7 +37,7 @@ export default class SelectTeam extends React.Component {
componentDidMount() {
TeamStore.addChangeListener(this.onTeamChange);
- AsyncClient.getAllTeamListings();
+ this.props.actions.getTeams(0, 200);
}
componentWillUnmount() {