Added alphabetic pagination to users list
Review Request #6368 — Created Sept. 24, 2014 and submitted
The usergrid object triggers the paginator in djiblets to turn on alphabetic queries by providing a current_letter parameter to the DataGrid.
If there is no letter parameter passed into query string it defaults to 'A'.
The users_list function (in views) is reponsible for catching a letter parameter in the query string (including catching and throwing errors), and filtering the queryset accordingly (ie. filter for names starting with 'A') before passing it to the datagrid.I've provided a screenshot of what the paginator looks like and am open to suggestions about making CSS modifications. I've also tried out Andrew Hongs suggestions of adding brackets around the numeric buttons.
Manually tested button behaviour of first last, next and back arrows.
Unit tests for the user list are updated to test new features and all pass.
All unit tests pass.
- Change Summary:
-
Fixed line length style issue, updated description
- Description:
-
~ Added initial support for by-letter querying of the paginator on the users list.
~ The usergrid object triggers the paginator in djiblets to turn on alphabetic queries by providing a current_letter parameter to the DataGrid.
- The usergrid object triggers the paginator in djiblets to turn on alphabetic queries by providing a current_letter parameter to the DataGrid. If there is no letter parameter passed into query string it defaults to 'A'. ~ The users_list function is reponsible for catching a letter parameter in the query string. ~ The users_list function (in views) is reponsible for catching a letter parameter in the query string, and filtering the queryset accordingly (ie. filter for names starting with 'A') before passing it to the datagrid. - The users_list function (or any function that calls the datagrid) is reponsible for filtering down the the queryset (ie. filter for names starting with 'A') before passing it to the datagrid, for now. It might make more sense to have that filtering be done on the djblets side (I will look into that right away). No visual changes have been made to differentiate the alphabetic buttons from the numbers. I've provided a screenshot of what that looks like and am open to suggestions about making CSS modifications.
- Testing Done:
-
~ TODO
~ Manually tested button behaviour of first last, next and back arrows.
+ + TODO
+ Non A-Z username handing. + Unit tests - Commit:
-
1e8b13592245096a4d6b0a191ad63f7e184c34e6d48ec7bb23086ed8a553cb00689720825bf043af
-
Tool: Pyflakes Processed Files: reviewboard/datagrids/grids.py reviewboard/datagrids/views.py Tool: PEP8 Style Checker Processed Files: reviewboard/datagrids/grids.py reviewboard/datagrids/views.py
- Change Summary:
-
Moved the logic that checks the request for a letter and filters the queryset to UserDataGrid. The paginator behaviours is now more self-contained within the UsersDataGrid object, instead of views.py
- Commit:
-
d48ec7bb23086ed8a553cb00689720825bf043af727d2933742a142cdc71aa77ae008ed30045cc2e
- Diff:
-
Revision 3 (+5 -1)
- Change Summary:
-
Added second image with first and last arrows. Fixed style issue with missing whitespace around = operator.
- Commit:
-
727d2933742a142cdc71aa77ae008ed30045cc2e89c335f8b0f74a324de00ff79f640b4fb6fd0ef9
- Diff:
-
Revision 4 (+5 -1)
- Added Files:
-
Tool: Pyflakes Processed Files: reviewboard/datagrids/grids.py Tool: PEP8 Style Checker Processed Files: reviewboard/datagrids/grids.py
- Change Summary:
-
Updated the request handling to accent non-alphabetic input (but only 0-9, _, -,. ). Anything else will raise a 404.
- Commit:
-
89c335f8b0f74a324de00ff79f640b4fb6fd0ef94c2f32cfbd7e1d8309caa732aa205af394a77fb6
- Diff:
-
Revision 5 (+11 -1)
- Change Summary:
-
Updated user_list unit tests to validate alphabetic pagination behaviour.
- Testing Done:
-
Manually tested button behaviour of first last, next and back arrows.
~ TODO
~ Unit tests implemented and run.
- Unit tests - Commit:
-
4c2f32cfbd7e1d8309caa732aa205af394a77fb6bee72a671e5d0403e7f2e4298f1d9f97f750b1ce
- Added Files:
-
Tool: Pyflakes Processed Files: reviewboard/datagrids/grids.py reviewboard/datagrids/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/datagrids/grids.py reviewboard/datagrids/tests.py
- Change Summary:
-
Passed all unit tests and change from WIP to ready to review
- Summary:
-
[WIP] Added alphabetic pagination to users listAdded alphabetic pagination to users list
- Description:
-
The usergrid object triggers the paginator in djiblets to turn on alphabetic queries by providing a current_letter parameter to the DataGrid.
If there is no letter parameter passed into query string it defaults to 'A'. ~ The users_list function (in views) is reponsible for catching a letter parameter in the query string, and filtering the queryset accordingly (ie. filter for names starting with 'A') before passing it to the datagrid. ~ The users_list function (in views) is reponsible for catching a letter parameter in the query string (including catching and throwing errors), and filtering the queryset accordingly (ie. filter for names starting with 'A') before passing it to the datagrid. ~ No visual changes have been made to differentiate the alphabetic buttons from the numbers. I've provided a screenshot of what that looks like and am open to suggestions about making CSS modifications.
~ I've provided a screenshot of what the paginator looks like and am open to suggestions about making CSS modifications. I've also tried out Andrew Hongs suggestions of adding brackets around the numeric buttons.
- Testing Done:
-
Manually tested button behaviour of first last, next and back arrows.
~ Unit tests implemented and run.
~ Unit tests for the user list are updated to test new features and all pass.
+ + TODO:
+ Resolve outstanding unit test issues within my repo to make sure these changes don't break anything.
- Change Summary:
-
Corrected multiple queryset filtering not perserving last applied filter.
- Testing Done:
-
Manually tested button behaviour of first last, next and back arrows.
Unit tests for the user list are updated to test new features and all pass.
~ TODO:
~ All unit tests pass.
- Resolve outstanding unit test issues within my repo to make sure these changes don't break anything. - Commit:
-
bee72a671e5d0403e7f2e4298f1d9f97f750b1ce6e82fd34a0264960b5a22d9bf2756d58cce9349b