[WIP] API Explorer template front-end

Review Request #7905 — Created Jan. 24, 2016 and discarded

adilally
Review Board
master
7904
reviewboard

An API Explorer allows developers to make requests to the Web API from their browsers without having to download XML or JSON files. The API Explorer will display the response as syntax highlighted JSON in order to be understandable and facilitate development and understanding of the Web API.

In the future, users will be able to make POST, PUT and DELETE requests from a provided form and view documentation related to the resource.

This patch focuses on displaying the Web API response as syntax highlighted JSON, creating a form for POST, PUT and DELETE requests and displaying the appropriate documentation for the resource.

Tested /api/users/<user_name> and /api/users/ which returned the correct information in the proper format, which displayed correctly in a web browser.

Description From Last Updated

Use 1 space for indentation.

brenniebrennie

We do block tags aligned to the left. We show nesting with additional spaces inside the template tag itself. {% ...

brenniebrennie

One space for indentation.

brenniebrennie

See other comment about blocktags. Likewise for the rest of them here.

brenniebrennie

We don't want to include CSS like this. We'll want to make use of static bundles. Have a look at ...

brenniebrennie

Blank line contains whitespace.

brenniebrennie

Blank line contains whitespace.

brenniebrennie

This file needs to be reformatted.

brenniebrennie

Col: 9 E123 closing bracket does not match indentation of opening bracket's line

reviewbotreviewbot

Col: 9 E123 closing bracket does not match indentation of opening bracket's line

reviewbotreviewbot
reviewbot
  1. Tool: Pyflakes
    Ignored Files:
        reviewboard/templates/webapi/nested.html
        reviewboard/templates/webapi/apiexplorer.html
    
    
    
    Tool: PEP8 Style Checker
    Ignored Files:
        reviewboard/templates/webapi/nested.html
        reviewboard/templates/webapi/apiexplorer.html
    
    
  2. 
      
AD
AD
AD
reviewbot
  1. Tool: Pyflakes
    Ignored Files:
        reviewboard/templates/webapi/nested.html
        reviewboard/templates/webapi/apiexplorer.html
    
    
    
    Tool: PEP8 Style Checker
    Ignored Files:
        reviewboard/templates/webapi/nested.html
        reviewboard/templates/webapi/apiexplorer.html
    
    
  2. 
      
AD
AD
AD
brennie
  1. 
      
  2. Use 1 space for indentation.

  3. reviewboard/templates/webapi/apiexplorer.html (Diff revision 2)
     
     
     
     

    We do block tags aligned to the left. We show nesting with additional spaces inside the template tag itself.

    {% with dict=payload template="webapi/nested.html" %}
    {%  include template %}
    {% endwith %}
    
  4. One space for indentation.

  5. reviewboard/templates/webapi/nested.html (Diff revision 2)
     
     
     
     

    See other comment about blocktags.

    Likewise for the rest of them here.

  6. 
      
AD
reviewbot
  1. Tool: PEP8 Style Checker
    Ignored Files:
        reviewboard/templates/webapi/nested.html
        reviewboard/templates/webapi/apiexplorer.html
    
    
    
    Tool: Pyflakes
    Ignored Files:
        reviewboard/templates/webapi/nested.html
        reviewboard/templates/webapi/apiexplorer.html
    
    
  2. 
      
brennie
  1. 
      
  2. We don't want to include CSS like this. We'll want to make use of static bundles. Have a look at staticbundles.py to see what files end up where.

    You may want to add a new static bundle for the API explorer, but I could be wrong. You'll also want to look at https://github.com/reviewboard/reviewboard/blob/master/reviewboard/templates/base.html#L24 to see how we include CSS.

    The same goes for JS that will eventually go here.

    1. I implemented a potential fix to this issue, not sure if it's done correctly though.

  3. Blank line contains whitespace.

  4. Blank line contains whitespace.

  5. This file needs to be reformatted.

    1. For reference: nested.html is going to be removed in the future, along with the mentioned template tag library.

  6. 
      
AD
reviewbot
  1. Tool: Pyflakes
    Ignored Files:
        reviewboard/templates/webapi/nested.html
        reviewboard/templates/webapi/apiexplorer.html
    
    
    
    Tool: PEP8 Style Checker
    Ignored Files:
        reviewboard/templates/webapi/nested.html
        reviewboard/templates/webapi/apiexplorer.html
    
    
  2. 
      
AD
reviewbot
  1. Tool: Pyflakes
    Ignored Files:
        reviewboard/templates/webapi/nested.html
        reviewboard/templates/webapi/apiexplorer.html
    
    
    
    Tool: PEP8 Style Checker
    Ignored Files:
        reviewboard/templates/webapi/nested.html
        reviewboard/templates/webapi/apiexplorer.html
    
    
  2. 
      
AD
AD
reviewbot
  1. Tool: Pyflakes
    Ignored Files:
        reviewboard/templates/webapi/fields.html
        reviewboard/templates/webapi/apiexplorer.html
    
    
    
    Tool: PEP8 Style Checker
    Ignored Files:
        reviewboard/templates/webapi/fields.html
        reviewboard/templates/webapi/apiexplorer.html
    
    
  2. 
      
AD
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/staticbundles.py
    
    Ignored Files:
        reviewboard/static/rb/js/webapi/utils/apiCaller.js
        reviewboard/templates/webapi/restform.html
        reviewboard/templates/webapi/apiexplorer.html
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/staticbundles.py
    
    Ignored Files:
        reviewboard/static/rb/js/webapi/utils/apiCaller.js
        reviewboard/templates/webapi/restform.html
        reviewboard/templates/webapi/apiexplorer.html
    
    
  2. reviewboard/staticbundles.py (Diff revision 7)
     
     
    Col: 9
     E123 closing bracket does not match indentation of opening bracket's line
    
    1. Conforms to the same formatting that was already used in the file.

  3. 
      
AD
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/staticbundles.py
    
    Ignored Files:
        reviewboard/templates/webapi/payload-only.html
        reviewboard/static/rb/js/webapi/utils/apiCaller.js
        reviewboard/templates/webapi/restform.html
        reviewboard/static/rb/js/utils/apiUtils.js
        reviewboard/templates/webapi/apiexplorer.html
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/staticbundles.py
    
    Ignored Files:
        reviewboard/templates/webapi/payload-only.html
        reviewboard/static/rb/js/webapi/utils/apiCaller.js
        reviewboard/templates/webapi/restform.html
        reviewboard/static/rb/js/utils/apiUtils.js
        reviewboard/templates/webapi/apiexplorer.html
    
    
  2. reviewboard/staticbundles.py (Diff revision 8)
     
     
    Col: 9
     E123 closing bracket does not match indentation of opening bracket's line
    
    1. Adheres to the styling established by the existing static bundles.

  3. 
      
AD
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/staticbundles.py
    
    Ignored Files:
        reviewboard/templates/webapi/payload-only.html
        reviewboard/static/rb/js/webapi/utils/apiCaller.js
        reviewboard/templates/webapi/restform.html
        reviewboard/templates/webapi/apiexplorer.html
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/staticbundles.py
    
    Ignored Files:
        reviewboard/templates/webapi/payload-only.html
        reviewboard/static/rb/js/webapi/utils/apiCaller.js
        reviewboard/templates/webapi/restform.html
        reviewboard/templates/webapi/apiexplorer.html
    
    
  2. 
      
AD
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/staticbundles.py
    
    Ignored Files:
        reviewboard/templates/webapi/payload-only.html
        reviewboard/static/rb/js/webapi/utils/apiCaller.js
        reviewboard/templates/webapi/restform.html
        reviewboard/templates/webapi/apiexplorer.html
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/staticbundles.py
    
    Ignored Files:
        reviewboard/templates/webapi/payload-only.html
        reviewboard/static/rb/js/webapi/utils/apiCaller.js
        reviewboard/templates/webapi/restform.html
        reviewboard/templates/webapi/apiexplorer.html
    
    
  2. 
      
david
Review request changed

Status: Discarded

Loading...