mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
Fix: Exchange Rate Pageination
This commit is contained in:
@@ -23,7 +23,7 @@ function ExchangeRateTable({
|
||||
// #withExchangeRates
|
||||
exchangeRatesList,
|
||||
exchangeRatesLoading,
|
||||
|
||||
exchangeRatesPageination,
|
||||
// #withDialogActions.
|
||||
openDialog,
|
||||
|
||||
@@ -152,6 +152,10 @@ function ExchangeRateTable({
|
||||
treeGraph={true}
|
||||
onSelectedRowsChange={handelSelectedRowsChange}
|
||||
rowContextMenu={rowContextMenu}
|
||||
pagination={true}
|
||||
pagesCount={exchangeRatesPageination.pagesCount}
|
||||
initialPageSize={exchangeRatesPageination.pageSize}
|
||||
initialPageIndex={exchangeRatesPageination.page - 1}
|
||||
/>
|
||||
</LoadingIndicator>
|
||||
);
|
||||
@@ -160,8 +164,15 @@ function ExchangeRateTable({
|
||||
export default compose(
|
||||
withDialogActions,
|
||||
withExchangeRatesActions,
|
||||
withExchangeRates(({ exchangeRatesList, exchangeRatesLoading }) => ({
|
||||
exchangeRatesList,
|
||||
exchangeRatesLoading,
|
||||
})),
|
||||
withExchangeRates(
|
||||
({
|
||||
exchangeRatesList,
|
||||
exchangeRatesLoading,
|
||||
exchangeRatesPageination,
|
||||
}) => ({
|
||||
exchangeRatesList,
|
||||
exchangeRatesLoading,
|
||||
exchangeRatesPageination,
|
||||
}),
|
||||
),
|
||||
)(ExchangeRateTable);
|
||||
|
||||
@@ -1,11 +1,24 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { getExchangeRatesList } from 'store/ExchangeRate/exchange.selector';
|
||||
import {
|
||||
getExchangeRatesList,
|
||||
getExchangeRatePaginationMetaFactory,
|
||||
getExchangeRatesTableQueryFactory,
|
||||
} from 'store/ExchangeRate/exchange.selector';
|
||||
|
||||
export default (mapState) => {
|
||||
const getExchangeRatesPaginationMeta = getExchangeRatePaginationMetaFactory();
|
||||
|
||||
const mapStateToProps = (state, props) => {
|
||||
const query = getExchangeRatesTableQueryFactory(state, props);
|
||||
|
||||
const mapped = {
|
||||
exchangeRatesList: getExchangeRatesList(state, props),
|
||||
exchangeRatesLoading: state.exchangeRates.loading,
|
||||
exchangeRatesPageination: getExchangeRatesPaginationMeta(
|
||||
state,
|
||||
props,
|
||||
query,
|
||||
),
|
||||
};
|
||||
return mapState ? mapState(mapped, state, props) : mapped;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user