Automate-3673 Compliance reports pagination pages not correct #4363
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🔩 Description: What code changed, and why?
There is a dependency on #3664
Prior to #3664, if you applied a status filter the nodes, profiles, or controls would still be distributed across all of their pages before the filter was applied.
#3664 improves it so that all objects get moved to the beginning of the pages, but all the empty pages are left around and if a user navigates to one of the empty pages they get stuck and have to do a hard refresh.
if a user applies a status filter, pagination buttons should only be shown if there are objects on them.
⛓️ Related Resources
#3673
👍 Definition of Done
Pagination shows correct page numbers
👟 How to Build and Test the Change
add at least 101 compliance nodes, chef_load_compliance_nodes
navigate to compliance > reports > nodes (or profiles or controls)
apply a status filter
navigate to the second page via the pagination component
notice the blank pages where you get stuck
✅ Checklist