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

Fixes pagination not working in Location Management (PaginatedList component) #6462

Merged
merged 4 commits into from
Oct 25, 2023

Conversation

rithviknishad
Copy link
Member

@rithviknishad rithviknishad commented Oct 18, 2023

WHAT

🤖 Generated by Copilot at 330c7d9

Improved pagination logic for PaginatedList component. Modified query hook in src/CAREUI/misc/PaginatedList.tsx to use offset parameter and fetch only the items for the current page.

Proposed Changes

  • fixes offset not included in qParams in PaginatedList component.

@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Update product documentation.
  • Ensure that UI text is kept in I18n files.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Request for Peer Reviews
  • Completion of QA

HOW

🤖 Generated by Copilot at 330c7d9

  • Modify the query hook to use an offset parameter for pagination (link)
  • Update the PaginatedList component to pass the current page and perPage props to the query hook (link)
  • Add a useEffect hook to reset the current page to 1 when the query params change (link)
  • Refactor the renderList function to use the data.results array instead of the data array (link)
  • Add a total prop to the PaginatedList component to display the total number of items (link)
  • Use the total prop in the Pagination component to calculate the number of pages (link)

@rithviknishad rithviknishad requested a review from a team October 18, 2023 02:52
@rithviknishad rithviknishad requested a review from a team as a code owner October 18, 2023 02:52
@vercel
Copy link

vercel bot commented Oct 18, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
care-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 25, 2023 0:00am

@netlify
Copy link

netlify bot commented Oct 18, 2023

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit 016d594
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/6539032bcf1edc0008d62ad8
😎 Deploy Preview https://deploy-preview-6462--care-egov-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@cypress
Copy link

cypress bot commented Oct 18, 2023

Passing run #1465 ↗︎

0 85 0 0 Flakiness 0

Details:

Fixes pagination not working in Location Management (`PaginatedList` component)
Project: CARE Commit: 016d5946de
Status: Passed Duration: 03:01 💡
Started: Oct 25, 2023 12:03 PM Ended: Oct 25, 2023 12:06 PM

Review all test suite changes for PR #6462 ↗︎

@nihal467
Copy link
Member

@rithviknishad can you fix the cypress failure

@nihal467
Copy link
Member

LGTM

@khavinshankar khavinshankar merged commit 30aa4df into develop Oct 25, 2023
55 of 56 checks passed
@khavinshankar khavinshankar deleted the fix-pagination branch October 25, 2023 14:11
@github-actions
Copy link

@rithviknishad We truly appreciate your efforts. Thank you for taking the time to contribute; this is a very valuable contribution to us 🥇. We always welcome your contribution 🙂, so feel free to contribute to anything anytime, and never lose that spirit of innovation 🙌.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants