Fix: Exchange Rate Pageination

This commit is contained in:
elforjani3
2020-11-02 15:57:25 +02:00
parent 9a38559b98
commit 28fe1c25e6
6 changed files with 136 additions and 17 deletions

View File

@@ -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);

View File

@@ -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;
};