You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2021/03/29 21:50:25 UTC

[GitHub] [couchdb-fauxton] Antonio-Maranhao commented on a change in pull request #1288: Support pagination in ReplicatorDB activity panel

Antonio-Maranhao commented on a change in pull request #1288:
URL: https://github.com/apache/couchdb-fauxton/pull/1288#discussion_r603632649



##########
File path: app/addons/replication/reducers.js
##########
@@ -406,4 +463,10 @@ export const getReplicateInfo = (state) => {
   });
 };
 
+export const getPagination = (state) => state.pagination;
+export const getPageStart = (state) => 1 + (state.pagination.page - 1) * state.pagination.docsPerPage;
+export const getPageEnd = (state) => state.pagination.docsPerPage + (state.pagination.page - 1) * state.pagination.docsPerPage;

Review comment:
       Can you use this so it shows the correct range on the last page?
   
   ```suggestion
   export const getPageEnd = (state) => {
     if (state.isLoading || !state.statusDocs || state.statusDocs.length === 0) {
       return false;
     }
     const pageStart = (state.pagination.page - 1) * state.pagination.docsPerPage;
     return pageStart + state.statusDocs.length;
   };
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org