Skip to content

Commit

Permalink
Adding opening balance; Calculating account currentBalance
Browse files Browse the repository at this point in the history
  • Loading branch information
JackNeto committed Dec 30, 2018
1 parent 3033331 commit 3369738
Show file tree
Hide file tree
Showing 30 changed files with 388 additions and 498 deletions.
80 changes: 11 additions & 69 deletions src/common/Header/__tests__/__snapshots__/index.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -26,82 +26,24 @@ exports[`Header matches snapshot 1`] = `
Entaxy
</a>
</div>
<div>
<a
aria-current={null}
className="MuiButtonBase-root-108 MuiButton-root-82 MuiButton-text-84 MuiButton-flat-87 MuiButton-sizeSmall-105 MuiButton-colorInherit-103"
href="/portfolio"
onBlur={[Function]}
onClick={[Function]}
onContextMenu={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
onMouseDown={[Function]}
onMouseLeave={[Function]}
onMouseUp={[Function]}
onTouchEnd={[Function]}
onTouchMove={[Function]}
onTouchStart={[Function]}
role="button"
tabIndex="0"
>
<span
className="MuiButton-label-83"
>
Portfolio
</span>
<span
className="MuiTouchRipple-root-162"
/>
</a>
<a
aria-current={null}
className="MuiButtonBase-root-108 MuiButton-root-82 MuiButton-text-84 MuiButton-flat-87 MuiButton-sizeSmall-105 MuiButton-colorInherit-103"
href="/import-transactions"
onBlur={[Function]}
onClick={[Function]}
onContextMenu={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
onMouseDown={[Function]}
onMouseLeave={[Function]}
onMouseUp={[Function]}
onTouchEnd={[Function]}
onTouchMove={[Function]}
onTouchStart={[Function]}
role="button"
tabIndex="0"
>
<span
className="MuiButton-label-83"
>
Import Transactions
</span>
<span
className="MuiTouchRipple-root-162"
/>
</a>
</div>
<LoginButton />
</div>
</header>
<div
className="MuiDrawer-root-113 MuiDrawer-docked-114"
className="MuiDrawer-root-84 MuiDrawer-docked-85"
>
<div
className="MuiPaper-root-13 MuiPaper-elevation0-15 MuiDrawer-paper-115 withRouter-LeftDrawer--drawerPaper-112 MuiDrawer-paperAnchorLeft-116 MuiDrawer-paperAnchorDockedLeft-120"
className="MuiPaper-root-13 MuiPaper-elevation0-15 MuiDrawer-paper-86 withRouter-LeftDrawer--drawerPaper-83 MuiDrawer-paperAnchorLeft-87 MuiDrawer-paperAnchorDockedLeft-91"
>
<div
className="withRouter-LeftDrawer--toolbar-111"
className="withRouter-LeftDrawer--toolbar-82"
/>
<ul
className="MuiList-root-125 MuiList-padding-126"
className="MuiList-root-96 MuiList-padding-97"
>
<a
aria-current={null}
className="MuiButtonBase-root-108 MuiListItem-root-129 MuiListItem-default-132 MuiListItem-gutters-137 MuiListItem-button-138"
className="MuiButtonBase-root-112 MuiListItem-root-100 MuiListItem-default-103 MuiListItem-gutters-108 MuiListItem-button-109"
href="/dashboard"
onBlur={[Function]}
onClick={[Function]}
Expand All @@ -119,11 +61,11 @@ exports[`Header matches snapshot 1`] = `
tabIndex="0"
>
<div
className="MuiListItemIcon-root-141"
className="MuiListItemIcon-root-115"
>
<svg
aria-hidden="true"
className="MuiSvgIcon-root-142"
className="MuiSvgIcon-root-116"
focusable="false"
role="presentation"
viewBox="0 0 24 24"
Expand All @@ -138,21 +80,21 @@ exports[`Header matches snapshot 1`] = `
</svg>
</div>
<div
className="MuiListItemText-root-151"
className="MuiListItemText-root-125"
>
<span
className="MuiTypography-root-47 MuiTypography-subheading-54 MuiListItemText-primary-154"
className="MuiTypography-root-47 MuiTypography-subheading-54 MuiListItemText-primary-128"
>
Dashboard
</span>
</div>
<span
className="MuiTouchRipple-root-162"
className="MuiTouchRipple-root-136"
/>
</a>
</ul>
<hr
className="MuiDivider-root-157"
className="MuiDivider-root-131"
/>
<Accounts
accountId={null}
Expand Down
2 changes: 0 additions & 2 deletions src/common/Header/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Toolbar from '@material-ui/core/Toolbar'
import { withStyles } from '@material-ui/core/styles'
import Logo from '../Logo/index'
import LoginButton from '../LoginButton'
import TopNav from '../TopNav'
import LeftDrawer from '../../common/LeftDrawer'

const styles = theme => ({
Expand All @@ -27,7 +26,6 @@ const Header = ({ classes, children }) => (
<AppBar position="fixed" className={classes.header}>
<Toolbar className={classes.toolbar}>
<Logo />
<TopNav />
<LoginButton />
</Toolbar>
</AppBar>
Expand Down
5 changes: 3 additions & 2 deletions src/common/ModalDialog/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import DialogActions from '@material-ui/core/DialogActions'
import DialogContent from '@material-ui/core/DialogContent'
import DialogTitle from '@material-ui/core/DialogTitle'
import Button from '@material-ui/core/Button'

import Divider from '@material-ui/core/Divider'

const ModalDialog = ({
title,
Expand All @@ -20,6 +20,7 @@ const ModalDialog = ({
onClose={onCancel}
>
<DialogTitle id="form-dialog-title">{title}</DialogTitle>
<Divider />
<form onSubmit={onSubmit}>
<DialogContent>
{children}
Expand All @@ -35,7 +36,7 @@ const ModalDialog = ({
ModalDialog.propTypes = {
open: PropTypes.bool.isRequired,
title: PropTypes.string.isRequired,
children: PropTypes.element.isRequired,
children: PropTypes.array.isRequired,
onSubmit: PropTypes.func.isRequired,
onCancel: PropTypes.func.isRequired
}
Expand Down
62 changes: 0 additions & 62 deletions src/common/TopNav/__tests__/__snapshots__/index.test.jsx.snap

This file was deleted.

15 changes: 0 additions & 15 deletions src/common/TopNav/__tests__/index.test.jsx

This file was deleted.

16 changes: 0 additions & 16 deletions src/common/TopNav/index.jsx

This file was deleted.

4 changes: 2 additions & 2 deletions src/core/Accounts/ImportTransactions/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const makeMapStateToProps = () => {
}

const mapDispatchToProps = dispatch => ({
saveTransactions: transactions => dispatch(addTransactions(transactions))
saveTransactions: (account, transactions) => dispatch(addTransactions(account, transactions))
})

const initialState = {
Expand All @@ -53,7 +53,7 @@ export class ImportTransactionsComponent extends React.Component {
state = initialState

onSave = () => {
this.props.saveTransactions(this.state.transactions)
this.props.saveTransactions(this.props.account, this.state.transactions)
this.props.history.push(`/accounts/${this.props.account.id}/transactions`)
}

Expand Down

0 comments on commit 3369738

Please sign in to comment.