2017-02-11 20:39:38 -05:00
|
|
|
var connect = require('react-redux').connect;
|
|
|
|
|
|
|
|
var ReportActions = require('../actions/ReportActions');
|
|
|
|
var ReportsTab = require('../components/ReportsTab');
|
|
|
|
|
|
|
|
function mapStateToProps(state) {
|
|
|
|
return {
|
2017-02-17 10:01:31 -05:00
|
|
|
reports: state.reports,
|
|
|
|
selectedReport: state.selectedReport
|
2017-02-11 20:39:38 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function mapDispatchToProps(dispatch) {
|
|
|
|
return {
|
2017-02-17 10:01:31 -05:00
|
|
|
onFetchReport: function(reportname) {dispatch(ReportActions.fetch(reportname))},
|
|
|
|
onSelectReport: function(report, seriesTraversal) {dispatch(ReportActions.select(report, seriesTraversal))}
|
2017-02-11 20:39:38 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = connect(
|
|
|
|
mapStateToProps,
|
|
|
|
mapDispatchToProps
|
|
|
|
)(ReportsTab)
|