feat: sorting columns.

This commit is contained in:
elforjani3
2021-03-03 20:07:33 +02:00
parent 31f864bc4e
commit 5f92196317
15 changed files with 305 additions and 269 deletions

View File

@@ -82,7 +82,7 @@ export function ItemsActionMenuList({
},
}) {
const { formatMessage } = useIntl();
return (
<Menu>
<MenuItem
@@ -124,7 +124,7 @@ export function ItemsActionMenuList({
/>
</Menu>
);
};
}
export const ItemsActionsTableCell = (props) => {
return (
@@ -137,7 +137,6 @@ export const ItemsActionsTableCell = (props) => {
);
};
/**
* Retrieve all items table columns.
*/
@@ -147,30 +146,35 @@ export const useItemsTableColumns = () => {
return React.useMemo(
() => [
{
id: 'name',
Header: formatMessage({ id: 'item_name' }),
accessor: 'name',
className: 'name',
width: 180,
},
{
id:'code',
Header: formatMessage({ id: 'item_code' }),
accessor: 'code',
className: 'code',
width: 120,
},
{
id: 'type',
Header: formatMessage({ id: 'item_type' }),
accessor: ItemTypeAccessor,
className: 'item_type',
width: 120,
},
{
id: 'category',
Header: formatMessage({ id: 'category' }),
accessor: 'category.name',
className: 'category',
width: 150,
},
{
id:'sell_price',
Header: formatMessage({ id: 'sell_price' }),
Cell: SellPriceCell,
accessor: 'sell_price',
@@ -178,6 +182,7 @@ export const useItemsTableColumns = () => {
width: 150,
},
{
id:'cost_price',
Header: formatMessage({ id: 'cost_price' }),
Cell: CostPriceCell,
accessor: 'cost_price',
@@ -185,6 +190,7 @@ export const useItemsTableColumns = () => {
width: 150,
},
{
id:'quantity_on_hand',
Header: formatMessage({ id: 'quantity_on_hand' }),
accessor: 'quantity_on_hand',
Cell: QuantityOnHandCell,
@@ -199,4 +205,4 @@ export const useItemsTableColumns = () => {
],
[formatMessage],
);
}
};