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

Implement backend sorting of users data for Facility -> Users table #12234

Open
MisRob opened this issue Jun 4, 2024 · 4 comments · May be fixed by #12324
Open

Implement backend sorting of users data for Facility -> Users table #12234

MisRob opened this issue Jun 4, 2024 · 4 comments · May be fixed by #12324
Assignees

Comments

@MisRob
Copy link
Member

MisRob commented Jun 4, 2024

Overview

To be able to add sorting for Facility -> Users table as designed here

table

backend needs to be able to return sorted data.

Backend sorting is expected to work for:

  • Full name
  • User name
  • Identifier
  • Gender
  • Birth year
  • Date created

Note that sorting in this case can't be done on frontend as here we use paginated data that is loaded lazily.

Outcomes

  • Backend can optionally return sorted (ascending/descending) data mentioned above

Out of scope

  • Implementing the whole sorting feature (to be possibly done as part of a GSOC project)
  • There's currently no information on 'Date added` on backend so this won't be returned
  • Note that 'Date created' is not yet visible in the current table UI but are planned to be added. Even though making the columns visible on frontend is not in the scope of this issue, sorting is expected to work for them as these two fields are the main motivation for the sorting feature in this table.
@MisRob
Copy link
Member Author

MisRob commented Jun 4, 2024

@rtibbles
Copy link
Member

rtibbles commented Jun 4, 2024

This would need to be done using the OrderingFilter defined here: https://github.com/learningequality/kolibri/blob/develop/kolibri/core/api.py#L58

Which is a reimplementation of the DRF OrderingFilter documented here: https://www.django-rest-framework.org/api-guide/filtering/#orderingfilter

It should work fairly easily out of the box.

@MisRob
Copy link
Member Author

MisRob commented Jun 13, 2024

Also note that I think that as part of this work, "date_created" and "date_added" will need to be added to the facility users response (endpoint api/auth/facilityuser/?member_of=37b644ecd03062f21a54452f84cfadb6&page=1&page_size=30). I originally assumed we may have it available already, but is not the case:

Screenshot from 2024-06-13 10-13-38

@MisRob
Copy link
Member Author

MisRob commented Jun 17, 2024

As agreed with @ozer550 and @rtibbles, I removed "Date added" requirements since that is currently not available on backend

@ozer550 ozer550 linked a pull request Jun 20, 2024 that will close this issue
9 tasks
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 a pull request may close this issue.

4 participants