Skip to content

Conversation

@AlexVelezLl
Copy link
Member

@AlexVelezLl AlexVelezLl commented Jul 31, 2025

Summary

  • Implements new users filters side panel.
  • Creates a new useUsersFilters composable to encapsulate the app, route query and backend representations of the users filters.
  • Adds backend support to filter by multiple user types, classes, and birth year ranges.
  • Moves SelectableList component to be in the facility/.../common folder.

Screencast

Screencast.from.31-07-25.14.18.27.webm

References

Closes #13522.

Reviewer guidance

  • Go to facility > users page and/or to the facility > users > new users page.
  • Open the filter side panel by clicking on the filters button.
  • Play applying, changing, removing filters, and check that the users table is correcly updated.

@github-actions github-actions bot added DEV: backend Python, databases, networking, filesystem... APP: Facility Re: Facility App (user/class management, facility settings, csv import/export, etc.) DEV: frontend SIZE: large labels Jul 31, 2025
@AlexVelezLl AlexVelezLl marked this pull request as draft July 31, 2025 16:41
@github-actions
Copy link
Contributor

github-actions bot commented Jul 31, 2025

member_of = ModelChoiceFilter(
method="filter_member_of", queryset=Collection.objects.all()
)
related_to__in = ModelChoiceInFilter(
Copy link
Member Author

Choose a reason for hiding this comment

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

Im proposing adding a new filter related_to to check not just the membership of the user to a collection, but also if the user is assigned to that collection via user role. So when we filter by a class, we dont only get the students, but also the assigned coaches

def filter_birth_year_gte(self, queryset, name, value):
queryset = queryset.exclude(
Q(birth_year__isnull=True)
| Q(birth_year=NOT_SPECIFIED)
Copy link
Member Author

Choose a reason for hiding this comment

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

I am not sure if there is a better way to exclude the users that have these values in the filter

@AlexVelezLl AlexVelezLl marked this pull request as ready for review July 31, 2025 19:21
@nucleogenesis nucleogenesis requested a review from pcenov August 6, 2025 22:40
@pcenov
Copy link
Member

pcenov commented Aug 8, 2025

Hi @AlexVelezLl here's a list with minor issues observed while testing (as always these can be filed as follow-ups if out of scope for this PR):

  1. The classes in the 'Class' filter are not sorted alphabetically:
sorting
  1. Perhaps it should be further discussed what should happen when the filters by 'All users' and 'All classes' are selected, as currently when I reopen the filter these are no longer selected which can be confusing in some scenarios:
all.filters.selected.mp4
  1. If I have applied the filter by 'Birth year' and I clear the filters, then I should be seeing all available users (the filters should be reset) while currently this is not working properly and I have to manually refresh the page:
filter.by.b.mp4
  1. If I have copied and pasted the following link in a new browser window http://127.0.0.1:8080/en/facility/#/users/filter then when I close the filter or click outside of the filter panel I am seeing a blank page instead of being at http://127.0.0.1:8080/en/facility/#/users/
navigation.to.the.users.page.mp4

@github-actions github-actions bot added the APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) label Aug 8, 2025
@AlexVelezLl
Copy link
Member Author

Thanks @pcenov! I've just pushed some changes that should fix all your comments! :)

@nucleogenesis @LianaHarris360 I am introducing the usePreviousRoute composable in this commit as its the more robust way I found to manage the go back actions in these side panels that can have multiple back routes (e.g. the index users page, the new users, the trash page) 2e5f031. If this looks fine, we can replicate this back behavior on other side panels to to prevent the point 4 of Peter's comment.

Copy link
Member

@pcenov pcenov left a comment

Choose a reason for hiding this comment

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

Great @AlexVelezLl - all comments are addressed, LGTM!

@nucleogenesis
Copy link
Member

@AlexVelezLl great call commonizing the usePreviousRoute composable - should be good to merge then

@rtibbles rtibbles assigned nucleogenesis and unassigned rtibbles Aug 11, 2025
@nucleogenesis nucleogenesis merged commit d0176a6 into learningequality:develop Aug 12, 2025
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) APP: Facility Re: Facility App (user/class management, facility settings, csv import/export, etc.) DEV: backend Python, databases, networking, filesystem... DEV: frontend SIZE: large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bulk user search filters side panel

4 participants