diff --git a/client/src/common/tables.js b/client/src/common/tables.js new file mode 100644 index 000000000..2e5e51ba8 --- /dev/null +++ b/client/src/common/tables.js @@ -0,0 +1,15 @@ +export const TABLES = { + ITEMS: 'items', + INVENTORY_ADJUSTMENTS: 'inventory_adjustment', + ESTIMATES: 'estimates', + INVOICES: 'invoices', + RECEIPTS: 'receipts', + PAYMENT_RECEIVES: 'payment_receives', + BILLS: 'bills', + PAYMENT_MADES: 'payment_mades', + CUSTOMER: 'customers', + VENDORS: 'vendors', + ACCOUNTS: 'accounts', + MANUAL_JOURNALS: 'manual_journal', + EXPENSES: 'expenses', +}; diff --git a/client/src/containers/Accounting/JournalsLanding/ManualJournalsDataTable.js b/client/src/containers/Accounting/JournalsLanding/ManualJournalsDataTable.js index 9e9a8d4b7..4b5efad04 100644 --- a/client/src/containers/Accounting/JournalsLanding/ManualJournalsDataTable.js +++ b/client/src/containers/Accounting/JournalsLanding/ManualJournalsDataTable.js @@ -2,10 +2,12 @@ import React from 'react'; import { useHistory } from 'react-router-dom'; import { DataTable, DashboardContentTable } from 'components'; +import { TABLES } from 'common/tables'; import ManualJournalsEmptyStatus from './ManualJournalsEmptyStatus'; import TableSkeletonRows from 'components/Datatable/TableSkeletonRows'; import TableSkeletonHeader from 'components/Datatable/TableHeaderSkeleton'; +import { ActionsMenu } from './components'; import withManualJournals from './withManualJournals'; import withManualJournalsActions from './withManualJournalsActions'; @@ -13,8 +15,8 @@ import withAlertsActions from 'containers/Alert/withAlertActions'; import withDrawerActions from 'containers/Drawer/withDrawerActions'; import { useManualJournalsContext } from './ManualJournalsListProvider'; +import { useMemorizedColumnsWidths } from 'hooks'; import { useManualJournalsColumns } from './utils'; -import { ActionsMenu } from './components'; import { compose } from 'utils'; @@ -78,6 +80,10 @@ function ManualJournalsDataTable({ openDrawer('journal-drawer', { manualJournalId: cell.row.original.id }); }; + // Local storage memorizing columns widths. + const [initialColumnsWidths, , handleColumnResizing] = + useMemorizedColumnsWidths(TABLES.MANUAL_JOURNALS); + // Handle fetch data once the page index, size or sort by of the table change. const handleFetchData = React.useCallback( ({ pageSize, pageIndex, sortBy }) => { @@ -101,7 +107,6 @@ function ManualJournalsDataTable({ noInitialFetch={true} columns={columns} data={manualJournals} - initialState={manualJournalsTableState} manualSortBy={true} selectionColumn={true} expandable={true} @@ -118,6 +123,8 @@ function ManualJournalsDataTable({ ContextMenu={ActionsMenu} onFetchData={handleFetchData} onCellClick={handleCellClick} + initialColumnsWidths={initialColumnsWidths} + onColumnResizing={handleColumnResizing} payload={{ onDelete: handleDeleteJournal, onPublish: handlePublishJournal, diff --git a/client/src/containers/Accounts/AccountsDataTable.js b/client/src/containers/Accounts/AccountsDataTable.js index a51fa1d75..e004d501d 100644 --- a/client/src/containers/Accounts/AccountsDataTable.js +++ b/client/src/containers/Accounts/AccountsDataTable.js @@ -5,18 +5,19 @@ import { compose } from 'utils'; import { useAccountsTableColumns, rowClassNames } from './utils'; import { ActionsMenu } from './components'; +import { TABLES } from 'common/tables'; import TableVirtualizedListRows from 'components/Datatable/TableVirtualizedRows'; import TableSkeletonRows from 'components/Datatable/TableSkeletonRows'; import TableSkeletonHeader from 'components/Datatable/TableHeaderSkeleton'; + import { useAccountsChartContext } from './AccountsChartProvider'; +import { useMemorizedColumnsWidths } from '../../hooks'; import withAlertsActions from 'containers/Alert/withAlertActions'; import withDialogActions from 'containers/Dialog/withDialogActions'; import withDrawerActions from 'containers/Drawer/withDrawerActions'; -import { useMemorizedColumnsWidths } from '../../hooks'; - /** * Accounts data-table. */ @@ -51,12 +52,6 @@ function AccountsDataTable({ openAlert('account-inactivate', { accountId: account.id }); }; - // Handle select accounts datatable rows. - // const handleSelectedRowsChange = (selectedRows) => { - // const selectedRowsIds = selectedRows.map((r) => r.id); - // setSelectedRowsAccounts(selectedRowsIds); - // }; - // Handle edit account action. const handleEditAccount = (account) => { openDialog('account-form', { action: 'edit', id: account.id }); @@ -81,7 +76,7 @@ function AccountsDataTable({ }; // Local storage memorizing columns widths. const [initialColumnsWidths, , handleColumnResizing] = - useMemorizedColumnsWidths('accounts'); + useMemorizedColumnsWidths(TABLES.ACCOUNTS); return ( () => { - setCustomersTableState({ - filterRoles: [], - viewSlug: '', - pageIndex: 0, - }); + resetCustomersTableState(); }, - [setCustomersTableState], + [resetCustomersTableState], ); return ( diff --git a/client/src/containers/Customers/CustomersLanding/CustomersTable.js b/client/src/containers/Customers/CustomersLanding/CustomersTable.js index 7cdf61560..317468215 100644 --- a/client/src/containers/Customers/CustomersLanding/CustomersTable.js +++ b/client/src/containers/Customers/CustomersLanding/CustomersTable.js @@ -5,7 +5,9 @@ import CustomersEmptyStatus from './CustomersEmptyStatus'; import TableSkeletonRows from 'components/Datatable/TableSkeletonRows'; import TableSkeletonHeader from 'components/Datatable/TableHeaderSkeleton'; +import { TABLES } from 'common/tables'; import { DataTable, DashboardContentTable } from 'components'; +import { ActionsMenu, useCustomersTableColumns } from './components'; import withCustomers from './withCustomers'; import withCustomersActions from './withCustomersActions'; @@ -14,7 +16,7 @@ import withDialogActions from 'containers/Dialog/withDialogActions'; import withDrawerActions from 'containers/Drawer/withDrawerActions'; import { useCustomersListContext } from './CustomersListProvider'; -import { ActionsMenu, useCustomersTableColumns } from './components'; +import { useMemorizedColumnsWidths } from 'hooks'; import { compose } from 'utils'; @@ -51,6 +53,10 @@ function CustomersTable({ isCustomersFetching, } = useCustomersListContext(); + // Local storage memorizing columns widths. + const [initialColumnsWidths, , handleColumnResizing] = + useMemorizedColumnsWidths(TABLES.CUSTOMERS); + // Handle fetch data once the page index, size or sort by of the table change. const handleFetchData = React.useCallback( ({ pageSize, pageIndex, sortBy }) => { @@ -110,7 +116,6 @@ function CustomersTable({ noInitialFetch={true} columns={columns} data={customers} - initialState={customersTableState} loading={isCustomersLoading} headerLoading={isCustomersLoading} progressBarLoading={isCustomersFetching} @@ -128,6 +133,8 @@ function CustomersTable({ TableLoadingRenderer={TableSkeletonRows} TableHeaderSkeletonRenderer={TableSkeletonHeader} onCellClick={handleCellClick} + initialColumnsWidths={initialColumnsWidths} + onColumnResizing={handleColumnResizing} payload={{ onDelete: handleCustomerDelete, onEdit: handleCustomerEdit, diff --git a/client/src/containers/Customers/CustomersLanding/withCustomersActions.js b/client/src/containers/Customers/CustomersLanding/withCustomersActions.js index 8736d34dc..8a3e71b0a 100644 --- a/client/src/containers/Customers/CustomersLanding/withCustomersActions.js +++ b/client/src/containers/Customers/CustomersLanding/withCustomersActions.js @@ -1,10 +1,12 @@ import { connect } from 'react-redux'; import { - setCustomersTableState + setCustomersTableState, + resetCustomersTableState } from 'store/customers/customers.actions'; export const mapDispatchToProps = (dispatch) => ({ setCustomersTableState: (state) => dispatch(setCustomersTableState(state)), + resetCustomersTableState: () => dispatch(resetCustomersTableState()), }); export default connect(null, mapDispatchToProps); diff --git a/client/src/containers/Expenses/ExpensesLanding/ExpenseDataTable.js b/client/src/containers/Expenses/ExpensesLanding/ExpenseDataTable.js index d433d20ac..d85b7dd72 100644 --- a/client/src/containers/Expenses/ExpensesLanding/ExpenseDataTable.js +++ b/client/src/containers/Expenses/ExpensesLanding/ExpenseDataTable.js @@ -3,6 +3,8 @@ import { useHistory } from 'react-router-dom'; import { compose } from 'utils'; import { useExpensesListContext } from './ExpensesListProvider'; +import { useMemorizedColumnsWidths } from 'hooks'; +import { TABLES } from 'common/tables'; import { DashboardContentTable } from 'components'; import DataTable from 'components/DataTable'; @@ -45,6 +47,10 @@ function ExpensesDataTable({ // Expenses table columns. const columns = useExpensesTableColumns(); + // Local storage memorizing columns widths. + const [initialColumnsWidths, , handleColumnResizing] = + useMemorizedColumnsWidths(TABLES.EXPENSES); + // Handle fetch data of manual jouranls datatable. const handleFetchData = useCallback( ({ pageIndex, pageSize, sortBy }) => { @@ -111,6 +117,8 @@ function ExpensesDataTable({ TableHeaderSkeletonRenderer={TableSkeletonHeader} ContextMenu={ActionsMenu} onCellClick={handleCellClick} + initialColumnsWidths={initialColumnsWidths} + onColumnResizing={handleColumnResizing} payload={{ onPublish: handlePublishExpense, onDelete: handleDeleteExpense, diff --git a/client/src/containers/Expenses/ExpensesLanding/ExpensesList.js b/client/src/containers/Expenses/ExpensesLanding/ExpensesList.js index 5bbbc1948..188057ea9 100644 --- a/client/src/containers/Expenses/ExpensesLanding/ExpensesList.js +++ b/client/src/containers/Expenses/ExpensesLanding/ExpensesList.js @@ -24,18 +24,14 @@ function ExpensesList({ expensesTableStateChanged, // #withExpensesActions - setExpensesTableState, + resetExpensesTableState, }) { // Resets the accounts table state once the page unmount. useEffect( () => () => { - setExpensesTableState({ - filterRoles: [], - viewSlug: '', - pageIndex: 0, - }); + resetExpensesTableState(); }, - [setExpensesTableState], + [resetExpensesTableState], ); return ( diff --git a/client/src/containers/InventoryAdjustments/InventoryAdjustmentTable.js b/client/src/containers/InventoryAdjustments/InventoryAdjustmentTable.js index 4f4af0535..84de96b1f 100644 --- a/client/src/containers/InventoryAdjustments/InventoryAdjustmentTable.js +++ b/client/src/containers/InventoryAdjustments/InventoryAdjustmentTable.js @@ -1,14 +1,18 @@ import React, { useCallback } from 'react'; -import { DataTable } from 'components'; -import { useInventoryAdjustmentsColumns, ActionsMenu } from './components'; import intl from 'react-intl-universal'; +import { DataTable } from 'components'; +import { TABLES } from 'common/tables'; + +import { useInventoryAdjustmentsColumns, ActionsMenu } from './components'; +import { useMemorizedColumnsWidths } from 'hooks'; +import { useInventoryAdjustmentsContext } from './InventoryAdjustmentsProvider'; + import withAlertsActions from 'containers/Alert/withAlertActions'; import withDrawerActions from 'containers/Drawer/withDrawerActions'; import withInventoryAdjustmentActions from './withInventoryAdjustmentActions'; - -import { useInventoryAdjustmentsContext } from './InventoryAdjustmentsProvider'; import withInventoryAdjustments from './withInventoryAdjustments'; + import { compose } from 'utils'; /** @@ -55,6 +59,9 @@ function InventoryAdjustmentDataTable({ // Inventory adjustments columns. const columns = useInventoryAdjustmentsColumns(); + const [initialColumnsWidths, , handleColumnResizing] = + useMemorizedColumnsWidths(TABLES.INVENTORY_ADJUSTMENTS); + // Handle the table fetch data once states changing. const handleDataTableFetchData = useCallback( ({ pageSize, pageIndex, sortBy }) => { @@ -79,7 +86,6 @@ function InventoryAdjustmentDataTable({ loading={isAdjustmentsLoading} headerLoading={isAdjustmentsLoading} progressBarLoading={isAdjustmentsFetching} - initialState={inventoryAdjustmentTableState} noInitialFetch={true} onFetchData={handleDataTableFetchData} manualSortBy={true} @@ -89,6 +95,8 @@ function InventoryAdjustmentDataTable({ autoResetSortBy={false} autoResetPage={false} onCellClick={handleCellClick} + initialColumnsWidths={initialColumnsWidths} + onColumnResizing={handleColumnResizing} payload={{ onDelete: handleDeleteAdjustment, onPublish: handlePublishInventoryAdjustment, diff --git a/client/src/containers/Items/ItemsDataTable.js b/client/src/containers/Items/ItemsDataTable.js index 50a370025..bbaf51d11 100644 --- a/client/src/containers/Items/ItemsDataTable.js +++ b/client/src/containers/Items/ItemsDataTable.js @@ -8,6 +8,8 @@ import ItemsEmptyStatus from './ItemsEmptyStatus'; import TableSkeletonRows from 'components/Datatable/TableSkeletonRows'; import TableSkeletonHeader from 'components/Datatable/TableHeaderSkeleton'; +import { TABLES } from 'common/tables'; + import withItems from 'containers/Items/withItems'; import withItemsActions from 'containers/Items/withItemsActions'; import withAlertsActions from 'containers/Alert/withAlertActions'; @@ -16,6 +18,7 @@ import withDrawerActions from 'containers/Drawer/withDrawerActions'; import { useItemsListContext } from './ItemsListProvider'; import { useItemsTableColumns, ItemsActionMenuList } from './components'; +import { useMemorizedColumnsWidths } from 'hooks'; import { compose } from 'utils'; /** @@ -55,6 +58,10 @@ function ItemsDataTable({ inactive: !row.original.active, }); + // Local storage memorizing columns widths. + const [initialColumnsWidths, , handleColumnResizing] = + useMemorizedColumnsWidths(TABLES.ITEMS); + // Handle fetch data once the page index, size or sort by of the table change. const handleFetchData = React.useCallback( ({ pageSize, pageIndex, sortBy }) => { @@ -117,7 +124,6 @@ function ItemsDataTable({ () => { - setBillsTableState({ - filterRoles: [], - viewSlug: '', - pageIndex: 0, - }); + resetBillsTableState(); }, - [setBillsTableState], + [resetBillsTableState], ); return ( diff --git a/client/src/containers/Purchases/Bills/BillsLanding/BillsTable.js b/client/src/containers/Purchases/Bills/BillsLanding/BillsTable.js index 2875d1821..c232c62f1 100644 --- a/client/src/containers/Purchases/Bills/BillsLanding/BillsTable.js +++ b/client/src/containers/Purchases/Bills/BillsLanding/BillsTable.js @@ -1,9 +1,9 @@ import React, { useCallback } from 'react'; import { useHistory } from 'react-router-dom'; -import { compose } from 'utils'; - import DataTable from 'components/DataTable'; + +import { TABLES } from 'common/tables'; import { DashboardContentTable } from 'components'; import TableSkeletonRows from 'components/Datatable/TableSkeletonRows'; import TableSkeletonHeader from 'components/Datatable/TableHeaderSkeleton'; @@ -15,8 +15,12 @@ import withBillActions from './withBillsActions'; import withAlertsActions from 'containers/Alert/withAlertActions'; import withDialogActions from 'containers/Dialog/withDialogActions'; import withDrawerActions from 'containers/Drawer/withDrawerActions'; + import { useBillsTableColumns, ActionsMenu } from './components'; import { useBillsListContext } from './BillsListProvider'; +import { useMemorizedColumnsWidths } from 'hooks'; + +import { compose } from 'utils'; /** * Bills transactions datatable. @@ -92,39 +96,44 @@ function BillsDataTable({ openDrawer('bill-drawer', { billId: cell.row.original.id }); }; + // Local storage memorizing columns widths. + const [initialColumnsWidths, , handleColumnResizing] = + useMemorizedColumnsWidths(TABLES.BILLS); + if (isEmptyStatus) { return ; } return ( - + ); } diff --git a/client/src/containers/Purchases/PaymentMades/PaymentsLanding/PaymentMadesTable.js b/client/src/containers/Purchases/PaymentMades/PaymentsLanding/PaymentMadesTable.js index bc362e56b..2fae9a6c0 100644 --- a/client/src/containers/Purchases/PaymentMades/PaymentsLanding/PaymentMadesTable.js +++ b/client/src/containers/Purchases/PaymentMades/PaymentsLanding/PaymentMadesTable.js @@ -3,6 +3,7 @@ import { useHistory } from 'react-router-dom'; import { compose } from 'utils'; +import { TABLES } from 'common/tables'; import { DataTable, DashboardContentTable } from 'components'; import PaymentMadesEmptyStatus from './PaymentMadesEmptyStatus'; @@ -15,8 +16,10 @@ import withCurrentOrganization from 'containers/Organization/withCurrentOrganiza import withAlertsActions from 'containers/Alert/withAlertActions'; import withDrawerActions from 'containers/Drawer/withDrawerActions'; + import { usePaymentMadesTableColumns, ActionsMenu } from './components'; import { usePaymentMadesListContext } from './PaymentMadesListProvider'; +import { useMemorizedColumnsWidths } from 'hooks'; /** * Payment made datatable transactions. @@ -71,6 +74,10 @@ function PaymentMadesTable({ }); }; + // Local storage memorizing columns widths. + const [initialColumnsWidths, , handleColumnResizing] = + useMemorizedColumnsWidths(TABLES.PAYMENT_MADES); + // Handle datatable fetch data once the table state change. const handleDataTableFetchData = useCallback( ({ pageIndex, pageSize, sortBy }) => { @@ -89,7 +96,6 @@ function PaymentMadesTable({ { openDrawer('estimate-detail-drawer', { estimateId: cell.row.original.id }); }; + + // Local storage memorizing columns widths. + const [initialColumnsWidths, , handleColumnResizing] = + useMemorizedColumnsWidths(TABLES.ESTIMATES); + // Handles fetch data. const handleFetchData = useCallback( ({ pageIndex, pageSize, sortBy }) => { @@ -126,6 +133,8 @@ function EstimatesDataTable({ TableHeaderSkeletonRenderer={TableSkeletonHeader} ContextMenu={ActionsMenu} onCellClick={handleCellClick} + initialColumnsWidths={initialColumnsWidths} + onColumnResizing={handleColumnResizing} payload={{ onApprove: handleApproveEstimate, onEdit: handleEditEstimate, diff --git a/client/src/containers/Sales/Invoices/InvoicesLanding/InvoicesDataTable.js b/client/src/containers/Sales/Invoices/InvoicesLanding/InvoicesDataTable.js index 081964ee4..407e553d0 100644 --- a/client/src/containers/Sales/Invoices/InvoicesLanding/InvoicesDataTable.js +++ b/client/src/containers/Sales/Invoices/InvoicesLanding/InvoicesDataTable.js @@ -3,8 +3,10 @@ import { useHistory } from 'react-router-dom'; import InvoicesEmptyStatus from './InvoicesEmptyStatus'; -import { compose } from 'utils'; import { DataTable, DashboardContentTable } from 'components'; +import { TABLES } from 'common/tables'; +import { useMemorizedColumnsWidths } from 'hooks'; + import TableSkeletonRows from 'components/Datatable/TableSkeletonRows'; import TableSkeletonHeader from 'components/Datatable/TableHeaderSkeleton'; @@ -18,6 +20,8 @@ import withDialogActions from 'containers/Dialog/withDialogActions'; import { useInvoicesTableColumns, ActionsMenu } from './components'; import { useInvoicesListContext } from './InvoicesListProvider'; +import { compose } from 'utils'; + /** * Invoices datatable. */ @@ -85,6 +89,11 @@ function InvoicesDataTable({ const handleCellClick = (cell, event) => { openDrawer('invoice-detail-drawer', { invoiceId: cell.row.original.id }); }; + + // Local storage memorizing columns widths. + const [initialColumnsWidths, , handleColumnResizing] = + useMemorizedColumnsWidths(TABLES.INVOICES); + // Handles fetch data once the table state change. const handleDataTableFetchData = useCallback( ({ pageSize, pageIndex, sortBy }) => { @@ -107,7 +116,6 @@ function InvoicesDataTable({ { @@ -95,7 +102,6 @@ function PaymentReceivesDataTable({ { @@ -100,7 +106,6 @@ function ReceiptsDataTable({ () => { - setVendorsTableState({ - filterRoles: [], - viewSlug: '', - pageIndex: 0, - }); + resetVendorsTableState(); }, - [setVendorsTableState], + [resetVendorsTableState], ); return ( diff --git a/client/src/containers/Vendors/VendorsLanding/VendorsTable.js b/client/src/containers/Vendors/VendorsLanding/VendorsTable.js index 0a0e8b3f7..2d3640588 100644 --- a/client/src/containers/Vendors/VendorsLanding/VendorsTable.js +++ b/client/src/containers/Vendors/VendorsLanding/VendorsTable.js @@ -1,6 +1,8 @@ import React from 'react'; import { useHistory } from 'react-router'; +import { TABLES } from 'common/tables'; + import { DataTable, DashboardContentTable } from 'components'; import TableSkeletonRows from 'components/Datatable/TableSkeletonRows'; import TableSkeletonHeader from 'components/Datatable/TableHeaderSkeleton'; @@ -8,15 +10,18 @@ import TableSkeletonHeader from 'components/Datatable/TableHeaderSkeleton'; import VendorsEmptyStatus from './VendorsEmptyStatus'; import { useVendorsListContext } from './VendorsListProvider'; +import { useMemorizedColumnsWidths } from 'hooks'; + import withVendorsActions from './withVendorsActions'; import withVendors from './withVendors'; import withAlertsActions from 'containers/Alert/withAlertActions'; import withDialogActions from 'containers/Dialog/withDialogActions'; import withDrawerActions from 'containers/Drawer/withDrawerActions'; -import { compose } from 'utils'; import { ActionsMenu, useVendorsTableColumns } from './components'; +import { compose } from 'utils'; + /** * Vendors table. */ @@ -91,6 +96,10 @@ function VendorsTable({ openDrawer('vendor-details-drawer', { vendorId: cell.row.original.id }); }; + // Local storage memorizing columns widths. + const [initialColumnsWidths, , handleColumnResizing] = + useMemorizedColumnsWidths(TABLES.VENDORS); + // Handle fetch data once the page index, size or sort by of the table change. const handleFetchData = React.useCallback( ({ pageSize, pageIndex, sortBy }) => { @@ -114,7 +123,6 @@ function VendorsTable({ noInitialFetch={true} columns={columns} data={vendors} - initialState={vendorsTableState} loading={isVendorsLoading} headerLoading={isVendorsLoading} progressBarLoading={isVendorsFetching} @@ -131,6 +139,8 @@ function VendorsTable({ TableHeaderSkeletonRenderer={TableSkeletonHeader} ContextMenu={ActionsMenu} onCellClick={handleCellClick} + initialColumnsWidths={initialColumnsWidths} + onColumnResizing={handleColumnResizing} payload={{ onEdit: handleEditVendor, onDelete: handleDeleteVendor, diff --git a/client/src/containers/Vendors/VendorsLanding/withVendorsActions.js b/client/src/containers/Vendors/VendorsLanding/withVendorsActions.js index ecc17d9bf..f5b750592 100644 --- a/client/src/containers/Vendors/VendorsLanding/withVendorsActions.js +++ b/client/src/containers/Vendors/VendorsLanding/withVendorsActions.js @@ -1,8 +1,12 @@ import { connect } from 'react-redux'; -import { setVendorsTableState } from 'store/vendors/vendors.actions'; +import { + setVendorsTableState, + resetVendorsTableState, +} from 'store/vendors/vendors.actions'; const mapDispatchToProps = (dispatch) => ({ setVendorsTableState: (queries) => dispatch(setVendorsTableState(queries)), + resetVendorsTableState: () => dispatch(resetVendorsTableState()), }); export default connect(null, mapDispatchToProps); diff --git a/client/src/store/customers/customers.actions.js b/client/src/store/customers/customers.actions.js index 395288e73..e8eb8d8d3 100644 --- a/client/src/store/customers/customers.actions.js +++ b/client/src/store/customers/customers.actions.js @@ -10,3 +10,8 @@ export const setCustomersTableState = (queries) => { }; }; +export const resetCustomersTableState = () => { + return { + type: t.CUSTOMERS_TABLE_STATE_RESET, + }; +} \ No newline at end of file diff --git a/client/src/store/vendors/vendors.actions.js b/client/src/store/vendors/vendors.actions.js index 6147e2df8..a91167019 100644 --- a/client/src/store/vendors/vendors.actions.js +++ b/client/src/store/vendors/vendors.actions.js @@ -5,4 +5,10 @@ export const setVendorsTableState = (queries) => { type: t.VENDORS_TABLE_STATE_SET, payload: { queries }, }; +} + +export const resetVendorsTableState = () => { + return { + type: t.VENDORS_TABLE_STATE_RESET, + } } \ No newline at end of file diff --git a/client/src/store/vendors/vendors.types.js b/client/src/store/vendors/vendors.types.js index 715b29476..a4ad4e39a 100644 --- a/client/src/store/vendors/vendors.types.js +++ b/client/src/store/vendors/vendors.types.js @@ -1,4 +1,5 @@ export default { VENDORS_TABLE_STATE_SET: 'VENDORS/TABLE_STATE_SET', + VENDORS_TABLE_STATE_RESET: 'VENDORS/TABLE_STATE_RESET', VENDORS_SELECTED_ROWS_SET: 'VENDORS/SELECTED_ROWS_SET', };