Skip to content

OBPIH-6933 User can manually enter a page number outside the valid page range#5016

Merged
awalkowiak merged 3 commits intodevelopfrom
OBPIH-6933
Jan 27, 2025
Merged

OBPIH-6933 User can manually enter a page number outside the valid page range#5016
awalkowiak merged 3 commits intodevelopfrom
OBPIH-6933

Conversation

@alannadolny
Copy link
Collaborator

No description provided.

@alannadolny alannadolny self-assigned this Jan 24, 2025
@github-actions github-actions bot added the domain: frontend Changes or discussions relating to the frontend UI label Jan 24, 2025
@codecov
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 7.74%. Comparing base (1b89764) to head (eb3c438).
Report is 204 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff            @@
##             develop   #5016   +/-   ##
=========================================
  Coverage       7.74%   7.74%           
  Complexity       859     859           
=========================================
  Files            613     613           
  Lines          42621   42621           
  Branches       10350   10350           
=========================================
  Hits            3303    3303           
  Misses         38825   38825           
  Partials         493     493           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

});

const onPageChange = (page) => {
const maxPage = Math.floor(totalCount / pagination.pageSize);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does maxPage have to be recalculated on each page change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

do you suggest using useCallback with totalCount and pageSize as a dependency?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah, we can use it, this can be cached until filters are applied (totalCount changes/page size changes)


const onPageChange = (page) => {
const maxPage = Math.floor(totalCount / pagination.pageSize);
if (maxPage < page) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nitpicky, but since the comparators below start with the page, for me personally it would be more readable if it was:

if (page > maxPage)

but it's my own preference so I'm not requesting a change

});

const onPageChange = (page) => {
const maxPage = Math.floor(totalCount / pagination.pageSize);
Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah, we can use it, this can be cached until filters are applied (totalCount changes/page size changes)

@awalkowiak awalkowiak merged commit b290f9c into develop Jan 27, 2025
9 checks passed
@awalkowiak awalkowiak deleted the OBPIH-6933 branch January 27, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: frontend Changes or discussions relating to the frontend UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants