mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 14:50:32 +00:00
feat: change default page size pagination.
This commit is contained in:
@@ -86,7 +86,7 @@ function Pagination({
|
||||
currentPage,
|
||||
total,
|
||||
size,
|
||||
pageSizesOptions = [5, 12, 20, 30, 50, 75, 100, 150],
|
||||
pageSizesOptions = [20, 30, 50, 75, 100, 150],
|
||||
onPageChange,
|
||||
onPageSizeChange,
|
||||
}) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import useApiRequest from '../useRequest';
|
||||
import t from './types';
|
||||
|
||||
const defaultPagination = {
|
||||
pageSize: 12,
|
||||
pageSize: 20,
|
||||
page: 0,
|
||||
pagesCount: 0,
|
||||
};
|
||||
|
||||
@@ -86,7 +86,7 @@ export function useEstimates(query, props) {
|
||||
estimates: [],
|
||||
pagination: {
|
||||
page: 1,
|
||||
pageSize: 12,
|
||||
pageSize: 20,
|
||||
total: 0,
|
||||
},
|
||||
filterMeta: {},
|
||||
|
||||
@@ -5,7 +5,7 @@ import { transformPagination } from 'utils';
|
||||
import useApiRequest from '../useRequest';
|
||||
|
||||
const defaultPagination = {
|
||||
pageSize: 12,
|
||||
pageSize: 20,
|
||||
page: 0,
|
||||
pagesCount: 0,
|
||||
};
|
||||
@@ -82,7 +82,7 @@ export function useExchangeRates(query, props) {
|
||||
exchangesRates: [],
|
||||
pagination: {
|
||||
page: 1,
|
||||
pageSize: 12,
|
||||
pageSize: 20,
|
||||
total: 0,
|
||||
},
|
||||
filterMeta: {},
|
||||
|
||||
@@ -5,7 +5,7 @@ import { transformPagination } from 'utils';
|
||||
import t from './types';
|
||||
|
||||
const defaultPagination = {
|
||||
pageSize: 12,
|
||||
pageSize: 20,
|
||||
page: 0,
|
||||
pagesCount: 0,
|
||||
};
|
||||
|
||||
@@ -76,7 +76,7 @@ export function useInventoryAdjustments(query, props) {
|
||||
transactions: [],
|
||||
pagination: {
|
||||
page: 1,
|
||||
pageSize: 12,
|
||||
pageSize: 20,
|
||||
total: 0,
|
||||
pagesCount: 0,
|
||||
},
|
||||
|
||||
@@ -110,7 +110,7 @@ export function useInvoices(query, props) {
|
||||
invoices: [],
|
||||
pagination: {
|
||||
page: 1,
|
||||
pageSize: 12,
|
||||
pageSize: 20,
|
||||
total: 0,
|
||||
},
|
||||
filterMeta: {},
|
||||
|
||||
@@ -5,7 +5,7 @@ import useApiRequest from '../useRequest';
|
||||
import t from './types';
|
||||
|
||||
const DEFAULT_PAGINATION = {
|
||||
pageSize: 12,
|
||||
pageSize: 20,
|
||||
page: 0,
|
||||
pagesCount: 0,
|
||||
};
|
||||
@@ -75,7 +75,7 @@ export function useDeleteItem(props) {
|
||||
/**
|
||||
* Activate the given item.
|
||||
*/
|
||||
export function useActivateItem(props) {
|
||||
export function useActivateItem(props) {
|
||||
const queryClient = useQueryClient();
|
||||
const apiRequest = useApiRequest();
|
||||
|
||||
@@ -114,7 +114,9 @@ export function useInactivateItem(props) {
|
||||
const transformItemsResponse = (response) => {
|
||||
return {
|
||||
items: response.data.items,
|
||||
pagination: transformPagination(transformResponse(response.data.pagination)),
|
||||
pagination: transformPagination(
|
||||
transformResponse(response.data.pagination),
|
||||
),
|
||||
filterMeta: transformResponse(response.data.filter_meta),
|
||||
};
|
||||
};
|
||||
@@ -137,8 +139,8 @@ export function useItems(query, props) {
|
||||
pagination: DEFAULT_PAGINATION,
|
||||
filterMeta: {},
|
||||
},
|
||||
...props
|
||||
}
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -149,7 +151,7 @@ export function useRefreshItems() {
|
||||
refresh: () => {
|
||||
queryClient.invalidateQueries(t.ITEMS);
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -166,7 +168,7 @@ export function useItem(id, props) {
|
||||
{
|
||||
select: (response) => response.data.item,
|
||||
defaultData: {},
|
||||
...props
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ export function usePaymentReceives(query, props) {
|
||||
select: transformPaymentReceives,
|
||||
defaultData: {
|
||||
paymentReceives: [],
|
||||
pagination: { page: 1, pageSize: 12, total: 0 },
|
||||
pagination: { page: 1, pageSize: 20, total: 0 },
|
||||
filterMeta: {},
|
||||
},
|
||||
...props,
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createTableStateReducers } from 'store/tableState.reducer';
|
||||
import t from 'store/types';
|
||||
|
||||
export const defaultTableQuery = {
|
||||
pageSize: 12,
|
||||
pageSize: 20,
|
||||
pageIndex: 0,
|
||||
filterRoles: [],
|
||||
viewSlug: null,
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import { createReducer } from '@reduxjs/toolkit';
|
||||
import { persistReducer, purgeStoredState } from 'redux-persist';
|
||||
import storage from 'redux-persist/lib/storage';
|
||||
import {
|
||||
createTableStateReducers,
|
||||
} from 'store/tableState.reducer';
|
||||
import { createTableStateReducers } from 'store/tableState.reducer';
|
||||
import t from 'store/types';
|
||||
|
||||
export const defaultTableQuery = {
|
||||
pageSize: 12,
|
||||
pageSize: 20,
|
||||
pageIndex: 0,
|
||||
filterRoles: [],
|
||||
viewSlug: null,
|
||||
@@ -33,7 +31,4 @@ const reducerInstance = createReducer(initialState, {
|
||||
},
|
||||
});
|
||||
|
||||
export default persistReducer(
|
||||
CONFIG,
|
||||
reducerInstance,
|
||||
);
|
||||
export default persistReducer(CONFIG, reducerInstance);
|
||||
|
||||
@@ -3,7 +3,7 @@ import { createTableStateReducers } from 'store/tableState.reducer';
|
||||
|
||||
const initialState = {
|
||||
tableState: {
|
||||
pageSize: 12,
|
||||
pageSize: 20,
|
||||
pageIndex: 0,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import { createReducer } from '@reduxjs/toolkit';
|
||||
import { persistReducer, purgeStoredState } from 'redux-persist';
|
||||
import storage from 'redux-persist/lib/storage';
|
||||
import {
|
||||
createTableStateReducers,
|
||||
} from 'store/tableState.reducer';
|
||||
import { createTableStateReducers } from 'store/tableState.reducer';
|
||||
import t from 'store/types';
|
||||
|
||||
export const defaultTableQuery = {
|
||||
pageSize: 12,
|
||||
pageSize: 20,
|
||||
pageIndex: 0,
|
||||
filterRoles: [],
|
||||
viewSlug: null,
|
||||
@@ -27,13 +25,10 @@ const CONFIG = {
|
||||
|
||||
const reducerInstance = createReducer(initialState, {
|
||||
...createTableStateReducers('INVOICES', defaultTableQuery),
|
||||
|
||||
|
||||
[t.RESET]: () => {
|
||||
purgeStoredState(CONFIG);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
export default persistReducer(
|
||||
CONFIG,
|
||||
reducerInstance,
|
||||
);
|
||||
export default persistReducer(CONFIG, reducerInstance);
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createTableStateReducers } from 'store/tableState.reducer';
|
||||
import t from 'store/types';
|
||||
|
||||
export const defaultTableQuery = {
|
||||
pageSize: 12,
|
||||
pageSize: 20,
|
||||
pageIndex: 0,
|
||||
filterRoles: [],
|
||||
sortBy: [],
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import { createReducer } from '@reduxjs/toolkit';
|
||||
import { persistReducer, purgeStoredState } from 'redux-persist';
|
||||
import storage from 'redux-persist/lib/storage';
|
||||
import {
|
||||
createTableStateReducers,
|
||||
} from 'store/tableState.reducer';
|
||||
import { createTableStateReducers } from 'store/tableState.reducer';
|
||||
import t from 'store/types';
|
||||
|
||||
export const defaultTableQuery = {
|
||||
pageSize: 12,
|
||||
pageSize: 20,
|
||||
pageIndex: 0,
|
||||
filterRoles: [],
|
||||
viewSlug: null,
|
||||
@@ -33,7 +31,4 @@ const reducerInstance = createReducer(initialState, {
|
||||
},
|
||||
});
|
||||
|
||||
export default persistReducer(
|
||||
CONFIG,
|
||||
reducerInstance,
|
||||
);
|
||||
export default persistReducer(CONFIG, reducerInstance);
|
||||
|
||||
@@ -4,9 +4,8 @@ import storage from 'redux-persist/lib/storage';
|
||||
import { createTableStateReducers } from 'store/tableState.reducer';
|
||||
import t from 'store/types';
|
||||
|
||||
|
||||
export const defaultTableQuery = {
|
||||
pageSize: 12,
|
||||
export const defaultTableQuery = {
|
||||
pageSize: 20,
|
||||
pageIndex: 0,
|
||||
filterRoles: [],
|
||||
};
|
||||
@@ -28,7 +27,7 @@ const reducerInstance = createReducer(initialState, {
|
||||
|
||||
[t.RESET]: () => {
|
||||
purgeStoredState(CONFIG);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
export default persistReducer(CONFIG, reducerInstance);
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createTableStateReducers } from 'store/tableState.reducer';
|
||||
|
||||
// Default table query state.
|
||||
export const defaultTableQueryState = {
|
||||
pageSize: 12,
|
||||
pageSize: 20,
|
||||
pageIndex: 0,
|
||||
inactiveMode: false,
|
||||
filterRoles: [],
|
||||
|
||||
@@ -6,7 +6,7 @@ import t from 'store/types';
|
||||
|
||||
// Default table query.
|
||||
export const defaultTableQuery = {
|
||||
pageSize: 12,
|
||||
pageSize: 20,
|
||||
pageIndex: 0,
|
||||
filterRoles: [],
|
||||
viewSlug: null,
|
||||
@@ -30,7 +30,7 @@ const reducerInstance = createReducer(initialState, {
|
||||
|
||||
[t.RESET]: () => {
|
||||
purgeStoredState(CONFIG);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
export default persistReducer(CONFIG, reducerInstance);
|
||||
|
||||
@@ -6,7 +6,7 @@ import t from 'store/types';
|
||||
|
||||
const initialState = {
|
||||
tableState: {
|
||||
pageSize: 12,
|
||||
pageSize: 20,
|
||||
pageIndex: 0,
|
||||
sortBy: [],
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createTableStateReducers } from 'store/tableState.reducer';
|
||||
import t from 'store/types';
|
||||
|
||||
export const defaultTableQuery = {
|
||||
pageSize: 12,
|
||||
pageSize: 20,
|
||||
pageIndex: 0,
|
||||
filterRoles: [],
|
||||
inactiveMode: false,
|
||||
|
||||
@@ -5,11 +5,11 @@ import { createTableStateReducers } from 'store/tableState.reducer';
|
||||
import t from 'store/types';
|
||||
|
||||
export const defaultTableQuery = {
|
||||
pageSize: 12,
|
||||
pageSize: 20,
|
||||
pageIndex: 0,
|
||||
filterRoles: [],
|
||||
viewSlug: null,
|
||||
}
|
||||
};
|
||||
|
||||
const initialState = {
|
||||
tableState: defaultTableQuery,
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createTableStateReducers } from 'store/tableState.reducer';
|
||||
import t from 'store/types';
|
||||
|
||||
export const defaultTableQuery = {
|
||||
pageSize: 12,
|
||||
pageSize: 20,
|
||||
pageIndex: 0,
|
||||
filterRoles: [],
|
||||
viewSlug: null,
|
||||
|
||||
2
src/store/vendors/vendors.reducer.js
vendored
2
src/store/vendors/vendors.reducer.js
vendored
@@ -5,7 +5,7 @@ import { createTableStateReducers } from 'store/tableState.reducer';
|
||||
import t from 'store/types';
|
||||
|
||||
export const defaultTableQueryState = {
|
||||
pageSize: 12,
|
||||
pageSize: 20,
|
||||
pageIndex: 0,
|
||||
inactiveMode: false,
|
||||
filterRoles: [],
|
||||
|
||||
Reference in New Issue
Block a user