+ client: handle the new statistics format

This commit is contained in:
Ildar Kamalov
2019-08-22 16:10:47 +03:00
parent 011bc3e36b
commit 6b2496d050
22 changed files with 563 additions and 488 deletions

View File

@@ -1,20 +1,22 @@
import { connect } from 'react-redux';
import { getClients, getTopStats } from '../actions';
import { getClients } from '../actions';
import { getStats } from '../actions/stats';
import { addClient, updateClient, deleteClient, toggleClientModal } from '../actions/clients';
import Clients from '../components/Settings/Clients';
const mapStateToProps = (state) => {
const { dashboard, clients } = state;
const { dashboard, clients, stats } = state;
const props = {
dashboard,
clients,
stats,
};
return props;
};
const mapDispatchToProps = {
getClients,
getTopStats,
getStats,
addClient,
updateClient,
deleteClient,

View File

@@ -1,14 +1,23 @@
import { connect } from 'react-redux';
import * as actionCreators from '../actions';
import { toggleProtection, getClients } from '../actions';
import { getStats, getStatsConfig, setStatsConfig } from '../actions/stats';
import Dashboard from '../components/Dashboard';
const mapStateToProps = (state) => {
const { dashboard } = state;
const props = { dashboard };
const { dashboard, stats } = state;
const props = { dashboard, stats };
return props;
};
const mapDispatchToProps = {
toggleProtection,
getClients,
getStats,
getStatsConfig,
setStatsConfig,
};
export default connect(
mapStateToProps,
actionCreators,
mapDispatchToProps,
)(Dashboard);