Files
mostlymatter/webapp/components/analytics/team_analytics/index.js
Joram Wilander 1138dd6770 PLT-6657 Move system console to use v4 endpoints and redux (#6572)
* Move system console to use v4 endpoints and redux

* Rename logs dir to get past gitignore

* Fix test email

* Update brand unit test

* Updates per feedback
2017-06-14 08:56:56 -04:00

35 строки
994 B
JavaScript

// 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 {getTeamsList} from 'mattermost-redux/selectors/entities/teams';
import BrowserStore from 'stores/browser_store.jsx';
import TeamAnalytics from './team_analytics.jsx';
const LAST_ANALYTICS_TEAM = 'last_analytics_team';
function mapStateToProps(state, ownProps) {
const teams = getTeamsList(state);
const teamId = BrowserStore.getGlobalItem(LAST_ANALYTICS_TEAM, teams.length > 0 ? teams[0].id : '');
return {
initialTeam: state.entities.teams.teams[teamId],
teams,
...ownProps
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
getTeams
}, dispatch)
};
}
export default connect(mapStateToProps, mapDispatchToProps)(TeamAnalytics);