1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2024-11-14 10:50:04 -05:00
moneygo/js/containers/AccountsTabContainer.js

49 lines
2.3 KiB
JavaScript
Raw Normal View History

2016-10-05 13:36:47 -04:00
var connect = require('react-redux').connect;
var SecurityActions = require('../actions/SecurityActions');
2016-10-05 13:36:47 -04:00
var AccountActions = require('../actions/AccountActions');
2017-05-24 19:47:18 -04:00
var TransactionActions = require('../actions/TransactionActions');
2017-06-04 16:01:42 -04:00
var ImportActions = require('../actions/ImportActions');
2017-05-22 20:36:36 -04:00
var AccountsTab = require('../components/AccountsTab');
2016-10-05 13:36:47 -04:00
function mapStateToProps(state) {
return {
accounts: state.accounts.map,
accountChildren: state.accounts.children,
securities: state.securities.map,
security_list: state.securities.list,
2017-05-22 20:36:36 -04:00
selectedAccount: state.selectedAccount,
2017-05-24 19:47:18 -04:00
transactions: state.transactions,
2017-06-04 16:01:42 -04:00
transactionPage: state.transactionPage,
imports: state.imports
2016-10-05 13:36:47 -04:00
}
}
function mapDispatchToProps(dispatch) {
return {
2017-06-04 16:01:42 -04:00
onFetchAllAccounts: function() {dispatch(AccountActions.fetchAll())},
2016-10-05 13:36:47 -04:00
onCreateAccount: function(account) {dispatch(AccountActions.create(account))},
onUpdateAccount: function(account) {dispatch(AccountActions.update(account))},
2017-05-24 19:47:18 -04:00
onDeleteAccount: function(account) {dispatch(AccountActions.remove(account))},
2017-05-22 20:36:36 -04:00
onSelectAccount: function(accountId) {dispatch(AccountActions.select(accountId))},
onFetchAllSecurities: function() {dispatch(SecurityActions.fetchAll())},
2017-05-24 19:47:18 -04:00
onCreateTransaction: function(transaction) {dispatch(TransactionActions.create(transaction))},
onUpdateTransaction: function(transaction) {dispatch(TransactionActions.update(transaction))},
onDeleteTransaction: function(transaction) {dispatch(TransactionActions.remove(transaction))},
onSelectTransaction: function(transactionId) {dispatch(TransactionActions.select(transactionId))},
onUnselectTransaction: function() {dispatch(TransactionActions.unselect())},
onFetchTransactionPage: function(account, pageSize, page) {dispatch(TransactionActions.fetchPage(account, pageSize, page))},
2017-06-04 16:01:42 -04:00
onOpenImportModal: function() {dispatch(ImportActions.openModal())},
onCloseImportModal: function() {dispatch(ImportActions.closeModal())},
onImportOFX: function(account, password, startDate, endDate) {dispatch(ImportActions.importOFX(account, password, startDate, endDate))},
onImportOFXFile: function(inputElement, account) {dispatch(ImportActions.importOFXFile(inputElement, account))},
onImportGnucash: function(inputElement) {dispatch(ImportActions.importGnucash(inputElement))},
2016-10-05 13:36:47 -04:00
}
}
module.exports = connect(
mapStateToProps,
mapDispatchToProps
)(AccountsTab)