feat: WIP advanced filter.

This commit is contained in:
a.bouhuolia
2021-08-10 19:38:36 +02:00
parent aefb89e1c0
commit 23e8e251a1
97 changed files with 2008 additions and 1937 deletions

View File

@@ -9,6 +9,7 @@ import EstimatesViewTabs from './EstimatesViewTabs';
import EstimatesDataTable from './EstimatesDataTable';
import withEstimates from './withEstimates';
import withEstimatesActions from './withEstimatesActions';
import { EstimatesListProvider } from './EstimatesListProvider';
import { compose, transformTableStateToQuery } from 'utils';
@@ -19,7 +20,22 @@ import { compose, transformTableStateToQuery } from 'utils';
function EstimatesList({
// #withEstimate
estimatesTableState,
// #withEstimatesActions
setEstimatesTableState
}) {
// Resets the estimates table state once the page unmount.
React.useEffect(
() => () => {
setEstimatesTableState({
filterRoles: [],
viewSlug: '',
pageIndex: 0,
});
},
[setEstimatesTableState],
);
return (
<EstimatesListProvider
query={transformTableStateToQuery(estimatesTableState)}
@@ -41,4 +57,5 @@ function EstimatesList({
export default compose(
withEstimates(({ estimatesTableState }) => ({ estimatesTableState })),
withEstimatesActions
)(EstimatesList);