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

@@ -1,4 +1,4 @@
import React from 'react';
import React, { useEffect } from 'react';
import { DashboardContentTable, DashboardPageContent } from 'components';
import 'style/pages/Bills/List.scss';
@@ -11,6 +11,7 @@ import BillsViewsTabs from './BillsViewsTabs';
import BillsTable from './BillsTable';
import withBills from './withBills';
import withBillsActions from './withBillsActions';
import { transformTableStateToQuery, compose } from 'utils';
@@ -20,7 +21,22 @@ import { transformTableStateToQuery, compose } from 'utils';
function BillsList({
// #withBills
billsTableState,
// #withBillsActions
setBillsTableState
}) {
// Resets the accounts table state once the page unmount.
useEffect(
() => () => {
setBillsTableState({
filterRoles: [],
viewSlug: '',
pageIndex: 0,
});
},
[setBillsTableState],
);
return (
<BillsListProvider query={transformTableStateToQuery(billsTableState)}>
<BillsActionsBar />
@@ -40,4 +56,5 @@ function BillsList({
export default compose(
withBills(({ billsTableState }) => ({ billsTableState })),
withBillsActions
)(BillsList);