feat : checkbox landed cost.

This commit is contained in:
elforjani3
2021-07-22 13:33:10 +02:00
parent 2a55e09df8
commit 1091e3f996
2 changed files with 40 additions and 9 deletions

View File

@@ -1,7 +1,7 @@
import React from 'react';
import { FormattedMessage as T } from 'components';
import intl from 'react-intl-universal';
import { Tooltip, Button, Intent, Position } from '@blueprintjs/core';
import { Tooltip, Button, Checkbox, Intent, Position } from '@blueprintjs/core';
import { Hint, Icon } from 'components';
import { formattedAmount, safeSumBy } from 'utils';
import {
@@ -28,7 +28,11 @@ export function ItemHeaderCell() {
* Item column footer cell.
*/
export function ItemFooterCell() {
return <span><T id={'total'}/></span>;
return (
<span>
<T id={'total'} />
</span>
);
}
/**
@@ -86,12 +90,35 @@ export function IndexTableCell({ row: { index } }) {
return <span>{index + 1}</span>;
}
/**
* Landed cost cell.
*/
const LandedCostCell = ({
row: { index },
column: { id },
cell: { value: initialValue },
data,
payload,
}) => {
return <Checkbox minimal={true} className="ml2" />;
};
/**
* Landed cost header cell.
*/
const LandedCostHeaderCell = () => {
return (
<>
<T id={'cost'} />
<Hint content={''} />
</>
);
};
/**
* Retrieve editable items entries columns.
*/
export function useEditableItemsEntriesColumns() {
return React.useMemo(
() => [
{
@@ -155,6 +182,14 @@ export function useEditableItemsEntriesColumns() {
width: 100,
className: 'total',
},
{
Header: '',
accessor: 'landed_cost',
Cell: LandedCostCell,
width: 70,
disableSortBy: true,
disableResizing: true,
},
{
Header: '',
accessor: 'action',

View File

@@ -59,11 +59,7 @@ const LandedCostCell = ({
data,
payload,
}) => {
return (
<Tooltip content={''} position={Position.RIGHT}>
<Checkbox minimal={true} className="ml2" />
</Tooltip>
);
return <Checkbox minimal={true} className="ml2" />;
};
/**