Migrate some more code to ES6 (3)

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

david
Review Board
release-4.0.x
reviewboard

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
Migrate some more code to ES6 (3)
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)
     
     
     
     
     

    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)
     
     
     
     
     
     
     
     
     
     

    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. Single quotes?

  5. Want to use template literals here?

  6. Single quotes?

  7. reviewboard/static/rb/js/admin/admin.es6.js (Diff revision 1)
     
     
     
     
     

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

    $(...).on('click', () => {
        ...
    });
    
  8. Can the $( go on the second line?

  9. There's a space here.

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

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

  12. 
      
david
Review request changed
chipx86
  1. Ship It!
  2. 
      
Loading...