Added function to reload render options with AJAX.

Review Request #10749 — Created Oct. 9, 2019 and updated

amalik2
Review Board
master
10745, 10731
10713
reviewboard, students

Individual review UIs that have dynamic render options can call this function,
and optionally pass in extra query parameters to send to the endpoint.

More details can be found here

  1. Ran JavaScript unit tests.
  2. Tested manually to make sure that the element to update actually gets
    updated by using a mock endpoint.
  3. Tested manually to make sure comments are correctly reattached after
    a request is finished.
Summary Author
Added function to reload render options with AJAX.
amalik2
Description From Last Updated

This also depends on the endpoint that will serve up the contents of the tables, so for now there's some ...

amalik2amalik2

E302 expected 2 blank lines, found 1

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

Col: 24 ['$el'] is better written in dot notation.

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

E265 block comment should start with '# '

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

E265 block comment should start with '# '

reviewbotreviewbot

New CSS should follow this guide

brenniebrennie

You can use regular function statements here.

brenniebrennie

Leftover testing code?

brenniebrennie

E302 expected 2 blank lines, found 1

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

E265 block comment should start with '# '

reviewbotreviewbot

Col: 6 Unnecessary semicolon.

reviewbotreviewbot

Col: 6 Unnecessary semicolon.

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

E265 block comment should start with '# '

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

E302 expected 2 blank lines, found 1

reviewbotreviewbot

E265 block comment should start with '# '

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

amalik2
Review request changed

Commits:

Summary Author
-
contentReloaded TODO message
amalik2
-
Added function to reload render options with AJAX.
amalik2
+
started on reloading comments after reloading data
amalik2
+
contentReloaded TODO message
amalik2
+
Added function to reload render options with AJAX.
amalik2

Diff:

Revision 2 (+444 -4)

Show changes

Checks run (2 failed)

flake8 failed.
JSHint failed.

flake8

JSHint

amalik2
amalik2
Review request changed

Summary:

-WIP: Added function to reload render options with AJAX.
+Added function to reload render options with AJAX.

Description:

~  

Still need to reload comments when a table gets updated

  ~

Individual review UIs that have dynamic render options can call this function,

  + and optionally pass in extra query parameters to send to the endpoint.

  +
  +

More details can be found here

Testing Done:

   
  1. Ran JavaScript unit tests.
   
  1. Tested manually to make sure that the element to update actually gets
    updated by using a mock endpoint.
  +
  1. Tested manually to make sure comments are correctly reattached after
    a request is finished.

Commits:

Summary Author
-
started on reloading comments after reloading data
amalik2
-
contentReloaded TODO message
amalik2
-
Added function to reload render options with AJAX.
amalik2
+
started on reloading comments after reloading data
amalik2
+
contentReloaded TODO message
amalik2
+
fixed refreshing comments after table reloads
amalik2
+
Added function to reload render options with AJAX.
amalik2
+
refactored refresh
amalik2

Diff:

Revision 3 (+575 -27)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

amalik2
  1. 
      
  2. This also depends on the endpoint that will serve up the contents of the tables, so for now there's some code here for testing purposes that I'll remove later

  3. 
      
amalik2
Review request changed

Commits:

Summary Author
-
started on reloading comments after reloading data
amalik2
-
contentReloaded TODO message
amalik2
-
fixed refreshing comments after table reloads
amalik2
-
Added function to reload render options with AJAX.
amalik2
-
refactored refresh
amalik2
+
started on reloading comments after reloading data
amalik2
+
contentReloaded TODO message
amalik2
+
fixed refreshing comments after table reloads
amalik2
+
fixed div not being disabled
amalik2
+
Added function to reload render options with AJAX.
amalik2
+
refactored refresh
amalik2

Depends On:

+10731 - Added render options block to text review template.

Diff:

Revision 4 (+587 -31)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

brennie
  1. 
      
  2. reviewboard/static/rb/css/common.less (Diff revision 4)
     
     

    New CSS should follow this guide

    1. I think this is resolved now

  3. reviewboard/static/rb/js/views/tests/textBasedReviewableViewTests.es6.js (Diff revision 4)
     
     
     
     
     
     
     
     
     
     
     

    You can use regular function statements here.

  4. Leftover testing code?

    1. Yes, I'm not sure what endpoint I'm supposed to hit right now

  5. 
      
amalik2
Review request changed

Commits:

Summary Author
-
started on reloading comments after reloading data
amalik2
-
contentReloaded TODO message
amalik2
-
fixed refreshing comments after table reloads
amalik2
-
fixed div not being disabled
amalik2
-
Added function to reload render options with AJAX.
amalik2
-
refactored refresh
amalik2
+
started on reloading comments after reloading data
amalik2
+
contentReloaded TODO message
amalik2
+
fixed refreshing comments after table reloads
amalik2
+
fixed div not being disabled
amalik2
+
Added function to reload render options with AJAX.
amalik2
+
addressed comments on review request
amalik2
+
refactored refresh
amalik2

Diff:

Revision 5 (+600 -38)

Show changes

Checks run (2 failed)

flake8 failed.
JSHint failed.

flake8

JSHint

amalik2
Review request changed

Commits:

Summary Author
-
started on reloading comments after reloading data
amalik2
-
contentReloaded TODO message
amalik2
-
fixed refreshing comments after table reloads
amalik2
-
fixed div not being disabled
amalik2
-
Added function to reload render options with AJAX.
amalik2
-
addressed comments on review request
amalik2
-
refactored refresh
amalik2
+
Added function to reload render options with AJAX.
amalik2

Diff:

Revision 6 (+566 -4)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

amalik2
Review request changed

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

Loading...