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: |
|
|||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Testing Done: |
|
|||||||||||||||||||||||||||
Commit: |
|
|||||||||||||||||||||||||||
Diff: |
Revision 2 (+11 -3) |
-
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: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+5 -1) |
-
Tool: Pyflakes Processed Files: reviewboard/datagrids/grids.py Tool: PEP8 Style Checker Processed Files: reviewboard/datagrids/grids.py
-
Change Summary:
Added second image with first and last arrows. Fixed style issue with missing whitespace around = operator.
Commit: |
|
||||
---|---|---|---|---|---|
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: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 5 (+11 -1) |
Change Summary:
Updated user_list unit tests to validate alphabetic pagination behaviour.
Testing Done: |
|
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commit: |
|
|||||||||||||||
Diff: |
Revision 6 (+30 -5) |
|||||||||||||||
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: |
|
|||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
|||||||||||||||||||||
Testing Done: |
|
-
-
reviewboard/datagrids/grids.py (Diff revision 6) This will end up undoing the local_site filter above. These should be
qs = qs.filter(...)
Change Summary:
Corrected multiple queryset filtering not perserving last applied filter.
Testing Done: |
|
|||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commit: |
|
|||||||||||||||||||||
Diff: |
Revision 7 (+30 -5) |