mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 23:00:34 +00:00
fix: manual journal detail.
This commit is contained in:
@@ -270,7 +270,7 @@ function MakeJournalEntriesForm({
|
|||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
withJournalsActions,
|
withJournalsActions,
|
||||||
withManualJournalDetail,
|
withManualJournalDetail(),
|
||||||
withAccountsActions,
|
withAccountsActions,
|
||||||
withDashboardActions,
|
withDashboardActions,
|
||||||
withMediaActions,
|
withMediaActions,
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { getManualJournal } from 'store/manualJournals/manualJournals.reducers';
|
import { getManualJournalByIdFactory } from 'store/manualJournals/manualJournals.selectors';
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
const getManualJournalById = getManualJournalByIdFactory();
|
||||||
|
|
||||||
const mapStateToProps = (state, props) => ({
|
const mapStateToProps = (state, props) => ({
|
||||||
manualJournal: getManualJournal(state, props.manualJournalId),
|
manualJournal: getManualJournalById(state, props),
|
||||||
});
|
});
|
||||||
|
return connect(mapStateToProps);
|
||||||
export default connect(mapStateToProps);
|
};
|
||||||
@@ -1,7 +1,12 @@
|
|||||||
import { createSelector } from 'reselect';
|
import { createSelector } from 'reselect';
|
||||||
import { pickItemsFromIds, paginationLocationQuery, defaultPaginationMeta } from 'store/selectors';
|
import {
|
||||||
|
pickItemsFromIds,
|
||||||
|
paginationLocationQuery,
|
||||||
|
defaultPaginationMeta,
|
||||||
|
} from 'store/selectors';
|
||||||
|
|
||||||
const manualJournalsCurrentViewIdSelector = (state) => state.manualJournals.currentViewId;
|
const manualJournalsCurrentViewIdSelector = (state) =>
|
||||||
|
state.manualJournals.currentViewId;
|
||||||
|
|
||||||
const manualJournalsPageSelector = (state) => {
|
const manualJournalsPageSelector = (state) => {
|
||||||
const viewId = state.manualJournals.currentViewId;
|
const viewId = state.manualJournals.currentViewId;
|
||||||
@@ -18,7 +23,7 @@ const manualJournalsPaginationSelector = (state, props) => {
|
|||||||
|
|
||||||
const manualJournalsTableQuery = (state) => state.manualJournals.tableQuery;
|
const manualJournalsTableQuery = (state) => state.manualJournals.tableQuery;
|
||||||
const manualJournalsDataSelector = (state) => state.manualJournals.items;
|
const manualJournalsDataSelector = (state) => state.manualJournals.items;
|
||||||
|
const manualJournalByIdSelector = (state, props) => state.manualJournals.items[props.manualJournalId];
|
||||||
|
|
||||||
// Retrieve manual jounral current page results.
|
// Retrieve manual jounral current page results.
|
||||||
export const getManualJournalsItems = createSelector(
|
export const getManualJournalsItems = createSelector(
|
||||||
@@ -56,9 +61,11 @@ export const getManualJournalsTableQuery = createSelector(
|
|||||||
|
|
||||||
// Retrieve manual journals current view id.
|
// Retrieve manual journals current view id.
|
||||||
export const getManualJournalsCurrentViewIdFactory = () =>
|
export const getManualJournalsCurrentViewIdFactory = () =>
|
||||||
createSelector(
|
createSelector(manualJournalsCurrentViewIdSelector, (currentViewId) => {
|
||||||
manualJournalsCurrentViewIdSelector,
|
|
||||||
(currentViewId) => {
|
|
||||||
return currentViewId;
|
return currentViewId;
|
||||||
},
|
});
|
||||||
);
|
|
||||||
|
export const getManualJournalByIdFactory = () =>
|
||||||
|
createSelector(manualJournalByIdSelector, (manualJournal) => {
|
||||||
|
return manualJournal;
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user