Archive review requests from inbox icon

Review Request #10154 — Created Sept. 21, 2018 and updated

Malcolm
Review Board
master
9afd7cf...
reviewboard, students

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.

  • 1
  • 0
  • 12
  • 0
  • 13
Description From Last Updated
We're now doing the same equality check three times. How about adding: const visible = (visibility === RB.ReviewRequest.VISIBILITY_VISIBLE); david david
brennie
  1. 
      
  2. Can you add some title= text to the inbox icon that says "Archive" ?

  3. 
      
david
  1. 
      
  2. Please update the description to include a little bit more information about the motivation for this change.

  3. Please fill out the "Testing done" field explaining what you have done to test the change.

  4. This is an es6 file, so we can (and should) have a comma on the last item in the object.

  5. 
      
Malcolm
  1. nn

  2. 
      
Malcolm
Malcolm
Malcolm
brennie
  1. 
      
  2. Can you wrap your description & testing done at 72 characters?

  3. Can you limit your summary to 50 characters or so?

  4. 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>
    
  5. reviewboard/static/rb/js/views/reviewRequestEditorView.es6.js (Diff revision 2)
     
     
     
     
     
     
     
     
     
     
     

    Your code has trailing whitespace. You'll want to remove this.

  6. This should be let over `var.

  7. Instead of switching on the iconClass, I would do what the calculation for iconClass 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 so iconTitle could end up undefined.

  8. These need to use gettext('...') so that the strings are marked for translation.

  9. 
      
Malcolm
brennie
  1. 
      
  2. 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.

  3. 
      
Malcolm
Review request changed

Change Summary:

Added id to the archiving shortcut.

Commit:

-20684076665693995aa323f41ae5f41388a0d214
+9afd7cf3dbd51e0c4db757ae13d35b29eadb781e

Diff:

Revision 5 (+10 -1)

Show changes

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
david
  1. 
      
  2. 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);
    
  3. 
      
Loading...