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

Add pagination back to datatables pages #3041

Closed
1 of 2 tasks
Tracked by #146
JonellaCulmer opened this issue Jul 11, 2019 · 9 comments · Fixed by #3351
Closed
1 of 2 tasks
Tracked by #146

Add pagination back to datatables pages #3041

JonellaCulmer opened this issue Jul 11, 2019 · 9 comments · Fixed by #3351

Comments

@JonellaCulmer
Copy link
Contributor

JonellaCulmer commented Jul 11, 2019

What we're after: In an effort to help orient our users when viewing multiple pages of data, we should update our pagination to include the number of results being viewed and total results. Presently, a user must rely on whether they notice the data in the table has changed with no confirmation. If a user clicks multiple times they may lose track of where they are in the list.

Before

Screen Shot 2019-07-11 at 10.28.23 AM.png

After

Screen Shot 2019-10-29 at 11 14 27 AM

Completion criteria:

  • Research how page count estimates were tweaked in the past. When is it an estimate and when is it exact? Answer: counts are estimates when the estimate is over 500K. (code)
  • Re-implement page counts on page
@johnnyporkchops
Copy link
Contributor

FYI- The Pattern Library patter library has the alternate design patterns for showing estimated page counts and numbered buttons.
https://fec-pattern-library.app.cloud.gov/components/detail/feed-pagination.html

@JonellaCulmer
Copy link
Contributor Author

@johnnyporkchops Thanks, John! I've updated the ticket.

@JonellaCulmer
Copy link
Contributor Author

@johnnyporkchops I spoke too soon. This doesn't include controls on how to change the number of items seen on a page. I'll mock something up today or tomorrow.

@JonellaCulmer
Copy link
Contributor Author

@johnnyporkchops What do you think about below?
I think I prefer the first one. Users already know to look for the pagination buttons there on the right.

Screen Shot 2019-07-15 at 11 18 32 AM

@patphongs patphongs modified the milestones: Sprint 9.5, Sprint 9.6 Jul 16, 2019
@lbeaufort lbeaufort modified the milestones: Sprint 9.6, PI 9 innovation Jul 26, 2019
@lbeaufort lbeaufort removed this from the PI 9 innovation milestone Sep 4, 2019
@lbeaufort lbeaufort added this to the Sprint 10.3 milestone Sep 5, 2019
@patphongs patphongs changed the title Add counts to pagination on datatables Add pagination back to datatables pages Sep 19, 2019
@lbeaufort lbeaufort modified the milestones: Sprint 10.3, Sprint 10.4 Oct 2, 2019
@bmathesonFEC bmathesonFEC modified the milestones: Sprint 10.4, Sprint 10.5 Oct 17, 2019
@lbeaufort lbeaufort modified the milestones: Sprint 10.5, Sprint 10.4 Oct 18, 2019
@JonellaCulmer
Copy link
Contributor Author

I've updated the mock-up in the original comment based on previous discussions.

@lbeaufort
Copy link
Member

@JonellaCulmer, something that came up in discussion - can you show what the pagination would look like for a large results set - such as all 2020 schedule A data? It has 1,078,296 pages: https://api.open.fec.gov/v1/schedules/schedule_a/?api_key=DEMO_KEY&two_year_transaction_period=2020

@rfultz rfultz self-assigned this Nov 1, 2019
@JonellaCulmer
Copy link
Contributor Author

JonellaCulmer commented Nov 1, 2019

@lbeaufort A previous version of the pagination accounted for all pages. Listing pages 1, 2, 3...through to 1,000,000, etc. But that would add some visual clutter and confusion. And I'm not at all convinced that a user would page that far through the results without introducing new filters or sorting the data another way. I'm comfortable only listing some of the upcoming pages, not all of them.

@JonellaCulmer
Copy link
Contributor Author

JonellaCulmer commented Nov 1, 2019

@rfultz Here's some mock-ups to account for the other states. Happy to chat further if you think it necessary.

The first shows that a page will move to the middle, if possible. The last shows what it looks like to be on the last page. With the page all the way to the right and the right pagination button disabled.

Screen Shot 2019-11-04 at 9 41 00 AM

@JonellaCulmer JonellaCulmer modified the milestones: Sprint 10.4, Sprint 10.5 Nov 4, 2019
@rfultz
Copy link
Contributor

rfultz commented Nov 13, 2019

The datatables logic wants to include the ellipses. Here's how it looks with only five stops between the < and >. Not super helpful.
image

Here's when we have 7 buttons/items:
image

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

Successfully merging a pull request may close this issue.

7 participants