diff --git a/client/src/components/Preferences/PreferencesPage.js b/client/src/components/Preferences/PreferencesPage.js index e592dc5dd..4689231c6 100644 --- a/client/src/components/Preferences/PreferencesPage.js +++ b/client/src/components/Preferences/PreferencesPage.js @@ -6,5 +6,5 @@ export default function PreferencesPage() {
- ) + ); } \ No newline at end of file diff --git a/client/src/config/sidebarMenu.js b/client/src/config/sidebarMenu.js index a86301ddb..f1eb8028a 100644 --- a/client/src/config/sidebarMenu.js +++ b/client/src/config/sidebarMenu.js @@ -1,3 +1,4 @@ + export default [ { divider: true diff --git a/client/src/connectors/BalanceSheet.connect.js b/client/src/connectors/BalanceSheet.connect.js deleted file mode 100644 index 15b0fa2cb..000000000 --- a/client/src/connectors/BalanceSheet.connect.js +++ /dev/null @@ -1,27 +0,0 @@ -import {connect} from 'react-redux'; -import { - fetchBalanceSheet, -} from 'store/financialStatement/financialStatements.actions'; -import { - getFinancialSheetIndexByQuery, - getFinancialSheet, - getFinancialSheetAccounts, - getFinancialSheetColumns, - getFinancialSheetQuery, -} from 'store/financialStatement/financialStatements.selectors'; - - -export const mapStateToProps = (state, props) => ({ - getBalanceSheetIndex: (query) => getFinancialSheetIndexByQuery(state.financialStatements.balanceSheet.sheets, query), - getBalanceSheet: (index) => getFinancialSheet(state.financialStatements.balanceSheet.sheets, index), - getBalanceSheetAccounts: (index) => getFinancialSheetAccounts(state.financialStatements.balanceSheet.sheets, index), - getBalanceSheetColumns:(index) => getFinancialSheetColumns(state.financialStatements.balanceSheet.sheets, index), - getBalanceSheetQuery: (index) => getFinancialSheetQuery(state.financialStatements.balanceSheet.sheets, index), - balanceSheetLoading: state.financialStatements.balanceSheet.loading, -}); - -export const mapDispatchToProps = (dispatch) => ({ - fetchBalanceSheet: (query = {}) => dispatch(fetchBalanceSheet({ query })), -}); - -export default connect(mapStateToProps, mapDispatchToProps); \ No newline at end of file diff --git a/client/src/connectors/BalanceSheetTable.connect.js b/client/src/connectors/BalanceSheetTable.connect.js deleted file mode 100644 index 58d8d52d1..000000000 --- a/client/src/connectors/BalanceSheetTable.connect.js +++ /dev/null @@ -1,27 +0,0 @@ -import {connect} from 'react-redux'; -import { - fetchBalanceSheet, -} from 'store/financialStatement/financialStatements.actions'; -import { - getFinancialSheetIndexByQuery, - getFinancialSheet, - getFinancialSheetsAccounts, - getFinancialSheetsColumns, -} from 'store/financialStatement/financialStatements.selectors'; - - -export const mapStateToProps = (state, props) => { - const sheetIndex = props.balanceSheetIndex; - - return { - balanceSheetAccounts: props.getBalanceSheetAccounts(sheetIndex), - balanceSheetQuery: props.getBalanceSheetQuery(sheetIndex), - balanceSheetColumns: props.getBalanceSheetColumns(sheetIndex), - }; -}; - -export const mapDispatchToProps = (dispatch) => ({ - -}); - -export default connect(mapStateToProps, mapDispatchToProps); \ No newline at end of file diff --git a/client/src/connectors/FinancialStatements.connector.js b/client/src/connectors/FinancialStatements.connector.js deleted file mode 100644 index 1791e25de..000000000 --- a/client/src/connectors/FinancialStatements.connector.js +++ /dev/null @@ -1,36 +0,0 @@ -import {connect} from 'react-redux'; -import { - fetchGeneralLedger, - fetchBalanceSheet, -} from 'store/financialStatement/financialStatements.actions'; -import { - getBalanceSheetByQuery, - getBalanceSheetColumns, - getBalanceSheetIndexByQuery, - getBalanceSheetByIndex, - getBalanceSheetAssetsAccounts, - getBalanceSheetLiabilitiesAccounts, - getBalanceSheetQuery, -} from 'store/financialStatement/financialStatements.selectors'; - -export const mapStateToProps = (state, props) => ({ - generalLedeger: state.financialStatements.generalLedger, - balanceSheets: state.financialStatements.balanceSheets, - - getBalanceSheetByQuery: (query) => getBalanceSheetByQuery(state.financialStatements.balanceSheets, query), - getBalanceSheetColumns: (sheetIndex) => getBalanceSheetColumns(state.financialStatements.balanceSheets, sheetIndex), - getBalanceSheetIndexByQuery: (query) => getBalanceSheetIndexByQuery(state.financialStatements.balanceSheets, query), - getBalanceSheetByIndex: (sheetIndex) => getBalanceSheetByIndex(state.financialStatements.balanceSheets, sheetIndex), - - getBalanceSheetAssetsAccounts: (sheetIndex) => getBalanceSheetAssetsAccounts(state.financialStatements.balanceSheets, sheetIndex), - getBalanceSheetLiabilitiesAccounts: (sheetIndex) => getBalanceSheetLiabilitiesAccounts(state.financialStatements.balanceSheets, sheetIndex), - - getBalanceSheetQuery: (sheetIndex) => getBalanceSheetQuery(state.financialStatements.balanceSheets, sheetIndex), -}); - -export const mapDispatchToProps = (dispatch) => ({ - fetchGeneralLedger: (query = {}) => dispatch(fetchGeneralLedger({ query })), - fetchBalanceSheet: (query = {}) => dispatch(fetchBalanceSheet({ query })), -}); - -export default connect(mapStateToProps, mapDispatchToProps); \ No newline at end of file diff --git a/client/src/connectors/Journal.connect.js b/client/src/connectors/Journal.connect.js index f01815379..96325e56c 100644 --- a/client/src/connectors/Journal.connect.js +++ b/client/src/connectors/Journal.connect.js @@ -7,6 +7,7 @@ import { getFinancialSheet, } from 'store/financialStatement/financialStatements.selectors'; + export const mapStateToProps = (state, props) => ({ getJournalSheetIndex: (query) => getFinancialSheetIndexByQuery(state.financialStatements.journal.sheets, query), getJournalSheet: (index) => getFinancialSheet(state.financialStatements.journal.sheets, index), diff --git a/client/src/connectors/ProfitLossSheet.connect.js b/client/src/connectors/ProfitLossSheet.connect.js deleted file mode 100644 index e7ad67afd..000000000 --- a/client/src/connectors/ProfitLossSheet.connect.js +++ /dev/null @@ -1,27 +0,0 @@ -import {connect} from 'react-redux'; -import { - fetchProfitLossSheet, -} from 'store/financialStatement/financialStatements.actions'; -import { - getFinancialSheetIndexByQuery, - getFinancialSheet, - getFinancialSheetColumns, - getFinancialSheetQuery, - getFinancialSheetTableRows, -} from 'store/financialStatement/financialStatements.selectors'; - -export const mapStateToProps = (state, props) => ({ - getProfitLossSheetIndex: (query) => getFinancialSheetIndexByQuery(state.financialStatements.profitLoss.sheets, query), - getProfitLossSheet: (index) => getFinancialSheet(state.financialStatements.profitLoss.sheets, index), - getProfitLossColumns: (index) => getFinancialSheetColumns(state.financialStatements.profitLoss.sheets, index), - getProfitLossQuery: (index) => getFinancialSheetQuery(state.financialStatements.profitLoss.sheets, index), - getProfitLossTableRows: (index) => getFinancialSheetTableRows(state.financialStatements.profitLoss.sheets, index), - - profitLossSheetLoading: state.financialStatements.profitLoss.loading, -}); - -export const mapDispatchToProps = (dispatch) => ({ - fetchProfitLossSheet: (query = {}) => dispatch(fetchProfitLossSheet({ query })), -}); - -export default connect(mapStateToProps, mapDispatchToProps); \ No newline at end of file diff --git a/client/src/connectors/ProfitLossTable.connect.js b/client/src/connectors/ProfitLossTable.connect.js deleted file mode 100644 index 02970c30c..000000000 --- a/client/src/connectors/ProfitLossTable.connect.js +++ /dev/null @@ -1,17 +0,0 @@ -import {connect} from 'react-redux'; - -export const mapStateToProps = (state, props) => { - const sheetIndex = props.profitLossSheetIndex; - - return { - profitLossTableRows: props.getProfitLossTableRows(sheetIndex), - profitLossColumns: props.getProfitLossColumns(sheetIndex), - profitLossQuery: props.getProfitLossQuery(sheetIndex), - }; -}; - -export const mapDispatchToProps = (dispatch) => ({ - -}); - -export default connect(mapStateToProps, mapDispatchToProps); \ No newline at end of file diff --git a/client/src/connectors/TrialBalanceSheet.connect.js b/client/src/connectors/TrialBalanceSheet.connect.js index 01a63e9f2..a37049ad6 100644 --- a/client/src/connectors/TrialBalanceSheet.connect.js +++ b/client/src/connectors/TrialBalanceSheet.connect.js @@ -8,6 +8,7 @@ import { getFinancialSheetQuery, } from 'store/financialStatement/financialStatements.selectors'; + export const mapStateToProps = (state, props) => ({ getTrialBalanceSheetIndex: (query) => getFinancialSheetIndexByQuery(state.financialStatements.trialBalance.sheets, query), getTrialBalanceAccounts: (sheetIndex) => getFinancialSheetAccounts(state.financialStatements.trialBalance.sheets, sheetIndex), diff --git a/client/src/containers/Accounting/MakeJournalEntriesForm.js b/client/src/containers/Accounting/MakeJournalEntriesForm.js index 94af85555..f477132a3 100644 --- a/client/src/containers/Accounting/MakeJournalEntriesForm.js +++ b/client/src/containers/Accounting/MakeJournalEntriesForm.js @@ -23,12 +23,15 @@ import {compose} from 'utils'; function MakeJournalEntriesForm({ + // #withMedia requestSubmitMedia, requestDeleteMedia, + // #withJournalsActions requestMakeJournalEntries, requestEditManualJournal, + // #withDashboard changePageTitle, changePageSubtitle, @@ -252,8 +255,6 @@ function MakeJournalEntriesForm({ } export default compose( - // ManualJournalsConnect, - // MakeJournalEntriesConnect, withJournalsActions, withManualJournalDetail, withAccountsActions, diff --git a/client/src/containers/Accounting/MakeJournalEntriesPage.js b/client/src/containers/Accounting/MakeJournalEntriesPage.js index df46bc486..81edda382 100644 --- a/client/src/containers/Accounting/MakeJournalEntriesPage.js +++ b/client/src/containers/Accounting/MakeJournalEntriesPage.js @@ -46,7 +46,6 @@ function MakeJournalEntriesPage({ } export default compose( - // DashboardConnect, withAccountsActions, withManualJournalsActions, )(MakeJournalEntriesPage); \ No newline at end of file diff --git a/client/src/containers/Accounting/MakeJournalEntriesTable.js b/client/src/containers/Accounting/MakeJournalEntriesTable.js index d0d3dcc56..54ec3cd48 100644 --- a/client/src/containers/Accounting/MakeJournalEntriesTable.js +++ b/client/src/containers/Accounting/MakeJournalEntriesTable.js @@ -76,13 +76,16 @@ const NoteCellRenderer = (chainedComponent) => (props) => { /** * Make journal entries table component. */ -function MakeJournalEntriesTable({ - formik: { errors, values, setFieldValue }, +function MakeJournalEntriesTable({ + // #withAccounts accounts, + + // #ownPorps onClickRemoveRow, onClickAddNewRow, defaultRow, initialValues, + formik: { errors, values, setFieldValue }, }) { const [rows, setRow] = useState([]); @@ -226,5 +229,7 @@ function MakeJournalEntriesTable({ } export default compose( - withAccounts, + withAccounts(({ accounts }) => ({ + accounts, + })), )(MakeJournalEntriesTable); \ No newline at end of file diff --git a/client/src/containers/Accounting/ManualJournalActionsBar.js b/client/src/containers/Accounting/ManualJournalActionsBar.js index 1c52c0c2b..43fe4a648 100644 --- a/client/src/containers/Accounting/ManualJournalActionsBar.js +++ b/client/src/containers/Accounting/ManualJournalActionsBar.js @@ -14,10 +14,12 @@ import { } from '@blueprintjs/core'; import classNames from 'classnames'; import { useRouteMatch, useHistory } from 'react-router-dom'; +import { compose } from 'utils'; + +import FilterDropdown from 'components/FilterDropdown'; import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar'; import DialogConnect from 'connectors/Dialog.connector'; -import { compose } from 'utils'; -import FilterDropdown from 'components/FilterDropdown'; +import { If } from 'components'; import withResourceDetail from 'containers/Resources/withResourceDetails'; import withManualJournals from 'containers/Accounting/withManualJournals'; @@ -25,10 +27,14 @@ import withManualJournalsActions from 'containers/Accounting/withManualJournalsA function ManualJournalActionsBar({ + // #withResourceDetail resourceName = 'manual_journal', resourceFields, + // #withManualJournals manualJournalsViews, + + // #withManualJournalsActions addManualJournalsTableQueries, onFilterChanged, @@ -80,7 +86,9 @@ function ManualJournalActionsBar({ rightIcon={'caret-down'} /> + +