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

[BUG] Pagination Total Num of Pages Fix #209

Merged
merged 2 commits into from
Nov 26, 2023
Merged

Conversation

kevin-pierce
Copy link
Contributor

@kevin-pierce kevin-pierce commented Nov 26, 2023

Notion task link

No Associated Task

This ticket aims to resolve an issue occurring on any page leveraging the Pagination component, in which an error state in the component will briefly be flashed since the total num of pages at that point is initially set to 0, while the user's page number is by default 1 (thus we end up displaying Page 1 of 0, leading to the error state temporarily). This fix resolves that issue.

Implementation description

  • The denominator of the page (numPages) is calculated using the current num of records ; on page load, this will be 0 (as we are still fetching the number of records), and so we want to simply set this to be the max of each value (1 and numRecords) so that when records are loading, we see Page X of 1

Steps to test

  1. Verify for log records, residents, and the employee page that the error state on the pagination component does NOT appear (and that initially we just see page 1 of 1)

What should reviewers focus on?

Checklist

  • My PR name is descriptive and in imperative tense
  • My commit messages are descriptive and in imperative tense. My commits are atomic and trivial commits are squashed or fixup'd into non-trivial commits
  • I have run the appropriate linter(s)
  • I have requested a review from the PL, as well as other devs who have background knowledge on this PR or who will be building on top of this PR
  • If I have made API changes, I have updated the REST API Docs
  • IF I have made changes to the db/models, I have updated the Data Models Page
  • I have documented this PR in the Production Release Page
  • I have updated other Docs as needed

Copy link

github-actions bot commented Nov 26, 2023

Visit the preview URL for this PR (updated for commit 18f477c):

https://blueprintsupportivehousing--pr209-kevin-page-num-bugfi-m6c6vms8.web.app

(expires Sun, 03 Dec 2023 20:42:35 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: f6bcdba7452bf82a6ec1a299c37d1bdff7870d09

@kevin-pierce kevin-pierce marked this pull request as ready for review November 26, 2023 20:40
Copy link
Contributor

@phamkelly17 phamkelly17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

niiiiice

Copy link
Contributor

@owen-sellner owen-sellner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!! No nits 🙏

@kevin-pierce kevin-pierce merged commit 8796389 into main Nov 26, 2023
3 checks passed
@kevin-pierce kevin-pierce deleted the kevin/page-num-bugfix branch November 26, 2023 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants