Add smarter objects selector widget into Djblets
Review Request #10214 — Created Oct. 10, 2018 and submitted
Information | |
---|---|
skaefer143 | |
Djblets | |
master | |
10215 | |
25eac0d... | |
Reviewers | |
djblets, students | |
This change adds a smarter objects selector widget from Review Board 4.0
into Djblets. This is a form field widget and Backbone view, which must
be extended to be useful.See /r/10215.
I ran all tests with
./tests/runtests.py
. No errors were thrown.With the
/r/10215
Review Board patch, I navigated to
admin/db/scmtools/repository/add/
. Next to "Users with access:", the
smarter user selector widget appeared. This widget extends the smarter
objects selector widget.
Description | From | Last Updated |
---|---|---|
Remove period from Summary. |
![]() |
|
Blank line between these. |
|
|
You need to move this template into Djblets as well. If anyone were to use this outside of Review Board, … |
|
|
E501 line too long (84 > 79 characters) |
![]() |
|
E303 too many blank lines (2) |
![]() |
|
E122 continuation line missing indentation or outdented |
![]() |
|
This needs to be Djblets. not RB.. |
|
|
"This is to be used" sounds a bit awkward - if it must be used, I would specify that, or … |
![]() |
|
This comment is really confusing to me, especially the part that says "but the siteconfig field template special cases when … |
|
|
.related-object-selector might be a more clear class name (since it's for the relatedObjectSelectorView)? |
|
|
Could also use _.each($items, function($item) {...}); or $items.forEach(function($item) {...}); rather than a for loop (I typically subscribe to airbnb's Javascript … |
|
|
Typo: initalize --> initialize |
|
|
Capitalization is off here. "size" should be lower case, and "Related" should be upper. |
|
|
Col: 38 Expected '{' and instead saw 'return'. |
![]() |
|
Col: 25 Expected '{' and instead saw 'return'. |
![]() |
|
Col: 29 Expected '{' and instead saw 'return'. |
![]() |
|
Col: 28 Expected '{' and instead saw 'score'. |
![]() |
|
Col: 37 Expected '{' and instead saw 'return'. |
![]() |
|
Col: 36 Expected '{' and instead saw 'return'. |
![]() |
|
Col: 32 'a_value' is defined but never used. |
![]() |
|
Col: 41 'b_value' is defined but never used. |
![]() |
|
Col: 33 Expected '{' and instead saw 'return'. |
![]() |
|
Col: 40 Expected '{' and instead saw 'return'. |
![]() |
|
Col: 56 Expected '{' and instead saw 'options'. |
![]() |
|
Col: 52 Expected '{' and instead saw 'options'. |
![]() |
|
Col: 64 Expected '{' and instead saw 'options'. |
![]() |
|
Col: 26 'value' is defined but never used. |
![]() |
|
Col: 48 'calculateScore' is defined but never used. |
![]() |
|
Col: 22 Expected '{' and instead saw 'search'. |
![]() |
|
Col: 9 'cmp' was used before it was defined. |
![]() |
|
Col: 20 Expected '{' and instead saw 'return'. |
![]() |
|
Col: 20 Expected '{' and instead saw 'return'. |
![]() |
|
Col: 9 'extend' was used before it was defined. |
![]() |
|
Col: 26 Expected '{' and instead saw 'continue'. |
![]() |
|
Col: 9 'trim' was used before it was defined. |
![]() |
|
Col: 9 'escape_regex' was used before it was defined. |
![]() |
|
Col: 9 'is_array' was used before it was defined. |
![]() |
|
Col: 9 'DIACRITICS' was used before it was defined. |
![]() |
|
Col: 9 'asciifold' was used before it was defined. |
![]() |
|
Col: 9 'utils' was used before it was defined. |
![]() |
|
Col: 25 'endbit' is defined but never used. |
![]() |
|
Col: 13 'key' is defined but never used. |
![]() |
|
Col: 17 'timeout_blur' is defined but never used. |
![]() |
-
-
-
djblets/forms/widgets.py (Diff revision 1) This is used inside of Django to extract the value from the
data
andfiles
dictionaries based on the name of the field (name
).See the docs.
-
-
djblets/forms/widgets.py (Diff revision 1) You need to move this template into Djblets as well. If anyone were to use this outside of Review Board, they would get a template not found error.
Change Summary:
I moved the JS Widgets into Djblets, and added a new initialization argument called using_avatars. This is because we can't assume in Djblets that the widget is using an avatar service.
I think this works for moving templates and JS files into Djblets, but let me know if I'm wrong.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+560) |
Checks run (1 failed, 1 succeeded)
flake8
Change Summary:
Fixed some style issues.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+560) |
Checks run (2 succeeded)
Change Summary:
Moved
relatedUserWidget
and relevant files back into Review Board repository. There are problems with the order the JS files are run, though, so widget will not currently render.
Description: |
|
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commit: |
|
|||||||||||||||
Diff: |
Revision 4 (+373 -1) |
Checks run (2 succeeded)
Change Summary:
Widget now displays correctly by changing the name in
staticbundles.py
.
Summary: |
|
||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
||||||||||||||||||||||||
Testing Done: |
|
||||||||||||||||||||||||
Commit: |
|
||||||||||||||||||||||||
Diff: |
Revision 5 (+376 -1) |
Checks run (2 succeeded)
Description: |
|
---|
-
-
djblets/static/djblets/js/admin/views/relatedObjectSelectorView.es6.js (Diff revision 5) This needs to be
Djblets.
notRB.
.
Change Summary:
Defines the RelatedObjectSelectorView with
Djblets.
, notRB.
.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 6 (+376 -1) |
Checks run (2 succeeded)
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 7 (+376) |
Checks run (2 succeeded)

-
-
-
djblets/forms/widgets.py (Diff revision 7) "This is to be used" sounds a bit awkward - if it must be used, I would specify that, or if it is recommended but permissible, should be used, maybe? Or is it potentially better to change it to the imperative voice and say "Use this with..."?
-
-
djblets/forms/widgets.py (Diff revision 7) This comment is really confusing to me, especially the part that says "but the siteconfig field template special cases when
is_hidden
is True" (it seems like it's missing a verb perhaps?). If you could reword this comment a bit to make it a bit more clear that would be great! -
djblets/static/djblets/css/ui/related-object-selector.less (Diff revision 7) .related-object-selector
might be a more clear class name (since it's for therelatedObjectSelectorView
)? -
djblets/static/djblets/js/admin/views/relatedObjectSelectorView.es6.js (Diff revision 7) Could also use
_.each($items, function($item) {...});
or$items.forEach(function($item) {...});
rather than a for loop (I typically subscribe to airbnb's Javascript guidelines which recommends something like this over for loops but maybe a mentor can weigh in on their preference for Javascript style).
Change Summary:
Fixed some comments, as well as changed some html classes to be more descriptive.
Summary: |
|
||||
---|---|---|---|---|---|
Commit: |
|
||||
Diff: |
Revision 8 (+376) |
Checks run (2 succeeded)
-
-
djblets/static/djblets/css/defs.less (Diff revision 8) Capitalization is off here. "size" should be lower case, and "Related" should be upper.
-
-
-
djblets/static/djblets/js/admin/views/relatedObjectSelectorView.es6.js (Diff revision 8) Maybe change wording to "to make necessary API requests"
Change Summary:
Fix some comment grammar.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 9 (+375) |
Checks run (2 succeeded)
Change Summary:
fix the placeholder widget string from being cut off by selectize
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 10 (+381) |
Checks run (2 succeeded)
Change Summary:
move selectize.js out of reviewboard, into djblets.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 11 (+4442) |
Checks run (1 failed, 1 succeeded)
JSHint
-
Warning: Showing 30 of 51 failures.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 38 Expected '{' and instead saw 'return'.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 25 Expected '{' and instead saw 'return'.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 29 Expected '{' and instead saw 'return'.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 28 Expected '{' and instead saw 'score'.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 37 Expected '{' and instead saw 'return'.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 36 Expected '{' and instead saw 'return'.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 32 'a_value' is defined but never used.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 41 'b_value' is defined but never used.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 33 Expected '{' and instead saw 'return'.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 40 Expected '{' and instead saw 'return'.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 56 Expected '{' and instead saw 'options'.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 52 Expected '{' and instead saw 'options'.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 64 Expected '{' and instead saw 'options'.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 26 'value' is defined but never used.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 48 'calculateScore' is defined but never used.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 22 Expected '{' and instead saw 'search'.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 9 'cmp' was used before it was defined.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 20 Expected '{' and instead saw 'return'.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 20 Expected '{' and instead saw 'return'.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 9 'extend' was used before it was defined.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 26 Expected '{' and instead saw 'continue'.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 9 'trim' was used before it was defined.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 9 'escape_regex' was used before it was defined.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 9 'is_array' was used before it was defined.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 9 'DIACRITICS' was used before it was defined.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 9 'asciifold' was used before it was defined.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 9 'utils' was used before it was defined.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 25 'endbit' is defined but never used.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 13 'key' is defined but never used.
-
djblets/static/djblets/js/selectize-0.12.1.js (Diff revision 11) Col: 17 'timeout_blur' is defined but never used.