Fix: PaymentReceive & ExchangeRate & itemCategories

This commit is contained in:
elforjani3
2020-09-07 07:29:33 +02:00
parent 9c21e233ea
commit 7dafd67022
16 changed files with 250 additions and 203 deletions

View File

@@ -16,11 +16,15 @@ import { compose } from 'utils';
import DataTable from 'components/DataTable';
import withItemCategories from './withItemCategories';
import withDialogActions from 'containers/Dialog/withDialogActions';
const ItemsCategoryList = ({
// #withItemCategories
categoriesList,
// #withDialogActions.
openDialog,
// #ownProps
onFetchData,
onDeleteCategory,
@@ -30,11 +34,12 @@ const ItemsCategoryList = ({
const { formatMessage } = useIntl();
const handelEditCategory = useCallback(
(category) => {
onEditCategory(category);
(category) => () => {
openDialog('item-category-form', { action: 'edit', id: category.id });
},
[onEditCategory],
[],
);
const handleDeleteCategory = useCallback(
(category) => {
onDeleteCategory(category);
@@ -46,13 +51,14 @@ const ItemsCategoryList = ({
<Menu>
<MenuItem
text={formatMessage({ id: 'edit_category' })}
onClick={() => handelEditCategory(category)}
onClick={handelEditCategory(category)}
/>
<MenuDivider />
<MenuItem
text={formatMessage({ id: 'delete_category' })}
intent={Intent.DANGER}
onClick={() => handleDeleteCategory(category)}
icon={<Icon icon="trash-16" iconSize={16} />}
/>
</Menu>
),
@@ -77,7 +83,7 @@ const ItemsCategoryList = ({
{
id: 'count',
Header: formatMessage({ id: 'count' }),
accessor: (r) => r.count || '',
accessor: 'count',
className: 'count',
width: 50,
},
@@ -154,4 +160,5 @@ export default compose(
withItemCategories(({ categoriesList }) => ({
categoriesList,
})),
withDialogActions,
)(ItemsCategoryList);