Skip to content
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

Merged
merged 9 commits into from
Nov 12, 2024
Merged

Migration catalogue #14

merged 9 commits into from
Nov 12, 2024

Conversation

NaryLozano
Copy link
Collaborator

@NaryLozano NaryLozano commented Nov 7, 2024

Updated catalogue + Mocked responses

@NaryLozano NaryLozano added the Func: Offering Discovery Issues related to catalogue browsing label Nov 7, 2024
@NaryLozano NaryLozano requested a review from xamcost November 7, 2024 11:53
@NaryLozano NaryLozano self-assigned this Nov 7, 2024
@NaryLozano
Copy link
Collaborator Author

Hello @xamcost I added the mocked data and updated the catalog to not make any requests.
Let me know if you have any comments and\or suggestions

@NaryLozano NaryLozano linked an issue Nov 11, 2024 that may be closed by this pull request
Copy link
Collaborator

@xamcost xamcost left a 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!

package-lock.json Outdated Show resolved Hide resolved
src/utils/data/mockCatalogue.json Show resolved Hide resolved
src/utils/data/mockProviders.json Show resolved Hide resolved
src/utils/settings.js Outdated Show resolved Hide resolved
Comment on lines 90 to 91
const totalPages = useMemo( () => calculateTotalPages( totalVcs, settings.batchSize ), [totalVcs] )
const totalPagesToDisplay = totalPages
Copy link
Collaborator

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.
image

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.

Copy link
Collaborator Author

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 👍

src/app/catalogue/components/SideBar.js Outdated Show resolved Hide resolved
@NaryLozano
Copy link
Collaborator Author

@xamcost Morning Maxime :)
Thank you for the feedback. I updated the files involved, and everything seems to be working fine. Let me know what you think!

@NaryLozano NaryLozano requested a review from xamcost November 12, 2024 10:23
@NaryLozano NaryLozano changed the base branch from feat/homepage to main November 12, 2024 16:26
Copy link
Collaborator

@xamcost xamcost left a 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.

@xamcost xamcost merged commit e46b6db into main Nov 12, 2024
@xamcost xamcost deleted the feat/catalogue branch November 12, 2024 16:59
@xamcost xamcost mentioned this pull request Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Func: Offering Discovery Issues related to catalogue browsing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor catalogue browsing to work with a mock response
2 participants