apluslms / a-plus

A+ frontend portal - A+ LMS documentation:
https://apluslms.github.io/
Other
65 stars 72 forks source link

Enable most recent first sorting in deadline deviations #1315

Closed ashi006 closed 6 months ago

ashi006 commented 8 months ago

Fixes #1279

Description

What?

On deadline deviations page, table rows can be sorted but only in oldest-first order. It would be nice to support newest-first sorting order. Actually, it wouldn’t object to newest-first being the default sorting on that page.

Why?

The deadline deviations page currently sorts the table rows only in oldest-first order but the most recently added deviations tend to be of most interest for anyone visiting this page.

How?

The solution adds the possibility to sort table rows both in newest-first or oldest-first sorting order. The new changes are applied on all the pages that use <table> tag with "ordered-table" attribute. But the sorting is applied by default only to the deadline deviations page by adding two new attributes data-default-sort-column and data-default-sort-order in the <table> tag, which restricts the default sorting to this page only.

Fixes #1279

Testing

Remember to add or update unit tests for new features and changes.

What type of test did you run?

Ensuring that newest-first sorting in enabled only on deadline deviations page by default. Also tested that clicking a column name does sort the table rows based on the values of that column and clicking column name multiple times will toggle between newest-first / oldest-first sorting orders.

Did you test the changes in

Think of what is affected by these changes and could become broken

Translation

Programming style

Have you updated the README or other relevant documentation?

Is it Done?

Clean up your git commit history before submitting the pull request!