-
-
Notifications
You must be signed in to change notification settings - Fork 296
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
Implement drag & reorder functionality & new API #1995
Conversation
34cc70d
to
c55e1f7
Compare
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.
changes proposed
c55e1f7
to
e457e5b
Compare
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.
LGTM
e457e5b
to
70be501
Compare
Note to self: Sortable.js seems to not be maintained. There's this alternative: which seems to have all of the functions we need for now and is looking for co-maintainers. We can probably pick it up. |
d31306a
to
c3d514d
Compare
70be501
to
17400fd
Compare
@asankov, @RMadjev please check the 2nd commit and tell me what you think. The original sortable.js library states that it is not maintained anymore and I've replaced it with another llibrary which is vanilla JS. The syntax is less handy but we don't use it that much so it is bearable. The changes from one to the other are minimal and straight forward. The only thing lacking in html5sortable is the animation capabilities but that is offset by the fact that they are actively looking for co-maintainers and we can join them, see: |
6b0c2eb
to
91e05bf
Compare
NOTES: - uses html5sortable for drag & reorder - manual sorting button is located after A-Z button in toolbar - NEW API method TestPlan.update_case_order() - Manual reorder & API require the testcases.change_testcaseplan permission - toolbarDropdowns() is called from within toolbarEvents() b/c it really doesn't make sense to have this as stand-alone function - toolbarEvents() is moved within the TestCases.filter() callback b/c we need the list of test cases to be fully initialized so we can get the initial sorting order and use it later WARNINGS: - may want to unbind the on-click event for rows if users are having problems with the rows expanding while dragging them
91e05bf
to
7592ee1
Compare
NOTES:
uses Sortable.js for drag & reorder
manual sorting button is located after A-Z button in toolbar
NEW API method TestPlan.update_case_order()
Manual reorder & API require the testcases.change_testcaseplan
permission
toolbarDropdowns() is called from within toolbarEvents() b/c
it really doesn't make sense to have this as stand-alone function
toolbarEvents() is moved within the TestCases.filter() callback
b/c we need the list of test cases to be fully initialized so we
can get the initial sorting order and use it later
WARNINGS:
may want to unbind the on-click event for rows if users are
having problems with the rows expanding while dragging them
the page doesn't use sortkey for initially displaying the rows
of test cases because this field isn't available in the API result.
Specifically sortkey is a field in the TestCasePlan model, which
is a through model and the .filter() API is querying the TestCase
model instead.