WIP: Review UI for JSON files

Review Request #10716 — Created Sept. 13, 2019 and updated

nicolelisa
Review Board
master
reviewboard, students

modified json file
jsonui file created
create json specific page
Add JsonLexer
Add prettified version of JSON files to rendered

Currently an issue with diff for file attachments.



Summary Author
json ui functionality created: squashed commits
nicolelisa
add testing to jsonui.py
nicolelisa
Description From Last Updated

Can you upload screenshots of your review UI in the normal rendered JSON view, as well as in the diff ...

amalik2amalik2

F401 'logging' imported but unused

reviewbotreviewbot

F401 'reviewboard.diffviewer.chunk_generator.RawDiffChunkGenerator' imported but unused

reviewbotreviewbot

E501 line too long (92 > 79 characters)

reviewbotreviewbot

This should go in your Review UI.

brenniebrennie

F821 undefined name 'force_bytes'

reviewbotreviewbot

F821 undefined name 'force_bytes'

reviewbotreviewbot

F821 undefined name 'force_bytes'

reviewbotreviewbot

F821 undefined name 'force_bytes'

reviewbotreviewbot

W292 no newline at end of file

reviewbotreviewbot

This commented import should either be removed or uncommented

amalik2amalik2

You should handle invalid JSON being parsed. If the user uploads a JSON file that json.dumps is unable to process, ...

amalik2amalik2

E501 line too long (80 > 79 characters)

reviewbotreviewbot

Make sure to delete this file once you're finished testing.

amalik2amalik2

Make sure to revert all changes in this file once Christian's PR with the same changes is merged

amalik2amalik2

Can you upload an image of where this CSS rule is used, and how the UI differs when it isn't ...

amalik2amalik2

E303 too many blank lines (3)

reviewbotreviewbot

E127 continuation line over-indented for visual indent

reviewbotreviewbot

E116 unexpected indentation (comment)

reviewbotreviewbot

E501 line too long (147 > 79 characters)

reviewbotreviewbot

E501 line too long (138 > 79 characters)

reviewbotreviewbot

E501 line too long (80 > 79 characters)

reviewbotreviewbot

E126 continuation line over-indented for hanging indent

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

flake8

brennie
  1. 
      
  2. reviewboard/reviews/ui/text.py (Diff revision 1)
     
     

    This should go in your Review UI.

  3. 
      
nicolelisa
Review request changed

Commits:

Summary Author
-
jsonui file created
nicolelisa
-
create json specific page
nicolelisa
-
add test json data
nicolelisa
-
modified json file
nicolelisa
-
Add prettified version of JSON files to rendered
nicolelisa
-
Add JsonLexer
nicolelisa
+
fix reviewbot changes and move supported mimetype
nicolelisa
+
jsonui file created
nicolelisa
+
create json specific page
nicolelisa
+
add test json data
nicolelisa
+
modified json file
nicolelisa
+
Add prettified version of JSON files to rendered
nicolelisa
+
Add JsonLexer
nicolelisa

Diff:

Revision 2 (+292 -58)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

amalik2
  1. 
      
  2. Can you upload screenshots of your review UI in the normal rendered JSON view, as well as in the diff viewer?

    1. Sure. I'm not sure the best way to upload them but here are some dropbox links:

      https://www.dropbox.com/s/q0ecf3jqtipn0nm/Screen%20Shot%202019-09-14%20at%206.22.35%20PM.png?dl=0
      https://www.dropbox.com/s/qn4yz42rkpntfpj/Screen%20Shot%202019-09-14%20at%206.22.56%20PM.png?dl=0
      https://www.dropbox.com/s/pcwxrzvqfppwn08/Screen%20Shot%202019-09-14%20at%206.23.27%20PM.png?dl=0

      Note that one of them has an issue with whitespace, which should be a fairly easy fix next week.

  3. reviewboard/reviews/ui/jsonui.py (Diff revision 2)
     
     

    This commented import should either be removed or uncommented

    1. Uncommenting it gives an error with the Review bot, but I kept it there as a TODO since the markdown version has it.

  4. reviewboard/reviews/ui/jsonui.py (Diff revision 2)
     
     

    You should handle invalid JSON being parsed. If the user uploads a JSON file that json.dumps is unable to process, it would be best to display an error message to the user indicating that their JSON is invalid. In the markdown UI file, the try/catch in the generate_render() function handled this purpose. You should follow that same pattern, and wrap your code with a try/catch block. In the catch clause, you can yield the error message, and that error message will be visible in the render view when a parsing error occurs.

    1. Sounds good! Will put this on my list for next week.

  5. reviewboard/reviews/ui/test.json (Diff revision 2)
     
     

    Make sure to delete this file once you're finished testing.

  6. reviewboard/reviews/ui/text.py (Diff revision 2)
     
     

    Make sure to revert all changes in this file once Christian's PR with the same changes is merged

  7. Can you upload an image of where this CSS rule is used, and how the UI differs when it isn't set?

    1. This is in the above screenshots. The screenshot has it removed, but when it is added, the diff files stop working,
      so I'm figuring out a way to differentiate them in CSS to prevent this.

  8. 
      
