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

Added pagination to the admin users index page under settings #1496

Merged
merged 2 commits into from
May 20, 2024

Conversation

crismali
Copy link
Contributor

What it does

Adds pagination with pagy to the users index page under settings.

Why it is important

Currently this page takes just over 2 seconds to load so this should speed things up significantly. See #1249 for more.

UI Change Screenshot

Screenshot 2024-05-16 at 10 55 35 AM

Implementation notes

Just as basic a pagy implementation as I could manage. I also worked on #1495 which involves filtering this same page. Once one of these is merged it might take a little work on the other to make sure the filters and pagination don't cause any issues with one another, which I'm happy to take care of. Alternatively, these two could be combined? Depends on how useful one is without the other.

jim pushed a commit that referenced this pull request May 20, 2024
# What it does

These changes allow admin users to filter the users index page in the
admin interface by role. By default they'll see all users, but they can
choose admin only, staff only, or members only.

# Why it is important

This should make some admin tasks easier when it comes to users. See
#1251 for more.

# UI Change Screenshot

With the members only filter active:
<img width="1102" alt="Screenshot 2024-05-15 at 9 46 00 PM"
src="https://github.com/chicago-tool-library/circulate/assets/3209502/782275f2-4f99-413f-b750-19f8cef797eb">

With the admin only filter active:
<img width="1096" alt="Screenshot 2024-05-15 at 9 45 41 PM"
src="https://github.com/chicago-tool-library/circulate/assets/3209502/07985dce-424e-4603-861d-28ceea5d99f7">

With no filters active (ie all users):
<img width="1161" alt="Screenshot 2024-05-15 at 9 45 29 PM"
src="https://github.com/chicago-tool-library/circulate/assets/3209502/1bcec054-0188-4326-a123-e00fae7a99f9">

# Implementation notes

The card didn't specifically mention being able to filter by the member
role but I included it anyway. ~~Not sure if pagination or sorting would
be helpful here as well.~~ I just went through the pagination card for
this page (#1496).
Copy link
Member

@jim jim left a comment

Choose a reason for hiding this comment

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

This change looks good! Like you said, it'll just need to be adjusted a bit due to merge conflicts with the other PR.

@crismali crismali force-pushed the add-pagination-to-admin-users-index-page branch from d6c7146 to 75a8815 Compare May 20, 2024 14:13
Copy link
Contributor

@phinze phinze left a comment

Choose a reason for hiding this comment

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

Looks great, thanks @crismali! I'll get this deployed shortly.

@phinze phinze merged commit b392975 into main May 20, 2024
9 checks passed
@phinze phinze deleted the add-pagination-to-admin-users-index-page branch May 20, 2024 22:22
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

3 participants