mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 14:50:32 +00:00
Merge pull request #604 from bigcapitalhq/inconsistance-pagination-page-size
fix: inconsistance page size of paginated data tables
This commit is contained in:
@@ -60,7 +60,7 @@ export function DataTable(props) {
|
|||||||
|
|
||||||
// Pagination props.
|
// Pagination props.
|
||||||
initialPageIndex = 0,
|
initialPageIndex = 0,
|
||||||
initialPageSize = 10,
|
initialPageSize = 20,
|
||||||
|
|
||||||
updateDebounceTime = 200,
|
updateDebounceTime = 200,
|
||||||
selectionColumnWidth = 42,
|
selectionColumnWidth = 42,
|
||||||
|
|||||||
@@ -125,8 +125,9 @@ function ManualJournalsDataTable({
|
|||||||
loading={isManualJournalsLoading}
|
loading={isManualJournalsLoading}
|
||||||
headerLoading={isManualJournalsLoading}
|
headerLoading={isManualJournalsLoading}
|
||||||
progressBarLoading={isManualJournalsFetching}
|
progressBarLoading={isManualJournalsFetching}
|
||||||
pagesCount={pagination.pagesCount}
|
|
||||||
pagination={true}
|
pagination={true}
|
||||||
|
initialPageSize={manualJournalsTableState.pageSize}
|
||||||
|
pagesCount={pagination.pagesCount}
|
||||||
autoResetSortBy={false}
|
autoResetSortBy={false}
|
||||||
autoResetPage={false}
|
autoResetPage={false}
|
||||||
TableLoadingRenderer={TableSkeletonRows}
|
TableLoadingRenderer={TableSkeletonRows}
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ function CustomersTable({
|
|||||||
sticky={true}
|
sticky={true}
|
||||||
spinnerProps={{ size: 30 }}
|
spinnerProps={{ size: 30 }}
|
||||||
pagination={true}
|
pagination={true}
|
||||||
|
initialPageSize={customersTableState.pageSize}
|
||||||
manualSortBy={true}
|
manualSortBy={true}
|
||||||
manualPagination={true}
|
manualPagination={true}
|
||||||
pagesCount={pagination.pagesCount}
|
pagesCount={pagination.pagesCount}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import withExpensesActions from './withExpensesActions';
|
|||||||
import withAlertsActions from '@/containers/Alert/withAlertActions';
|
import withAlertsActions from '@/containers/Alert/withAlertActions';
|
||||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||||
import withSettings from '@/containers/Settings/withSettings';
|
import withSettings from '@/containers/Settings/withSettings';
|
||||||
|
import withExpenses from './withExpenses';
|
||||||
|
|
||||||
import { ActionsMenu, useExpensesTableColumns } from './components';
|
import { ActionsMenu, useExpensesTableColumns } from './components';
|
||||||
import { DRAWERS } from '@/constants/drawers';
|
import { DRAWERS } from '@/constants/drawers';
|
||||||
@@ -39,6 +40,9 @@ function ExpensesDataTable({
|
|||||||
|
|
||||||
// #withSettings
|
// #withSettings
|
||||||
expensesTableSize,
|
expensesTableSize,
|
||||||
|
|
||||||
|
// #withExpenses
|
||||||
|
expensesTableState
|
||||||
}) {
|
}) {
|
||||||
// Expenses list context.
|
// Expenses list context.
|
||||||
const {
|
const {
|
||||||
@@ -116,6 +120,7 @@ function ExpensesDataTable({
|
|||||||
sticky={true}
|
sticky={true}
|
||||||
onFetchData={handleFetchData}
|
onFetchData={handleFetchData}
|
||||||
pagination={true}
|
pagination={true}
|
||||||
|
initialPageSize={expensesTableState.pageSize}
|
||||||
manualSortBy={true}
|
manualSortBy={true}
|
||||||
manualPagination={true}
|
manualPagination={true}
|
||||||
pagesCount={pagination.pagesCount}
|
pagesCount={pagination.pagesCount}
|
||||||
@@ -147,4 +152,5 @@ export default compose(
|
|||||||
withSettings(({ expenseSettings }) => ({
|
withSettings(({ expenseSettings }) => ({
|
||||||
expensesTableSize: expenseSettings?.tableSize,
|
expensesTableSize: expenseSettings?.tableSize,
|
||||||
})),
|
})),
|
||||||
|
withExpenses(({ expensesTableState }) => ({ expensesTableState }))
|
||||||
)(ExpensesDataTable);
|
)(ExpensesDataTable);
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ function InventoryAdjustmentDataTable({
|
|||||||
manualSortBy={true}
|
manualSortBy={true}
|
||||||
selectionColumn={true}
|
selectionColumn={true}
|
||||||
pagination={true}
|
pagination={true}
|
||||||
|
initialPageSize={inventoryAdjustmentTableState.pageSize}
|
||||||
pagesCount={pagination.pagesCount}
|
pagesCount={pagination.pagesCount}
|
||||||
autoResetSortBy={false}
|
autoResetSortBy={false}
|
||||||
autoResetPage={false}
|
autoResetPage={false}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import withAlertsActions from '@/containers/Alert/withAlertActions';
|
|||||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||||
import withSettings from '@/containers/Settings/withSettings';
|
import withSettings from '@/containers/Settings/withSettings';
|
||||||
|
import withItems from './withItems';
|
||||||
|
|
||||||
import { useItemsListContext } from './ItemsListProvider';
|
import { useItemsListContext } from './ItemsListProvider';
|
||||||
import { useItemsTableColumns, ItemsActionMenuList } from './components';
|
import { useItemsTableColumns, ItemsActionMenuList } from './components';
|
||||||
@@ -43,6 +44,9 @@ function ItemsDataTable({
|
|||||||
// #withSettings
|
// #withSettings
|
||||||
itemsTableSize,
|
itemsTableSize,
|
||||||
|
|
||||||
|
// #withItems
|
||||||
|
itemsTableState,
|
||||||
|
|
||||||
// #ownProps
|
// #ownProps
|
||||||
tableProps,
|
tableProps,
|
||||||
}) {
|
}) {
|
||||||
@@ -137,6 +141,7 @@ function ItemsDataTable({
|
|||||||
sticky={true}
|
sticky={true}
|
||||||
rowClassNames={rowClassNames}
|
rowClassNames={rowClassNames}
|
||||||
pagination={true}
|
pagination={true}
|
||||||
|
initialPageSize={itemsTableState.pageSize}
|
||||||
manualSortBy={true}
|
manualSortBy={true}
|
||||||
manualPagination={true}
|
manualPagination={true}
|
||||||
pagesCount={pagination.pagesCount}
|
pagesCount={pagination.pagesCount}
|
||||||
@@ -174,4 +179,5 @@ export default compose(
|
|||||||
withSettings(({ itemsSettings }) => ({
|
withSettings(({ itemsSettings }) => ({
|
||||||
itemsTableSize: itemsSettings.tableSize,
|
itemsTableSize: itemsSettings.tableSize,
|
||||||
})),
|
})),
|
||||||
|
withItems(({ itemsTableState }) => ({ itemsTableState }))
|
||||||
)(ItemsDataTable);
|
)(ItemsDataTable);
|
||||||
|
|||||||
@@ -130,6 +130,7 @@ function BillsDataTable({
|
|||||||
noInitialFetch={true}
|
noInitialFetch={true}
|
||||||
sticky={true}
|
sticky={true}
|
||||||
pagination={true}
|
pagination={true}
|
||||||
|
initialPageSize={billsTableState.pageSize}
|
||||||
pagesCount={pagination.pagesCount}
|
pagesCount={pagination.pagesCount}
|
||||||
TableLoadingRenderer={TableSkeletonRows}
|
TableLoadingRenderer={TableSkeletonRows}
|
||||||
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import withAlertsActions from '@/containers/Alert/withAlertActions';
|
|||||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||||
import withVendorsCreditNotesActions from './withVendorsCreditNotesActions';
|
import withVendorsCreditNotesActions from './withVendorsCreditNotesActions';
|
||||||
|
import withVendorsCreditNotes from './withVendorsCreditNotes';
|
||||||
import withSettings from '@/containers/Settings/withSettings';
|
import withSettings from '@/containers/Settings/withSettings';
|
||||||
|
|
||||||
import { useVendorsCreditNoteTableColumns, ActionsMenu } from './components';
|
import { useVendorsCreditNoteTableColumns, ActionsMenu } from './components';
|
||||||
@@ -32,6 +33,9 @@ function VendorsCreditNoteDataTable({
|
|||||||
// #withVendorsCreditNotesActions
|
// #withVendorsCreditNotesActions
|
||||||
setVendorsCreditNoteTableState,
|
setVendorsCreditNoteTableState,
|
||||||
|
|
||||||
|
// #withVendorCredits
|
||||||
|
vendorsCreditNoteTableState,
|
||||||
|
|
||||||
// #withAlertsActions
|
// #withAlertsActions
|
||||||
openAlert,
|
openAlert,
|
||||||
|
|
||||||
@@ -129,6 +133,7 @@ function VendorsCreditNoteDataTable({
|
|||||||
noInitialFetch={true}
|
noInitialFetch={true}
|
||||||
sticky={true}
|
sticky={true}
|
||||||
pagination={true}
|
pagination={true}
|
||||||
|
initialPageSize={vendorsCreditNoteTableState.pageSize}
|
||||||
pagesCount={pagination.pagesCount}
|
pagesCount={pagination.pagesCount}
|
||||||
TableLoadingRenderer={TableSkeletonRows}
|
TableLoadingRenderer={TableSkeletonRows}
|
||||||
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
||||||
@@ -159,4 +164,7 @@ export default compose(
|
|||||||
withSettings(({ vendorsCreditNoteSetting }) => ({
|
withSettings(({ vendorsCreditNoteSetting }) => ({
|
||||||
creditNoteTableSize: vendorsCreditNoteSetting?.tableSize,
|
creditNoteTableSize: vendorsCreditNoteSetting?.tableSize,
|
||||||
})),
|
})),
|
||||||
|
withVendorsCreditNotes(({ vendorsCreditNoteTableState }) => ({
|
||||||
|
vendorsCreditNoteTableState,
|
||||||
|
})),
|
||||||
)(VendorsCreditNoteDataTable);
|
)(VendorsCreditNoteDataTable);
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ function PaymentMadesTable({
|
|||||||
noInitialFetch={true}
|
noInitialFetch={true}
|
||||||
sticky={true}
|
sticky={true}
|
||||||
pagination={true}
|
pagination={true}
|
||||||
|
initialPageSize={paymentMadesTableState.pageSize}
|
||||||
pagesCount={pagination.pagesCount}
|
pagesCount={pagination.pagesCount}
|
||||||
autoResetSortBy={false}
|
autoResetSortBy={false}
|
||||||
autoResetPage={false}
|
autoResetPage={false}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import withAlertsActions from '@/containers/Alert/withAlertActions';
|
|||||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||||
import withSettings from '@/containers/Settings/withSettings';
|
import withSettings from '@/containers/Settings/withSettings';
|
||||||
|
import withCreditNotes from './withCreditNotes';
|
||||||
|
|
||||||
import { useCreditNoteTableColumns, ActionsMenu } from './components';
|
import { useCreditNoteTableColumns, ActionsMenu } from './components';
|
||||||
import { useCreditNoteListContext } from './CreditNotesListProvider';
|
import { useCreditNoteListContext } from './CreditNotesListProvider';
|
||||||
@@ -44,6 +45,9 @@ function CreditNotesDataTable({
|
|||||||
|
|
||||||
// #withSettings
|
// #withSettings
|
||||||
creditNoteTableSize,
|
creditNoteTableSize,
|
||||||
|
|
||||||
|
// #withCreditNotes
|
||||||
|
creditNoteTableState
|
||||||
}) {
|
}) {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
@@ -129,6 +133,7 @@ function CreditNotesDataTable({
|
|||||||
noInitialFetch={true}
|
noInitialFetch={true}
|
||||||
sticky={true}
|
sticky={true}
|
||||||
pagination={true}
|
pagination={true}
|
||||||
|
initialPageSize={creditNoteTableState.pageSize}
|
||||||
pagesCount={pagination.pagesCount}
|
pagesCount={pagination.pagesCount}
|
||||||
TableLoadingRenderer={TableSkeletonRows}
|
TableLoadingRenderer={TableSkeletonRows}
|
||||||
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
||||||
@@ -159,4 +164,5 @@ export default compose(
|
|||||||
withSettings(({ creditNoteSettings }) => ({
|
withSettings(({ creditNoteSettings }) => ({
|
||||||
creditNoteTableSize: creditNoteSettings?.tableSize,
|
creditNoteTableSize: creditNoteSettings?.tableSize,
|
||||||
})),
|
})),
|
||||||
|
withCreditNotes(({ creditNoteTableState }) => ({ creditNoteTableState }))
|
||||||
)(CreditNotesDataTable);
|
)(CreditNotesDataTable);
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import withAlertsActions from '@/containers/Alert/withAlertActions';
|
|||||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||||
import withSettings from '@/containers/Settings/withSettings';
|
import withSettings from '@/containers/Settings/withSettings';
|
||||||
|
import withEstimates from './withEstimates';
|
||||||
|
|
||||||
import { TABLES } from '@/constants/tables';
|
import { TABLES } from '@/constants/tables';
|
||||||
import {
|
import {
|
||||||
@@ -42,6 +43,9 @@ function EstimatesDataTable({
|
|||||||
|
|
||||||
// #withSettings
|
// #withSettings
|
||||||
estimatesTableSize,
|
estimatesTableSize,
|
||||||
|
|
||||||
|
// #withEstimates
|
||||||
|
estimatesTableState
|
||||||
}) {
|
}) {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
@@ -141,6 +145,7 @@ function EstimatesDataTable({
|
|||||||
selectionColumn={true}
|
selectionColumn={true}
|
||||||
sticky={true}
|
sticky={true}
|
||||||
pagination={true}
|
pagination={true}
|
||||||
|
initialPageSize={estimatesTableState.pageSize}
|
||||||
manualPagination={true}
|
manualPagination={true}
|
||||||
pagesCount={pagination.pagesCount}
|
pagesCount={pagination.pagesCount}
|
||||||
TableLoadingRenderer={TableSkeletonRows}
|
TableLoadingRenderer={TableSkeletonRows}
|
||||||
@@ -174,4 +179,5 @@ export default compose(
|
|||||||
withSettings(({ estimatesSettings }) => ({
|
withSettings(({ estimatesSettings }) => ({
|
||||||
estimatesTableSize: estimatesSettings?.tableSize,
|
estimatesTableSize: estimatesSettings?.tableSize,
|
||||||
})),
|
})),
|
||||||
|
withEstimates(({ estimatesTableState }) => ({ estimatesTableState }))
|
||||||
)(EstimatesDataTable);
|
)(EstimatesDataTable);
|
||||||
|
|||||||
@@ -144,6 +144,7 @@ function InvoicesDataTable({
|
|||||||
noInitialFetch={true}
|
noInitialFetch={true}
|
||||||
sticky={true}
|
sticky={true}
|
||||||
pagination={true}
|
pagination={true}
|
||||||
|
initialPageSize={invoicesTableState.pageSize}
|
||||||
manualPagination={true}
|
manualPagination={true}
|
||||||
pagesCount={pagination.pagesCount}
|
pagesCount={pagination.pagesCount}
|
||||||
autoResetSortBy={false}
|
autoResetSortBy={false}
|
||||||
|
|||||||
@@ -33,6 +33,9 @@ function PaymentsReceivedDataTable({
|
|||||||
// #withPaymentsReceivedActions
|
// #withPaymentsReceivedActions
|
||||||
setPaymentReceivesTableState,
|
setPaymentReceivesTableState,
|
||||||
|
|
||||||
|
// #withPaymentsReceived
|
||||||
|
paymentReceivesTableState,
|
||||||
|
|
||||||
// #withAlertsActions
|
// #withAlertsActions
|
||||||
openAlert,
|
openAlert,
|
||||||
|
|
||||||
@@ -124,6 +127,7 @@ function PaymentsReceivedDataTable({
|
|||||||
autoResetSortBy={false}
|
autoResetSortBy={false}
|
||||||
autoResetPage={false}
|
autoResetPage={false}
|
||||||
pagination={true}
|
pagination={true}
|
||||||
|
initialPageSize={paymentReceivesTableState.pageSize}
|
||||||
pagesCount={pagination.pagesCount}
|
pagesCount={pagination.pagesCount}
|
||||||
TableLoadingRenderer={TableSkeletonRows}
|
TableLoadingRenderer={TableSkeletonRows}
|
||||||
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
||||||
|
|||||||
@@ -130,6 +130,7 @@ function ReceiptsDataTable({
|
|||||||
noInitialFetch={true}
|
noInitialFetch={true}
|
||||||
sticky={true}
|
sticky={true}
|
||||||
pagination={true}
|
pagination={true}
|
||||||
|
initialPageSize={receiptTableState.pageSize}
|
||||||
pagesCount={pagination.pagesCount}
|
pagesCount={pagination.pagesCount}
|
||||||
manualPagination={true}
|
manualPagination={true}
|
||||||
autoResetSortBy={false}
|
autoResetSortBy={false}
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ function VendorsTable({
|
|||||||
expandable={false}
|
expandable={false}
|
||||||
sticky={true}
|
sticky={true}
|
||||||
pagination={true}
|
pagination={true}
|
||||||
|
initialPageSize={vendorsTableState.pageSize}
|
||||||
manualSortBy={true}
|
manualSortBy={true}
|
||||||
pagesCount={pagination.pagesCount}
|
pagesCount={pagination.pagesCount}
|
||||||
autoResetSortBy={false}
|
autoResetSortBy={false}
|
||||||
|
|||||||
Reference in New Issue
Block a user