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

Automate-3673 Compliance reports pagination pages not correct #4363

Closed
wants to merge 1 commit into from

Conversation

tarablack01
Copy link
Contributor

🔩 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

@netlify
Copy link

netlify bot commented Sep 22, 2020

Deploy preview for chef-automate ready!

Built with commit a320420

https://deploy-preview-4363--chef-automate.netlify.app

@@ -116,7 +116,7 @@
<app-page-picker
class="reporting-nodes-paging"
[perPage]="reportData.nodesListParams.perPage"
[total]="reportData.nodesList.total"
[total]="getTotalNodes()"
Copy link
Contributor

@msorens msorens Sep 23, 2020

Choose a reason for hiding this comment

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

Whenever we use a data function like this (as opposed to an action function like a click handler), Angular cannot know if its value has changed so it needs to call it. Repeatedly. I have not spent time fully characterizing how often, but in some instances I have seen it looping endlessly for no apparent reason. Since that time I have been espousing a ban on data functions in templates unless it is absolutely unavoidable.

There are two alternative approaches: "declared properties" and "pure pipes". See my extensive notes on these in the bottom half of the preamble to #3810. That PR also shows examples of the "declared properties" approach, which is more appropriate in this case.

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.

None yet

2 participants