-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Admin member index: filter by member roles #17884
Conversation
2979fc0
to
2ac6205
Compare
I had looked at using `User.with_any_roles` but that creates one User query per role passed. Which is not ideal, given that we want to have an ActiveRecord::Relation object on which we'd paginate. This adjustment does it's best to mimic Forem's role structure and adhear to how Rolify builds the underlying query. An astute reader will notice that in these specs we use `role: "admin"` and `roles: ["Admin"]`; the primary reason relates the user interface being worked on in #17884. It is my understanding that the `role` approach and `roles` approach will be separated by a feature flag (we're rolling out the `roles` approach). Related to - #17491 - #17884
I had looked at using `User.with_any_roles` but that creates one User query per role passed. Which is not ideal, given that we want to have an ActiveRecord::Relation object on which we'd paginate. This adjustment does it's best to mimic Forem's role structure and adhear to how Rolify builds the underlying query. An astute reader will notice that in these specs we use `role: "admin"` and `roles: ["Admin"]`; the primary reason relates the user interface being worked on in #17884. It is my understanding that the `role` approach and `roles` approach will be separated by a feature flag (we're rolling out the `roles` approach). Related to - #17491 - #17884
Converted this back to draft as I think I can now join up with Jeremy's PR and get the whole flow working |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really just me wondering... but I wonder if we could have it "show more filters" on load if any of the "more filters" were on? It's only one extra click, but the feeling I get is somehow like "it ought to remember".
Yeah I agree @jaw6; it's especially weird if none of the "initially visible" filters are applied and you're looking at a bunch of empty checkboxes. There's a few small things I wanted to clarify with the UX/UI here anyway, so I'll add this to the list as I'm sure we can polish it up 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lovely!
What type of PR is this? (check all applicable)
Description
This PR updates the "member roles" section of the new filters modal to include an expandable list of member roles and checkboxes. Selecting role checkboxes and filtering should update the list of users in the UI.
Related Tickets & Documents
QA Instructions, Screenshots, Recordings
member_index_view
feature flag enabled, visit/admin/member_manager/users
Expand/collapse roles
Show/hide "Clear filter" button and status indicator
Filtering behaviour
CleanShot.2022-06-15.at.17.34.46.mp4
UI accessibility concerns?
aria-label
and anaria-pressed
attribute, making it a 'toggle' button. Screen reader users can therefore be aware whether the list is currently expanded or collapsedAdded/updated tests?
[Forem core team only] How will this change be communicated?
Will this PR introduce a change that impacts Forem members or creators, the
development process, or any of our internal teams? If so, please note how you
will share this change with the people who need to know about it.
Storybook (for Crayons components)
updated. I have filled out the
Changes Requested
issue template so Community Success can help update the Admin Docs
appropriately.
CHANGELOG.md
or in a forem.dev post
[optional] Are there any post deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?