nicolelisa
nicolelisa
nicolelisa
nicolelisa
nicolelisa
Review request changed

Summary:

-Review UI for JSON files - WIP
+WIP: Review UI for JSON files

Commits:

Summary Author
-
fix reviewbot changes and move supported mimetype
nicolelisa
-
Add prettified version of JSON files to rendered
nicolelisa
-
add test json data
nicolelisa
-
modified json file
nicolelisa
-
mirrored checkbox structure
nicolelisa
-
Add error handling and make review suggestions
nicolelisa
-
jsonui file created
nicolelisa
-
create json specific page
nicolelisa
-
Add JsonLexer
nicolelisa
+
fix reviewbot changes and move supported mimetype
nicolelisa
+
json testing
nicolelisa
+
Add prettified version of JSON files to rendered
nicolelisa
+
add test json data
nicolelisa
+
modified json file
nicolelisa
+
mirrored checkbox structure
nicolelisa
+
Add error handling and make review suggestions
nicolelisa
+
jsonui file created
nicolelisa
+
create json specific page
nicolelisa
+
Add JsonLexer
nicolelisa

Diff:

Revision 7 (+873 -87)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

nicolelisa
nicolelisa
Review request changed

Commits:

Summary Author
-
fix reviewbot changes and move supported mimetype
nicolelisa
-
Add prettified version of JSON files to rendered
nicolelisa
-
add test json data
nicolelisa
-
modified json file
nicolelisa
-
mirrored checkbox structure
nicolelisa
-
json testing
nicolelisa
-
Add error handling and make review suggestions
nicolelisa
-
jsonui file created
nicolelisa
-
create json specific page
nicolelisa
-
Add JsonLexer
nicolelisa
+
fix reviewbot changes and move supported mimetype
nicolelisa
+
Add prettified version of JSON files to rendered
nicolelisa
+
json testing
nicolelisa
+
add test json data
nicolelisa
+
modified json file
nicolelisa
+
mirrored checkbox structure
nicolelisa
+
Add error handling and make review suggestions
nicolelisa
+
jsonui file created
nicolelisa
+
create json specific page
nicolelisa
+
Add JsonLexer
nicolelisa

Diff:

Revision 9 (+881 -87)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

nicolelisa
Review request changed

Commits:

Summary Author
-
fix reviewbot changes and move supported mimetype
nicolelisa
-
Add prettified version of JSON files to rendered
nicolelisa
-
json testing
nicolelisa
-
add test json data
nicolelisa
-
modified json file
nicolelisa
-
mirrored checkbox structure
nicolelisa
-
Add error handling and make review suggestions
nicolelisa
-
jsonui file created
nicolelisa
-
create json specific page
nicolelisa
-
Add JsonLexer
nicolelisa
+
jsonui file created
nicolelisa
+
Add JsonLexer
nicolelisa
+
add test json data
nicolelisa
+
mirrored checkbox structure
nicolelisa
+
modified json file
nicolelisa
+
fix issues found by reviewbot
nicolelisa
+
Add prettified version of JSON files to rendered
nicolelisa
+
fix reviewbot changes and move supported mimetype
nicolelisa
+
create json specific page
nicolelisa
+
json testing
nicolelisa
+
add testing and fix issues with <pre> tag
nicolelisa
+
Add error handling and make review suggestions
nicolelisa

Diff:

Revision 10 (+1043 -157)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

nicolelisa
nicolelisa
Review request changed

Commits:

Summary Author
-
jsonui file created
nicolelisa
-
Add JsonLexer
nicolelisa
-
add test json data
nicolelisa
-
mirrored checkbox structure
nicolelisa
-
modified json file
nicolelisa
-
fix issues found by reviewbot
nicolelisa
-
Add prettified version of JSON files to rendered
nicolelisa
-
fix reviewbot changes and move supported mimetype
nicolelisa
-
create json specific page
nicolelisa
-
json testing
nicolelisa
-
add testing and fix issues with <pre> tag
nicolelisa
-
Add error handling and make review suggestions
nicolelisa
+
json ui functionality created: squashed commits
nicolelisa
+
add testing to jsonui.py
nicolelisa

Diff:

Revision 12 (+536)

Show changes

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
Loading...