-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migration catalogue #14
Conversation
Hello @xamcost I added the mocked data and updated the catalog to not make any requests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this work @NaryLozano ! It greatly simplifies the code base, making it more ready to welcome Sedimark catalogue once it will be available, while letting us carry our work with the mock catalogue you've set. I just left a few comments, no major structural changes. Let me know if you have any questions!
const totalPages = useMemo( () => calculateTotalPages( totalVcs, settings.batchSize ), [totalVcs] ) | ||
const totalPagesToDisplay = totalPages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not seem to be working properly unfortunately, since the mock catalogue sends 59 results, with a page size set to 40, so we should have 2 pages, but only one shows up.
It is likely due to the fact that it does not get updated when the data
variable gets modified. I suggest moving the computation of totalPages in the useEffect
triggered by a change in data
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so the pagination in this case was working along with the query made to the catalog, so its behavior is different now that it receives only one object with all the results.
- You're right I was using Math.floor to round down to the nearest integer, but it actually needs to be rounded up 👍
@xamcost Morning Maxime :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thank you for your efforts @NaryLozano ! It works neatly. Feel free to merge anytime.
Updated catalogue + Mocked responses