-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Add sorting to the Files & Uploads page #2066
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
Conversation
These changes represent the initial implementation of STUD-813 which adds pagination to the Files and Uploads page. The commit consists of the following logical changes: - a REST API has been implemented for a course's assets - the page itself now fetches the assets client-side - the Backbone.Paginator library is used to support pagination - the AssetCollection has been refactored to extend Backbone.Paginator.requestPager so that it can be paged - an abstract PagingView class has been added to generalize the communication with a paging REST API - the AssetsView has been reimplemented to extend PagingView - two new child views have been added: - PagingHeader: the paging controls above the list of assets - PagingFooter: the paging controls below the assets Some areas that need further improvement: - the page size is hard-coded to 5 to make it easier to reproduce - the 'format=json' option to the REST API is non-standard - there are no tests (they will be coming in my next commit) Note that this commit will not be delivered as is, but is provided for pre-review purposes.
Improve UX based on feedback from Frances Fix unit tests Add some testing around pagination of JSON requests
Updated asset view Jasmine tests to work with new AJAX model Refactored my JavaScript code to be more testable
…he total number of assets.
Start of sorting implementation
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.
Instead of sort_direction=descending, can we do sort_dir=desc? It seems just as clear, and it's a lot shorter. (If you think it's less clear, please let me know!)
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.
Changed to direction=asc/desc as we discussed, since that's what GitHub uses.
|
Your Javascript tests are amazing! You are my hero. 😍 |
|
I'm not seeing any ascending/descending indication. Personally, I also think the indication of which columns are sortable (and which is currently selected) is too subtle. Does this have all of @frrrances styling? |
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.
Update the method documentation to state what the valid query parameters are now.
|
@cahrens, this is the design from @frrrances. She double checked it with me on Tuesday. I like the simple design, but you should discuss the choices with her. |
- Added missing Python tests - Added some extra JavaScript tests - Removed unused code - Updated doc strings
|
Rebased to master, so submitted a new pull request: https://github.com/edx/edx-platform/pull/2086 |
[YONK-1866] Merge master changes into rebase-juniper(Phase 3).
Added sorting to the Files & Uploads page. This is built upon the changes in andy/asset-pagination which will be delivered first.
@cahrens @singingwolfboy @frrrances Please review.