Archive review requests from inbox icon
Review Request #10154 — Created Sept. 21, 2018 and submitted
Made the inbox icon on review request pages a shortcut for
archiving/unarchiving the review request.The idea behind this change is to make the archiving/unarchiving of
requests a little bit faster for advanced users.The shortcut was implemented by adding archive/unarchive click handlers
to the icon. A title attribute was also added to the icon which
dynamically changes to "Archive review request" or "Unarchive review
request". This should help with accessibility and general ease of use.
There were no changes made to any Python files so the Python tests were
not ran for this change.The JS tests were ran for these changes.
These changes were implemented off the master branch version of
ReviewBoard which had 6 failures for the JS tests.The JS tests when ran on this update had the same 6 failures as in the
master branch JS tests.
Description | From | Last Updated |
---|---|---|
Can you add some title= text to the inbox icon that says "Archive" ? |
|
|
Please update the description to include a little bit more information about the motivation for this change. |
|
|
Please fill out the "Testing done" field explaining what you have done to test the change. |
|
|
Can you limit your summary to 50 characters or so? |
|
|
Can you rewrite your summary to be in the imperitive mood, i.e., as if it were a command or order? … |
|
|
Can you wrap your description & testing done at 72 characters? |
|
|
This is an es6 file, so we can (and should) have a comma on the last item in the object. |
|
|
Your code has trailing whitespace. You'll want to remove this. |
|
|
This should be let over `var. |
|
|
Instead of switching on the iconClass, I would do what the calculation for iconClass does, e.g.: const iconTitle = (visibility … |
|
|
These need to use gettext('...') so that the strings are marked for translation. |
|
|
Since these are classes, they aren't necessarily unique. It is possible that the rb-icon-archive-{on,off} class could be used for another … |
|
|
We're now doing the same equality check three times. How about adding: const visible = (visibility === RB.ReviewRequest.VISIBILITY_VISIBLE); |
|
-
-
Please update the description to include a little bit more information about the motivation for this change.
-
-
reviewboard/static/rb/js/views/reviewRequestEditorView.es6.js (Diff revision 1) This is an es6 file, so we can (and should) have a comma on the last item in the object.
Description: |
|
||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Testing Done: |
|
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+13 -1) |
Checks run (2 succeeded)
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+13 -1) |
Checks run (2 succeeded)
-
-
-
Can you rewrite your summary to be in the imperitive mood, i.e., as if it were a command or order?
If you substitute your summary into the following sentence, it should make sense:
This patch will <summary>
-
-
reviewboard/static/rb/js/views/reviewRequestEditorView.es6.js (Diff revision 2) Your code has trailing whitespace. You'll want to remove this.
-
reviewboard/static/rb/js/views/reviewRequestEditorView.es6.js (Diff revision 2) This should be
let
over `var. -
reviewboard/static/rb/js/views/reviewRequestEditorView.es6.js (Diff revision 2) Instead of switching on the
iconClass
, I would do what the calculation foriconClass
does, e.g.:const iconTitle = (visibility === RB.ReviewRequest.VISIBILITY_VISIBLE ? gettext('Archive review request') : gettext('Unarchive review request'));
This is because the underlying case is a boolean, which are easier to compare compared to strings (which at worst compare N bytes of an N byte string instead of 1).
Also, at first glance, there is no
default
case soiconTitle
could end upundefined
. -
reviewboard/static/rb/js/views/reviewRequestEditorView.es6.js (Diff revision 2) These need to use
gettext('...')
so that the strings are marked for translation.
Summary: |
|
|||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
|||||||||||||||||||||||||||||||||||||||
Testing Done: |
|
|||||||||||||||||||||||||||||||||||||||
Commit: |
|
|||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 4 (+7 -1) |
Checks run (2 succeeded)
-
-
reviewboard/static/rb/js/views/reviewRequestEditorView.es6.js (Diff revision 4) Since these are classes, they aren't necessarily unique. It is possible that the
rb-icon-archive-{on,off}
class could be used for another icon somewhere in the editor view.So let's make them unique by adding an ID to this.
Change Summary:
Added id to the archiving shortcut.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 5 (+10 -1) |
Checks run (2 succeeded)
-
-
reviewboard/static/rb/js/views/reviewRequestEditorView.es6.js (Diff revision 5) We're now doing the same equality check three times. How about adding:
const visible = (visibility === RB.ReviewRequest.VISIBILITY_VISIBLE);