All files / report index.js

100% Statements 15/15
100% Branches 0/0
100% Functions 13/13
100% Lines 15/15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35              1x 1x         12x     11x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x              
import { connect } from 'react-redux';
import store from '@bufferapp/analyze-store';
import { addMiddleware } from 'redux-dynamic-middlewares';
import Report from './components/Report';
import reducer, { actions } from './reducer';
import middleware from './middleware';
 
store.injectReducer('report', reducer);
addMiddleware(middleware);
 
 
// default export = container
export default connect(
  state => ({
    ...state.report,
  }),
  dispatch => ({
    fetch: () => dispatch(actions.fetch()),
    editName: () => dispatch(actions.editName()),
    saveChanges: name => dispatch(actions.saveChanges({ name })),
    moveUp: id => dispatch(actions.moveUp(id)),
    moveDown: id => dispatch(actions.moveDown(id)),
    deleteChart: id => dispatch(actions.deleteChart(id)),
    parsePageBreaks: () => dispatch(actions.parsePageBreaks()),
    uploadLogo: logo => dispatch(actions.uploadLogo({ logo })),
    deleteLogo: () => dispatch(actions.deleteLogo()),
    editDescription: () => dispatch(actions.editDescription()),
    saveDescription: description => dispatch(actions.saveDescription({ description })),
  }),
)(Report);
 
// export reducer, actions and action types
export reducer, { actions, actionTypes } from './reducer';
export middleware from './middleware';