sensei icon indicating copy to clipboard operation
sensei copied to clipboard

Fix/last activity sort

Open mikeyarce opened this issue 3 years ago • 0 comments

Fixes #5335

Changes proposed in this Pull Request

Previously, we sorted Students by Last Activity Date by manipulating the DB query. In https://github.com/Automattic/sensei/pull/5104 we extracted that out of the query and now we add that information to the query results to each user object. However, doing that broke the sorting by last activity.

What I'm doing here is moving the logic from parsing query arguments before the query to ordering after the query has been done.

Testing instructions

  • Go to Sensei LMS -> Students
  • Have at least 3 students with different Last Activity times.
  • Click on the Last Activity column header
  • Make sure both ASC and DESC work as expected

Screenshot / Video

last-activity-ordering

mikeyarce avatar Jul 31 '22 23:07 mikeyarce