Review UI for JSON files

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

Information

Review Board
master

Reviewers

Create a prettified JSON rendered version and a custom Review UI for JSON files.

 
Summary ID Author
json ui functionality created: squashed commits
4902e455577db34ce9f1b2301adba949ca2b492f nicolelisa
add testing to jsonui.py
60548d031592e5e94da2081a59d83605d3d6abe0 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)
     
     
    Show all issues

    This should go in your Review UI.

  3. 
      
nicolelisa
Review request changed

Commits:

Summary ID Author
add test json data
a911b063b2091b7cd98fa3b852142915a006e562 nicolelisa
modified json file
b779a443c89b40b4680656133a66bc476fcd3c88 nicolelisa
jsonui file created
681c0fd63ccec568d6643182fdd58fcf40265510 nicolelisa
create json specific page
8a34f74b78d77bacde8b590586ade2ef5028059c nicolelisa
Add JsonLexer
ed6af20d1999577a29a24e5a16bb7f4479266127 nicolelisa
Add prettified version of JSON files to rendered
d93362bac30bc18fdc385c72644eb4cc2f92d206 nicolelisa
add test json data
a911b063b2091b7cd98fa3b852142915a006e562 nicolelisa
modified json file
b779a443c89b40b4680656133a66bc476fcd3c88 nicolelisa
jsonui file created
681c0fd63ccec568d6643182fdd58fcf40265510 nicolelisa
create json specific page
8a34f74b78d77bacde8b590586ade2ef5028059c nicolelisa
Add JsonLexer
ed6af20d1999577a29a24e5a16bb7f4479266127 nicolelisa
Add prettified version of JSON files to rendered
d93362bac30bc18fdc385c72644eb4cc2f92d206 nicolelisa
fix reviewbot changes and move supported mimetype
2b2ee52e5b953affb8babc80cc4ab36f683c9516 nicolelisa

Diff:

Revision 2 (+292 -58)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

amalik2
  1. 
      
  2. Show all issues

    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)
     
     
    Show all issues

    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)
     
     
    Show all issues

    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)
     
     
    Show all issues

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

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

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

  7. Show all issues

    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 ID Author
