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 filtering by role to the users index page for admins #1495

Merged
merged 2 commits into from
May 20, 2024

Conversation

crismali
Copy link
Contributor

@crismali crismali commented May 16, 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:
Screenshot 2024-05-15 at 9 46 00 PM

With the admin only filter active:
Screenshot 2024-05-15 at 9 45 41 PM

With no filters active (ie all users):
Screenshot 2024-05-15 at 9 45 29 PM

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 is awesome! The test coverage is nice to see 🚀 !

@jim jim merged commit c965ac3 into main May 20, 2024
9 checks passed
@jim jim deleted the add-filters-to-users-page branch May 20, 2024 03:47
phinze pushed a commit that referenced this pull request May 20, 2024
# 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](https://github.com/chicago-tool-library/circulate/assets/3209502/ac13834f-d733-4909-84c2-8ca4f3f4f9cd)



# 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.
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