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