mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
chrone: sperate client and server to different repos.
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import moment from 'moment';
|
||||
import 'style/pages/FinancialStatements/ContactsTransactions.scss';
|
||||
|
||||
import { FinancialStatement } from 'components';
|
||||
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
||||
|
||||
import VendorsTransactionsHeader from './VendorsTransactionsHeader';
|
||||
import VendorsTransactionsActionsBar from './VendorsTransactionsActionsBar';
|
||||
import VendorsTransactionsTable from './VendorsTransactionsTable';
|
||||
|
||||
import withVendorsTransactionsActions from './withVendorsTransactionsActions';
|
||||
import withCurrentOrganization from '../../../containers/Organization/withCurrentOrganization';
|
||||
|
||||
import { VendorsTransactionsProvider } from './VendorsTransactionsProvider';
|
||||
import { VendorsTransactionsLoadingBar } from './components';
|
||||
|
||||
import { compose } from 'utils';
|
||||
|
||||
/**
|
||||
* Vendors transactions.
|
||||
*/
|
||||
function VendorsTransactions({
|
||||
// #withPreferences
|
||||
organizationName,
|
||||
|
||||
//#withVendorsTransactionsActions
|
||||
toggleVendorsTransactionsFilterDrawer,
|
||||
}) {
|
||||
// filter
|
||||
const [filter, setFilter] = useState({
|
||||
fromDate: moment().startOf('year').format('YYYY-MM-DD'),
|
||||
toDate: moment().endOf('year').format('YYYY-MM-DD'),
|
||||
});
|
||||
|
||||
const handleFilterSubmit = (filter) => {
|
||||
const _filter = {
|
||||
...filter,
|
||||
fromDate: moment(filter.fromDate).format('YYYY-MM-DD'),
|
||||
toDate: moment(filter.toDate).format('YYYY-MM-DD'),
|
||||
};
|
||||
setFilter({ ..._filter });
|
||||
};
|
||||
|
||||
// Handle number format submit.
|
||||
const handleNumberFormatSubmit = (values) => {
|
||||
setFilter({
|
||||
...filter,
|
||||
numberFormat: values,
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(
|
||||
() => () => {
|
||||
toggleVendorsTransactionsFilterDrawer(false);
|
||||
},
|
||||
[toggleVendorsTransactionsFilterDrawer],
|
||||
);
|
||||
|
||||
return (
|
||||
<VendorsTransactionsProvider filter={filter}>
|
||||
<VendorsTransactionsActionsBar
|
||||
numberFormat={filter.numberFormat}
|
||||
onNumberFormatSubmit={handleNumberFormatSubmit}
|
||||
/>
|
||||
<VendorsTransactionsLoadingBar />
|
||||
<DashboardPageContent>
|
||||
<FinancialStatement>
|
||||
<div className={'financial-statement--transactions'}>
|
||||
<VendorsTransactionsHeader
|
||||
pageFilter={filter}
|
||||
onSubmitFilter={handleFilterSubmit}
|
||||
/>
|
||||
<div class="financial-statement__body">
|
||||
<VendorsTransactionsTable companyName={organizationName} />
|
||||
</div>
|
||||
</div>
|
||||
</FinancialStatement>
|
||||
</DashboardPageContent>
|
||||
</VendorsTransactionsProvider>
|
||||
);
|
||||
}
|
||||
export default compose(
|
||||
withCurrentOrganization(({ organization }) => ({
|
||||
organizationName: organization.name,
|
||||
})),
|
||||
withVendorsTransactionsActions,
|
||||
)(VendorsTransactions);
|
||||
@@ -0,0 +1,134 @@
|
||||
import React from 'react';
|
||||
import {
|
||||
NavbarGroup,
|
||||
Button,
|
||||
Classes,
|
||||
NavbarDivider,
|
||||
Popover,
|
||||
PopoverInteractionKind,
|
||||
Position,
|
||||
} from '@blueprintjs/core';
|
||||
import { FormattedMessage as T } from 'components';
|
||||
import classNames from 'classnames';
|
||||
|
||||
import Icon from 'components/Icon';
|
||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||
import NumberFormatDropdown from 'components/NumberFormatDropdown';
|
||||
|
||||
import { useVendorsTransactionsContext } from './VendorsTransactionsProvider';
|
||||
import withVendorsTransaction from './withVendorsTransaction';
|
||||
import withVendorsTransactionsActions from './withVendorsTransactionsActions';
|
||||
|
||||
import { compose, saveInvoke } from 'utils';
|
||||
|
||||
/**
|
||||
* vendors transactions actions bar.
|
||||
*/
|
||||
function VendorsTransactionsActionsBar({
|
||||
// #ownProps
|
||||
numberFormat,
|
||||
onNumberFormatSubmit,
|
||||
|
||||
//#withVendorsTransaction
|
||||
isFilterDrawerOpen,
|
||||
|
||||
//#withVendorsTransactionsActions
|
||||
toggleVendorsTransactionsFilterDrawer,
|
||||
}) {
|
||||
const {
|
||||
isVendorsTransactionsLoading,
|
||||
refetch,
|
||||
} = useVendorsTransactionsContext();
|
||||
|
||||
// Handle filter toggle click.
|
||||
const handleFilterToggleClick = () => {
|
||||
toggleVendorsTransactionsFilterDrawer();
|
||||
};
|
||||
|
||||
// Handle recalculate the report button.
|
||||
const handleRecalcReport = () => {
|
||||
refetch();
|
||||
};
|
||||
|
||||
// Handle number format form submit.
|
||||
const handleNumberFormatSubmit = (values) => {
|
||||
saveInvoke(onNumberFormatSubmit, values);
|
||||
};
|
||||
|
||||
return (
|
||||
<DashboardActionsBar>
|
||||
<NavbarGroup>
|
||||
<Button
|
||||
className={classNames(Classes.MINIMAL, 'button--gray-highlight')}
|
||||
text={<T id={'recalc_report'} />}
|
||||
onClick={handleRecalcReport}
|
||||
icon={<Icon icon="refresh-16" iconSize={16} />}
|
||||
/>
|
||||
<NavbarDivider />
|
||||
<Button
|
||||
className={classNames(Classes.MINIMAL, 'button--table-views')}
|
||||
icon={<Icon icon="cog-16" iconSize={16} />}
|
||||
text={
|
||||
isFilterDrawerOpen ? (
|
||||
<T id={'hide_customizer'} />
|
||||
) : (
|
||||
<T id={'customize_report'} />
|
||||
)
|
||||
}
|
||||
onClick={handleFilterToggleClick}
|
||||
active={isFilterDrawerOpen}
|
||||
/>
|
||||
<NavbarDivider />
|
||||
<Popover
|
||||
content={
|
||||
<NumberFormatDropdown
|
||||
numberFormat={numberFormat}
|
||||
onSubmit={handleNumberFormatSubmit}
|
||||
submitDisabled={isVendorsTransactionsLoading}
|
||||
/>
|
||||
}
|
||||
minimal={true}
|
||||
interactionKind={PopoverInteractionKind.CLICK}
|
||||
position={Position.BOTTOM_LEFT}
|
||||
>
|
||||
<Button
|
||||
className={classNames(Classes.MINIMAL, 'button--filter')}
|
||||
text={<T id={'format'} />}
|
||||
icon={<Icon icon="numbers" width={23} height={16} />}
|
||||
/>
|
||||
</Popover>
|
||||
|
||||
<Popover
|
||||
// content={}
|
||||
interactionKind={PopoverInteractionKind.CLICK}
|
||||
position={Position.BOTTOM_LEFT}
|
||||
>
|
||||
<Button
|
||||
className={classNames(Classes.MINIMAL, 'button--filter')}
|
||||
text={<T id={'filter'} />}
|
||||
icon={<Icon icon="filter-16" iconSize={16} />}
|
||||
/>
|
||||
</Popover>
|
||||
|
||||
<NavbarDivider />
|
||||
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon="print-16" iconSize={16} />}
|
||||
text={<T id={'print'} />}
|
||||
/>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon="file-export-16" iconSize={16} />}
|
||||
text={<T id={'export'} />}
|
||||
/>
|
||||
</NavbarGroup>
|
||||
</DashboardActionsBar>
|
||||
);
|
||||
}
|
||||
export default compose(
|
||||
withVendorsTransaction(({ vendorsTransactionsDrawerFilter }) => ({
|
||||
isFilterDrawerOpen: vendorsTransactionsDrawerFilter,
|
||||
})),
|
||||
withVendorsTransactionsActions,
|
||||
)(VendorsTransactionsActionsBar);
|
||||
@@ -0,0 +1,104 @@
|
||||
import React from 'react';
|
||||
import * as Yup from 'yup';
|
||||
import moment from 'moment';
|
||||
import { Formik, Form } from 'formik';
|
||||
import { Tabs, Tab, Button, Intent } from '@blueprintjs/core';
|
||||
import { FormattedMessage as T } from 'components';
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
import FinancialStatementHeader from 'containers/FinancialStatements/FinancialStatementHeader';
|
||||
import VendorsTransactionsHeaderGeneralPanel from './VendorsTransactionsHeaderGeneralPanel';
|
||||
|
||||
import withVendorsTransaction from './withVendorsTransaction';
|
||||
import withVendorsTransactionsActions from './withVendorsTransactionsActions';
|
||||
|
||||
import { compose, transformToForm } from 'utils';
|
||||
|
||||
/**
|
||||
* Vendors transactions header.
|
||||
*/
|
||||
|
||||
function VendorsTransactionsHeader({
|
||||
// #ownProps
|
||||
onSubmitFilter,
|
||||
pageFilter,
|
||||
|
||||
//#withVendorsTransaction
|
||||
isFilterDrawerOpen,
|
||||
|
||||
//#withVendorsTransactionsActions
|
||||
toggleVendorsTransactionsFilterDrawer: toggleFilterDrawer,
|
||||
}) {
|
||||
// Default form values.
|
||||
const defaultValues = {
|
||||
fromDate: moment().toDate(),
|
||||
toDate: moment().toDate(),
|
||||
vendorsIds: [],
|
||||
};
|
||||
|
||||
// Initial form values.
|
||||
const initialValues = transformToForm({
|
||||
...pageFilter,
|
||||
fromDate: moment(pageFilter.fromDate).toDate(),
|
||||
toDate: moment(pageFilter.toDate).toDate(),
|
||||
}, defaultValues);
|
||||
|
||||
// Validation schema.
|
||||
const validationSchema = Yup.object().shape({
|
||||
fromDate: Yup.date()
|
||||
.required()
|
||||
.label(intl.get('fromDate')),
|
||||
toDate: Yup.date()
|
||||
.min(Yup.ref('fromDate'))
|
||||
.required()
|
||||
.label(intl.get('toDate')),
|
||||
});
|
||||
|
||||
// Handle form submit.
|
||||
const handleSubmit = (values, { setSubmitting }) => {
|
||||
onSubmitFilter(values);
|
||||
toggleFilterDrawer(false);
|
||||
setSubmitting(false);
|
||||
};
|
||||
|
||||
// Handle drawer close action.
|
||||
const handleDrawerClose = () => { toggleFilterDrawer(false); };
|
||||
|
||||
return (
|
||||
<FinancialStatementHeader
|
||||
isOpen={isFilterDrawerOpen}
|
||||
drawerProps={{ onClose: handleDrawerClose }}
|
||||
>
|
||||
<Formik
|
||||
initialValues={initialValues}
|
||||
validationSchema={validationSchema}
|
||||
onSubmit={handleSubmit}
|
||||
>
|
||||
<Form>
|
||||
<Tabs animate={true} vertical={true} renderActiveTabPanelOnly={true}>
|
||||
<Tab
|
||||
id="general"
|
||||
title={<T id={'general'} />}
|
||||
panel={<VendorsTransactionsHeaderGeneralPanel />}
|
||||
/>
|
||||
</Tabs>
|
||||
|
||||
<div class="financial-header-drawer__footer">
|
||||
<Button className={'mr1'} intent={Intent.PRIMARY} type={'submit'}>
|
||||
<T id={'calculate_report'} />
|
||||
</Button>
|
||||
<Button onClick={handleDrawerClose} minimal={true}>
|
||||
<T id={'cancel'} />
|
||||
</Button>
|
||||
</div>
|
||||
</Form>
|
||||
</Formik>
|
||||
</FinancialStatementHeader>
|
||||
);
|
||||
}
|
||||
export default compose(
|
||||
withVendorsTransactionsActions,
|
||||
withVendorsTransaction(({ vendorsTransactionsDrawerFilter }) => ({
|
||||
isFilterDrawerOpen: vendorsTransactionsDrawerFilter,
|
||||
})),
|
||||
)(VendorsTransactionsHeader);
|
||||
@@ -0,0 +1,61 @@
|
||||
import React from 'react';
|
||||
import { Field } from 'formik';
|
||||
import classNames from 'classnames';
|
||||
import { Classes, FormGroup } from '@blueprintjs/core';
|
||||
|
||||
import FinancialStatementDateRange from '../FinancialStatementDateRange';
|
||||
import {
|
||||
Row,
|
||||
Col,
|
||||
ContactsMultiSelect,
|
||||
FormattedMessage as T,
|
||||
} from '../../../components';
|
||||
import {
|
||||
VendorsTransactionsGeneralPanelProvider,
|
||||
useVendorsTransactionsGeneralPanelContext,
|
||||
} from './VendorsTransactionsHeaderGeneralPanelProvider';
|
||||
|
||||
/**
|
||||
* Vendors transactions header - General panel
|
||||
*/
|
||||
export default function VendorsTransactionsHeaderGeneralPanel() {
|
||||
return (
|
||||
<VendorsTransactionsGeneralPanelProvider>
|
||||
<VendorsTransactionsHeaderGeneralPanelContent />
|
||||
</VendorsTransactionsGeneralPanelProvider>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Vendors transactions header - General panel - Content.
|
||||
*/
|
||||
function VendorsTransactionsHeaderGeneralPanelContent() {
|
||||
const { vendors } = useVendorsTransactionsGeneralPanelContext();
|
||||
|
||||
return (
|
||||
<div>
|
||||
<FinancialStatementDateRange />
|
||||
|
||||
<Row>
|
||||
<Col xs={5}>
|
||||
<Field name={'vendorsIds'}>
|
||||
{({ form: { setFieldValue }, field: { value } }) => (
|
||||
<FormGroup
|
||||
label={<T id={'specific_vendors'} />}
|
||||
className={classNames('form-group--select-list', Classes.FILL)}
|
||||
>
|
||||
<ContactsMultiSelect
|
||||
items={vendors}
|
||||
onItemSelect={(vendors) => {
|
||||
const vendorsIds = vendors.map((customer) => customer.id);
|
||||
setFieldValue('vendorsIds', vendorsIds);
|
||||
}}
|
||||
/>
|
||||
</FormGroup>
|
||||
)}
|
||||
</Field>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import React, { createContext, useContext } from 'react';
|
||||
import { useVendors } from 'hooks/query';
|
||||
import { FinancialHeaderLoadingSkeleton } from '../FinancialHeaderLoadingSkeleton';
|
||||
|
||||
const VendorsTransactionsGeneralPanelContext = createContext();
|
||||
|
||||
/**
|
||||
* Vendors transactions provider.
|
||||
*/
|
||||
function VendorsTransactionsGeneralPanelProvider({ ...props }) {
|
||||
// Fetch vendors list based on the given query.
|
||||
const {
|
||||
data: { vendors },
|
||||
isLoading: isVendorsLoading,
|
||||
isFetching: isVendorsFetching,
|
||||
} = useVendors({ page_size: 100000 });
|
||||
|
||||
const provider = {
|
||||
vendors,
|
||||
isVendorsLoading,
|
||||
isVendorsFetching,
|
||||
};
|
||||
|
||||
const loading = isVendorsLoading;
|
||||
|
||||
return loading ? (
|
||||
<FinancialHeaderLoadingSkeleton />
|
||||
) : (
|
||||
<VendorsTransactionsGeneralPanelContext.Provider
|
||||
value={provider}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
const useVendorsTransactionsGeneralPanelContext = () =>
|
||||
useContext(VendorsTransactionsGeneralPanelContext);
|
||||
|
||||
export {
|
||||
VendorsTransactionsGeneralPanelProvider,
|
||||
useVendorsTransactionsGeneralPanelContext,
|
||||
};
|
||||
@@ -0,0 +1,42 @@
|
||||
import React, { createContext, useContext, useMemo } from 'react';
|
||||
import FinancialReportPage from '../FinancialReportPage';
|
||||
import { useVendorsTransactionsReport } from 'hooks/query';
|
||||
import { transformFilterFormToQuery } from '../common';
|
||||
|
||||
const VendorsTransactionsContext = createContext();
|
||||
|
||||
/**
|
||||
* Vendors transactions provider.
|
||||
*/
|
||||
function VendorsTransactionsProvider({ filter, ...props }) {
|
||||
const query = useMemo(() => transformFilterFormToQuery(filter), [filter]);
|
||||
|
||||
// Fetch vendors transactions based on the given query.
|
||||
const {
|
||||
data: vendorsTransactions,
|
||||
isFetching: isVendorsTransactionFetching,
|
||||
isLoading: isVendorsTransactionsLoading,
|
||||
refetch,
|
||||
} = useVendorsTransactionsReport(query, { keepPreviousData: true });
|
||||
|
||||
const provider = {
|
||||
vendorsTransactions,
|
||||
isVendorsTransactionsLoading,
|
||||
isVendorsTransactionFetching,
|
||||
|
||||
refetch,
|
||||
filter,
|
||||
query,
|
||||
};
|
||||
|
||||
return (
|
||||
<FinancialReportPage name={'vendor-transactions'}>
|
||||
<VendorsTransactionsContext.Provider value={provider} {...props} />
|
||||
</FinancialReportPage>
|
||||
);
|
||||
}
|
||||
|
||||
const useVendorsTransactionsContext = () =>
|
||||
useContext(VendorsTransactionsContext);
|
||||
|
||||
export { VendorsTransactionsProvider, useVendorsTransactionsContext };
|
||||
@@ -0,0 +1,60 @@
|
||||
import React, { useMemo, useCallback } from 'react';
|
||||
import intl from 'react-intl-universal';
|
||||
import classNames from 'classnames';
|
||||
|
||||
import FinancialSheet from 'components/FinancialSheet';
|
||||
import DataTable from 'components/DataTable';
|
||||
import { useVendorsTransactionsColumns } from './components';
|
||||
import { useVendorsTransactionsContext } from './VendorsTransactionsProvider';
|
||||
|
||||
import { defaultExpanderReducer, getColumnWidth } from 'utils';
|
||||
|
||||
/**
|
||||
* Vendors transactions table.
|
||||
*/
|
||||
|
||||
export default function VendorsTransactionsTable({
|
||||
// #ownProps
|
||||
companyName,
|
||||
}) {
|
||||
|
||||
|
||||
const {
|
||||
vendorsTransactions: { tableRows },
|
||||
isVendorsTransactionsLoading,
|
||||
query,
|
||||
} = useVendorsTransactionsContext();
|
||||
|
||||
const columns = useVendorsTransactionsColumns();
|
||||
|
||||
const expandedRows = useMemo(() => defaultExpanderReducer(tableRows, 5), [
|
||||
tableRows,
|
||||
]);
|
||||
|
||||
const rowClassNames = (row) => {
|
||||
return [`row-type--${row.original.rowTypes}`];
|
||||
};
|
||||
|
||||
return (
|
||||
<FinancialSheet
|
||||
name="vendor-transactions"
|
||||
companyName={companyName}
|
||||
sheetType={intl.get('vendors_transactions')}
|
||||
loading={isVendorsTransactionsLoading}
|
||||
fromDate={query.from_date}
|
||||
toDate={query.to_date}
|
||||
>
|
||||
<DataTable
|
||||
className="bigcapital-datatable--financial-report"
|
||||
columns={columns}
|
||||
data={tableRows}
|
||||
rowClassNames={rowClassNames}
|
||||
noInitialFetch={true}
|
||||
expandable={true}
|
||||
expanded={expandedRows}
|
||||
expandToggleColumn={1}
|
||||
expandColumnSpace={0.8}
|
||||
/>
|
||||
</FinancialSheet>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
import React from 'react';
|
||||
import intl from 'react-intl-universal';
|
||||
import { If } from 'components';
|
||||
import { useVendorsTransactionsContext } from './VendorsTransactionsProvider';
|
||||
import FinancialLoadingBar from '../FinancialLoadingBar';
|
||||
import { getColumnWidth, getForceWidth } from 'utils';
|
||||
|
||||
/**
|
||||
* Retrieve vendors transactions columns.
|
||||
*/
|
||||
export const useVendorsTransactionsColumns = () => {
|
||||
const {
|
||||
vendorsTransactions: { tableRows },
|
||||
} = useVendorsTransactionsContext();
|
||||
|
||||
return React.useMemo(
|
||||
() => [
|
||||
{
|
||||
Header: intl.get('vendor_name'),
|
||||
accessor: ({ cells }) => {
|
||||
return (
|
||||
<span
|
||||
className={'force-width'}
|
||||
style={{ minWidth: getForceWidth(cells[0].key) }}
|
||||
>
|
||||
{cells[0].value}
|
||||
</span>
|
||||
);
|
||||
},
|
||||
className: 'vendor_name',
|
||||
textOverview: true,
|
||||
// width: 240,
|
||||
},
|
||||
{
|
||||
Header: intl.get('account_name'),
|
||||
accessor: 'cells[1].value',
|
||||
className: 'name',
|
||||
textOverview: true,
|
||||
width: 170,
|
||||
},
|
||||
{
|
||||
Header: intl.get('reference_type'),
|
||||
accessor: 'cells[2].value',
|
||||
textOverview: true,
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
Header: intl.get('transaction_type'),
|
||||
accessor: 'cells[3].value',
|
||||
textOverview: true,
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
Header: intl.get('credit'),
|
||||
accessor: 'cells[4].value',
|
||||
className: 'credit',
|
||||
textOverview: true,
|
||||
width: getColumnWidth(tableRows, 'cells[5].value', {
|
||||
minWidth: 100,
|
||||
magicSpacing: 10,
|
||||
}),
|
||||
},
|
||||
{
|
||||
Header: intl.get('debit'),
|
||||
accessor: 'cells[5].value',
|
||||
className: 'debit',
|
||||
textOverview: true,
|
||||
width: getColumnWidth(tableRows, 'cells[6].value', {
|
||||
minWidth: 100,
|
||||
magicSpacing: 10,
|
||||
}),
|
||||
},
|
||||
{
|
||||
Header: intl.get('running_balance'),
|
||||
accessor: 'cells[6].value',
|
||||
className: 'running_balance',
|
||||
textOverview: true,
|
||||
width: getColumnWidth(tableRows, 'cells[7].value', {
|
||||
minWidth: 120,
|
||||
magicSpacing: 10,
|
||||
}),
|
||||
},
|
||||
],
|
||||
[tableRows],
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* vendors transactions loading bar.
|
||||
*/
|
||||
export function VendorsTransactionsLoadingBar() {
|
||||
const { isVendorsTransactionFetching } = useVendorsTransactionsContext();
|
||||
|
||||
return (
|
||||
<If condition={isVendorsTransactionFetching}>
|
||||
<FinancialLoadingBar />
|
||||
</If>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { getVendorsTransactionsFilterDrawer } from 'store/financialStatement/financialStatements.selectors';
|
||||
|
||||
export default (mapState) => {
|
||||
const mapStateToProps = (state, props) => {
|
||||
const mapped = {
|
||||
vendorsTransactionsDrawerFilter: getVendorsTransactionsFilterDrawer(
|
||||
state,
|
||||
props,
|
||||
),
|
||||
};
|
||||
return mapState ? mapState(mapped, state, props) : mapped;
|
||||
};
|
||||
return connect(mapStateToProps);
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { toggleVendorsTransactionsFilterDrawer } from 'store/financialStatement/financialStatements.actions';
|
||||
|
||||
const mapActionsToProps = (dispatch) => ({
|
||||
toggleVendorsTransactionsFilterDrawer: (toggle) =>
|
||||
dispatch(toggleVendorsTransactionsFilterDrawer(toggle)),
|
||||
});
|
||||
|
||||
export default connect(null, mapActionsToProps);
|
||||
Reference in New Issue
Block a user