Convert ImageReviewableView and RegionCommentBlockView to ES6.

Review Request #8214 — Created June 3, 2016 and submitted

david
Review Board
release-3.0.x
8216, 8215
870eca9...
reviewboard

This change does the basic conversion (let/const, member function sugar, fix up
and add documentation comments), but also consolidates the code a bit to remove
extra helper functions that were only called from one place and didn't help
structure the code any better.

This is in preparation for the high-DPI image review feature.

  • Ran unit tests.
  • Used in conjunction with other changes.
Description From Last Updated

Can we rename this to percentage?

brenniebrennie

This should maybe indicate the range is inclusive.

brenniebrennie

Should indicate range is inclusive.

brenniebrennie

Can we rename this to setSplitPercentage(percentage) ?

brenniebrennie

I would find ../${revisionTip}/ more readable here.

brenniebrennie

Likewise with ../${revisionBase}-${revisionTip}/

brenniebrennie

Blank line

brenniebrennie

This can be a single line.

brenniebrennie

The { and } are unnecessary.

brenniebrennie

Grammar?

brenniebrennie

No comma.

brenniebrennie

Can we reword this as: If not, the event was actually a ``click`` event and we call the superclass' click ...

brenniebrennie

``true`` over "yes" ``click``

brenniebrennie

``e.target``

brenniebrennie
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/staticbundles.py
    
    Ignored Files:
        reviewboard/static/rb/js/views/regionCommentBlockView.js
        reviewboard/static/rb/js/views/imageReviewableView.es6.js
        reviewboard/static/rb/js/views/regionCommentBlockView.es6.js
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/staticbundles.py
    
    Ignored Files:
        reviewboard/static/rb/js/views/regionCommentBlockView.js
        reviewboard/static/rb/js/views/imageReviewableView.es6.js
        reviewboard/static/rb/js/views/regionCommentBlockView.es6.js
    
    
  2. 
      
brennie
  1. 
      
  2. Can we rename this to percentage?

  3. This should maybe indicate the range is inclusive.

  4. Should indicate range is inclusive.

  5. Can we rename this to setSplitPercentage(percentage) ?

  6. I would find ../${revisionTip}/ more readable here.

  7. Likewise with ../${revisionBase}-${revisionTip}/

  8. This can be a single line.

  9. Can we reword this as:

    If not, the event was actually a ``click`` event and we call the superclass' click handler.
    
  10. ``true`` over "yes"

    ``click``
    
  11. 
      
david
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/staticbundles.py
    
    Ignored Files:
        reviewboard/static/rb/js/views/regionCommentBlockView.js
        reviewboard/static/rb/js/views/imageReviewableView.es6.js
        reviewboard/static/rb/js/views/regionCommentBlockView.es6.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/staticbundles.py
    
    Ignored Files:
        reviewboard/static/rb/js/views/regionCommentBlockView.js
        reviewboard/static/rb/js/views/imageReviewableView.es6.js
        reviewboard/static/rb/js/views/regionCommentBlockView.es6.js
    
    
  2. 
      
brennie
  1. 
      
  2. The { and } are unnecessary.

    1. They are, but when doing assigns inside of a fat arrow function I think it makes it more readable (and I believe Christian feels the same way).

  3. 
      
david
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/staticbundles.py
    
    Ignored Files:
        reviewboard/static/rb/js/views/regionCommentBlockView.js
        reviewboard/static/rb/js/views/imageReviewableView.es6.js
        reviewboard/static/rb/js/views/regionCommentBlockView.es6.js
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/staticbundles.py
    
    Ignored Files:
        reviewboard/static/rb/js/views/regionCommentBlockView.js
        reviewboard/static/rb/js/views/imageReviewableView.es6.js
        reviewboard/static/rb/js/views/regionCommentBlockView.es6.js
    
    
  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (103579e)
Loading...