• 
      

    Migrate some more code to ES6 (3)

    Review Request #10413 — Created Feb. 17, 2019 and submitted

    Information

    Review Board
    release-4.0.x

    Reviewers

    This change converts the remaining non-test code to ES6. This is just a
    grab-bag of remaining files throughout the code.

    Ran js-tests.

    Summary ID
    Migrate some more code to ES6 (3)
    This change converts the remaining non-test code to ES6. This is just a grab-bag of remaining files throughout the code. Testing done: Ran js-tests.
    5e83484bb6c85ad64911fb2fd5ab3ff7ae1bc2cf
    Description From Last Updated

    Can you make these single-quote strings while these lines are being changed?

    chipx86chipx86

    Maybe more work than you want to do here, but this would be simplified so much if we just calculated …

    chipx86chipx86

    Single quotes?

    chipx86chipx86

    $element

    chipx86chipx86

    Want to use template literals here?

    chipx86chipx86

    Single quotes?

    chipx86chipx86

    I feel like this reads a lot better the old way: $(...).on('click', () => { ... });

    chipx86chipx86

    Can the $( go on the second line?

    chipx86chipx86

    There's a space here.

    chipx86chipx86

    Can you switch these to this.listenTo() calls?

    chipx86chipx86

    This can move into the if. It's unused otherwise.

    chipx86chipx86

    MaMaMaMaMaMa

    chipx86chipx86
    chipx86
    1. 
        
    2. reviewboard/static/rb/js/admin/admin.es6.js (Diff revision 1)
       
       
       
       
       
      Show all issues

      Can you make these single-quote strings while these lines are being changed?

    3. reviewboard/static/rb/js/admin/admin.es6.js (Diff revision 1)
       
       
       
       
       
       
       
       
       
       
      Show all issues

      Maybe more work than you want to do here, but this would be simplified so much if we just calculated the admin-widgets vs admin-extras in the if and then just plugged that into the selector once, since the rest is all just copy/paste.

      1. Seeing as we're planning on making more changes to the dashboard soonish I'd rather hold off.

    4. Show all issues

      Single quotes?

    5. Show all issues

      $element

    6. Show all issues

      Want to use template literals here?

    7. Show all issues

      Single quotes?

    8. reviewboard/static/rb/js/admin/admin.es6.js (Diff revision 1)
       
       
       
       
       
      Show all issues

      I feel like this reads a lot better the old way:

      $(...).on('click', () => {
          ...
      });
      
    9. Show all issues

      Can the $( go on the second line?

    10. Show all issues

      There's a space here.

    11. Show all issues

      Can you switch these to this.listenTo() calls?

    12. Show all issues

      This can move into the if. It's unused otherwise.

    13. Show all issues

      MaMaMaMaMaMa

    14. 
        
    david
    chipx86
    1. Ship It!
    2. 
        
    david
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-4.0.x (30e618e)