diff options
Diffstat (limited to 'webapp/components/admin_console/system_users')
-rw-r--r-- | webapp/components/admin_console/system_users/index.js | 27 | ||||
-rw-r--r-- | webapp/components/admin_console/system_users/system_users.jsx | 16 |
2 files changed, 39 insertions, 4 deletions
diff --git a/webapp/components/admin_console/system_users/index.js b/webapp/components/admin_console/system_users/index.js new file mode 100644 index 000000000..24144d701 --- /dev/null +++ b/webapp/components/admin_console/system_users/index.js @@ -0,0 +1,27 @@ +// 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, getTeamStats} from 'mattermost-redux/actions/teams'; +import {getUser} from 'mattermost-redux/actions/users'; + +import SystemUsers from './system_users.jsx'; + +function mapStateToProps(state, ownProps) { + return { + ...ownProps + }; +} + +function mapDispatchToProps(dispatch) { + return { + actions: bindActionCreators({ + getTeams, + getTeamStats, + getUser + }, dispatch) + }; +} + +export default connect(mapStateToProps, mapDispatchToProps)(SystemUsers); diff --git a/webapp/components/admin_console/system_users/system_users.jsx b/webapp/components/admin_console/system_users/system_users.jsx index 7bc4b81ed..29fcd634b 100644 --- a/webapp/components/admin_console/system_users/system_users.jsx +++ b/webapp/components/admin_console/system_users/system_users.jsx @@ -16,7 +16,7 @@ import AnalyticsStore from 'stores/analytics_store.jsx'; import TeamStore from 'stores/team_store.jsx'; import UserStore from 'stores/user_store.jsx'; -import {getAllTeams, getStandardAnalytics, getTeamStats, getUser} from 'utils/async_client.jsx'; +import {getStandardAnalytics} from 'utils/async_client.jsx'; import {Constants, StatTypes, UserSearchOptions} from 'utils/constants.jsx'; import {convertTeamMapToList} from 'utils/team_utils.jsx'; import * as Utils from 'utils/utils.jsx'; @@ -33,6 +33,14 @@ const USER_ID_LENGTH = 26; const USERS_PER_PAGE = 50; export default class SystemUsers extends React.Component { + static propTypes = { + actions: React.PropTypes.shape({ + getTeams: React.PropTypes.func.isRequired, + getTeamStats: React.PropTypes.func.isRequired, + getUser: React.PropTypes.func.isRequired + }).isRequired + } + constructor(props) { super(props); @@ -76,7 +84,7 @@ export default class SystemUsers extends React.Component { UserStore.addWithoutTeamChangeListener(this.updateUsersFromStore); this.loadDataForTeam(this.state.teamId); - getAllTeams(); + this.props.actions.getTeams(0, 1000); } componentWillUpdate(nextProps, nextState) { @@ -155,7 +163,7 @@ export default class SystemUsers extends React.Component { loadProfilesWithoutTeam(0, Constants.PROFILE_CHUNK_SIZE, this.loadComplete); } else { loadProfilesAndTeamMembers(0, Constants.PROFILE_CHUNK_SIZE, teamId, this.loadComplete); - getTeamStats(teamId); + this.props.actions.getTeamStats(teamId); } } @@ -240,7 +248,7 @@ export default class SystemUsers extends React.Component { return; } - getUser( + this.props.actions.getUser( id, () => { this.setState({ |