Fix EntriesItemTable & FloatingActions

This commit is contained in:
elforjani3
2020-10-27 19:39:15 +02:00
parent 0ec0865a6e
commit 8a830a0a97
20 changed files with 200 additions and 215 deletions

View File

@@ -9,7 +9,7 @@ import DataTable from 'components/DataTable';
import {
InputGroupCell,
MoneyFieldCell,
EstimatesListFieldCell,
ItemsListCell,
PercentFieldCell,
DivFieldCell,
} from 'components/DataTableCells';
@@ -75,7 +75,7 @@ const ItemHeaderCell = () => {
);
};
function EstimateTable({
function EntriesItemsTable({
//#withitems
itemsCurrentPage,
@@ -108,7 +108,8 @@ function EstimateTable({
Header: ItemHeaderCell,
id: 'item_id',
accessor: 'item_id',
Cell: EstimatesListFieldCell,
Cell: ItemsListCell,
// ItemsListCell
disableSortBy: true,
width: 180,
},
@@ -235,7 +236,7 @@ function EstimateTable({
data={rows}
rowClassNames={rowClassNames}
payload={{
products: itemsCurrentPage,
items: itemsCurrentPage,
errors: errors.entries || [],
updateData: handleUpdateData,
removeRow: handleRemoveRow,
@@ -267,4 +268,4 @@ export default compose(
withItems(({ itemsCurrentPage }) => ({
itemsCurrentPage,
})),
)(EstimateTable);
)(EntriesItemsTable);

View File

@@ -3,7 +3,7 @@ import { Intent, Button } from '@blueprintjs/core';
import { FormattedMessage as T } from 'react-intl';
import { queryCache } from 'react-query';
export default function EstimateFormFooter({
export default function EstimateFloatingActions({
formik: { isSubmitting, resetForm },
onSubmitClick,
onCancelClick,

View File

@@ -15,8 +15,8 @@ import classNames from 'classnames';
import { CLASSES } from 'common/classes';
import EstimateFormHeader from './EstimateFormHeader';
import EstimatesItemsTable from './EntriesItemsTable';
import EstimateFormFooter from './EstimateFormFooter';
import EntriesItemsTable from './EntriesItemsTable';
import EstimateFloatingActions from './EstimateFloatingActions';
import withEstimateActions from './withEstimateActions';
import withEstimateDetail from './withEstimateDetail';
@@ -308,7 +308,7 @@ const EstimateForm = ({
)}>
<form onSubmit={formik.handleSubmit}>
<EstimateFormHeader formik={formik} />
<EstimatesItemsTable
<EntriesItemsTable
entries={formik.values.entries}
onClickAddNewRow={handleClickAddNewRow}
onClickClearAllLines={handleClearAllLines}
@@ -349,7 +349,7 @@ const EstimateForm = ({
</Row>
</div>
</form>
<EstimateFormFooter
<EstimateFloatingActions
formik={formik}
onSubmitClick={handleSubmitClick}
estimate={estimate}