mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
Merge branch 'master' of https://github.com/abouolia/Ratteb
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import DrawerTemplate from 'containers/Drawers/DrawerTemplate';
|
||||
import PaperTemplate from 'containers/Drawers/PaperTemplate';
|
||||
import PaperTemplate from 'containers/Drawers/PaperTemplate/PaperTemplate';
|
||||
import withDrawers from 'containers/Drawer/withDrawers';
|
||||
import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import TableSkeletonRows from 'components/Datatable/TableSkeletonRows';
|
||||
import TableSkeletonHeader from 'components/Datatable/TableHeaderSkeleton';
|
||||
|
||||
import withAlertsActions from 'containers/Alert/withAlertActions';
|
||||
import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
||||
import withReceipts from './withReceipts';
|
||||
import withReceiptsActions from './withReceiptsActions';
|
||||
import withSettings from 'containers/Settings/withSettings';
|
||||
@@ -31,6 +32,9 @@ function ReceiptsDataTable({
|
||||
|
||||
// #withAlertsActions
|
||||
openAlert,
|
||||
|
||||
// #withDrawerActions
|
||||
openDrawer,
|
||||
}) {
|
||||
const history = useHistory();
|
||||
|
||||
@@ -61,6 +65,11 @@ function ReceiptsDataTable({
|
||||
openAlert('receipt-close', { receiptId: receipt.id });
|
||||
};
|
||||
|
||||
// Handle drawer receipts.
|
||||
const handleDrawerReceipt = () => {
|
||||
openDrawer('receipt-drawer', {});
|
||||
};
|
||||
|
||||
// Handles the datable fetch data once the state changing.
|
||||
const handleDataTableFetchData = useCallback(
|
||||
({ sortBy, pageIndex, pageSize }) => {
|
||||
@@ -102,6 +111,7 @@ function ReceiptsDataTable({
|
||||
onEdit: handleEditReceipt,
|
||||
onDelete: handleDeleteReceipt,
|
||||
onClose: handleCloseReceipt,
|
||||
onDrawer:handleDrawerReceipt,
|
||||
baseCurrency,
|
||||
}}
|
||||
/>
|
||||
@@ -111,6 +121,7 @@ function ReceiptsDataTable({
|
||||
export default compose(
|
||||
withAlertsActions,
|
||||
withReceiptsActions,
|
||||
withDrawerActions,
|
||||
withReceipts(({ receiptTableState }) => ({
|
||||
receiptTableState,
|
||||
})),
|
||||
|
||||
@@ -15,7 +15,7 @@ import { Choose, Money, Icon, If } from 'components';
|
||||
import moment from 'moment';
|
||||
|
||||
export function ActionsMenu({
|
||||
payload: { onEdit, onDelete, onClose },
|
||||
payload: { onEdit, onDelete, onClose ,onDrawer },
|
||||
row: { original: receipt },
|
||||
}) {
|
||||
const { formatMessage } = useIntl();
|
||||
@@ -38,6 +38,10 @@ export function ActionsMenu({
|
||||
onClick={safeCallback(onClose, receipt)}
|
||||
/>
|
||||
</If>
|
||||
<MenuItem
|
||||
text={formatMessage({ id: 'receipt_paper' })}
|
||||
onClick={() => onDrawer()}
|
||||
/>
|
||||
<MenuItem
|
||||
text={formatMessage({ id: 'delete_receipt' })}
|
||||
intent={Intent.DANGER}
|
||||
|
||||
Reference in New Issue
Block a user