add test json data
525f146eeaf2c87768cb832f4bcd7fa90d6d622a nicolelisa
modified json file
55b3e8a7e15653f2b679ff41eb0795fcb6e654f8 nicolelisa
jsonui file created
cbd4262bc517a427c4846d72804d1847c8d2559c nicolelisa
create json specific page
cc57a6f030109ca9f5beb988d93d59e1a36cea96 nicolelisa
Add JsonLexer
f813e9ca16f3463a156c8ceab92088051ec158a2 nicolelisa
Add prettified version of JSON files to rendered
3844b6180b6ca9bb24d3f85c36733e447771e93a nicolelisa
fix reviewbot changes and move supported mimetype
02de0e02bb76744ef1cfb737d34c320b2ab902c0 nicolelisa
Add error handling and make review suggestions
b75b7170e7b937f0934a9081fd01a6f2e5f478d9 nicolelisa
mirrored checkbox structure
5cc736b51aac899ba629e485453a1a81dcae69e1 nicolelisa
add test json data
525f146eeaf2c87768cb832f4bcd7fa90d6d622a nicolelisa
modified json file
55b3e8a7e15653f2b679ff41eb0795fcb6e654f8 nicolelisa
jsonui file created
cbd4262bc517a427c4846d72804d1847c8d2559c nicolelisa
create json specific page
cc57a6f030109ca9f5beb988d93d59e1a36cea96 nicolelisa
Add JsonLexer
f813e9ca16f3463a156c8ceab92088051ec158a2 nicolelisa
Add prettified version of JSON files to rendered
3844b6180b6ca9bb24d3f85c36733e447771e93a nicolelisa
fix reviewbot changes and move supported mimetype
02de0e02bb76744ef1cfb737d34c320b2ab902c0 nicolelisa
Add error handling and make review suggestions
b75b7170e7b937f0934a9081fd01a6f2e5f478d9 nicolelisa
mirrored checkbox structure
5cc736b51aac899ba629e485453a1a81dcae69e1 nicolelisa
json testing
37fc47024f5810f58d509d1b764c57f7e18f1c72 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 ID Author
add test json data
525f146eeaf2c87768cb832f4bcd7fa90d6d622a nicolelisa
modified json file
55b3e8a7e15653f2b679ff41eb0795fcb6e654f8 nicolelisa
jsonui file created
cbd4262bc517a427c4846d72804d1847c8d2559c nicolelisa
create json specific page
cc57a6f030109ca9f5beb988d93d59e1a36cea96 nicolelisa
Add JsonLexer
f813e9ca16f3463a156c8ceab92088051ec158a2 nicolelisa
Add prettified version of JSON files to rendered
3844b6180b6ca9bb24d3f85c36733e447771e93a nicolelisa
fix reviewbot changes and move supported mimetype
02de0e02bb76744ef1cfb737d34c320b2ab902c0 nicolelisa
Add error handling and make review suggestions
b75b7170e7b937f0934a9081fd01a6f2e5f478d9 nicolelisa
mirrored checkbox structure
5cc736b51aac899ba629e485453a1a81dcae69e1 nicolelisa
json testing
8b59fe2b4920c1776af77304d0a0e49c40fcf1ad nicolelisa
add test json data
525f146eeaf2c87768cb832f4bcd7fa90d6d622a nicolelisa
modified json file
55b3e8a7e15653f2b679ff41eb0795fcb6e654f8 nicolelisa
jsonui file created
cbd4262bc517a427c4846d72804d1847c8d2559c nicolelisa
create json specific page
cc57a6f030109ca9f5beb988d93d59e1a36cea96 nicolelisa
Add JsonLexer
f813e9ca16f3463a156c8ceab92088051ec158a2 nicolelisa
Add prettified version of JSON files to rendered
3844b6180b6ca9bb24d3f85c36733e447771e93a nicolelisa
fix reviewbot changes and move supported mimetype
02de0e02bb76744ef1cfb737d34c320b2ab902c0 nicolelisa
Add error handling and make review suggestions
b75b7170e7b937f0934a9081fd01a6f2e5f478d9 nicolelisa
mirrored checkbox structure
5cc736b51aac899ba629e485453a1a81dcae69e1 nicolelisa
json testing
38f1e834099efeb290f7cde48e437f994dd0c91b 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 ID Author
add test json data
525f146eeaf2c87768cb832f4bcd7fa90d6d622a nicolelisa
modified json file
55b3e8a7e15653f2b679ff41eb0795fcb6e654f8 nicolelisa
jsonui file created
cbd4262bc517a427c4846d72804d1847c8d2559c nicolelisa
create json specific page
cc57a6f030109ca9f5beb988d93d59e1a36cea96 nicolelisa
Add JsonLexer
f813e9ca16f3463a156c8ceab92088051ec158a2 nicolelisa
Add prettified version of JSON files to rendered
3844b6180b6ca9bb24d3f85c36733e447771e93a nicolelisa
fix reviewbot changes and move supported mimetype
02de0e02bb76744ef1cfb737d34c320b2ab902c0 nicolelisa
Add error handling and make review suggestions
b75b7170e7b937f0934a9081fd01a6f2e5f478d9 nicolelisa
mirrored checkbox structure
5cc736b51aac899ba629e485453a1a81dcae69e1 nicolelisa
json testing
38f1e834099efeb290f7cde48e437f994dd0c91b nicolelisa
add test json data
53b7ac8f5688c3fe3efaa270e7d924ee2ef26ff6 nicolelisa
modified json file
6a2394880a868f7cbf92e3ea65c4132d34f6ac11 nicolelisa
jsonui file created
1efa4ef808c3cbc66f73780657e16e9962f6a764 nicolelisa
create json specific page
a2d5c2dc8a52a2a3285724f3614c0adb3af9a31f nicolelisa
Add JsonLexer
2e14e0e95f43dbf775fb5d9af969c7b56a89652e nicolelisa
Add prettified version of JSON files to rendered
9fdf3e00a79c019df3dbce99b7f90284c4142320 nicolelisa
fix reviewbot changes and move supported mimetype
a1f582af7a35db5ae77795b8050bd2e2be987aca nicolelisa
Add error handling and make review suggestions
e01d17ed24a699577d3ec3619d5ed0bf40f6f6e6 nicolelisa
mirrored checkbox structure
61e191c3427b67cef2b30aaab11ed1c6d8c56c33 nicolelisa
json testing
b86b0e1713a13e2e3f5a44c9714cefcc06bf6f2f nicolelisa
add testing and fix issues with <pre> tag
c2af08ff6c81982919a7f59cf6fc17d16ff8fdac nicolelisa
fix issues found by reviewbot
6cdb46b8ef4c03b4f99f4c82fd7275d7c47d785c nicolelisa

Diff:

Revision 10 (+1043 -157)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

nicolelisa
nicolelisa
nicolelisa
Review request changed

Summary:

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

Description:

~  

modified json file

  ~

Create a prettified JSON rendered version and a custom Review UI for JSON files.

-   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.

Loading...