Fix rendering for config form JS models

Review Request #8082 — Created March 28, 2016 and submitted

Information

Djblets
release-0.8.x

Reviewers

The JS model for a JS view for a config form was previously rendering
incorrectly (without a trailing )). This issue has been addressed.
Also, we now are more careful to only render a trailing comma after the
JS model data if there is in fact a page-wide config object. This object
is now only added to the models if it exists.

Tested this with Review Board. The generated JS works now.

Description From Last Updated

I think you broke this line (missing a }})

daviddavid

Do we not want this line in the if form_model_data and js_model_class case?

daviddavid

We have a conditional around form.js_model_class on line 87--how is that different from js_model_class?

daviddavid
reviewbot
  1. Tool: PEP8 Style Checker
    Ignored Files:
        djblets/configforms/templates/configforms/config.html
    
    
    
    Tool: Pyflakes
    Ignored Files:
        djblets/configforms/templates/configforms/config.html
    
    
  2. 
      
brennie
reviewbot
  1. Tool: PEP8 Style Checker
    Ignored Files:
        djblets/configforms/templates/configforms/config.html
    
    
    
    Tool: Pyflakes
    Ignored Files:
        djblets/configforms/templates/configforms/config.html
    
    
  2. 
      
david
  1. Typo in description: "preivously"

  2. Show all issues

    I think you broke this line (missing a }})

  3. Show all issues

    Do we not want this line in the if form_model_data and js_model_class case?

  4. 
      
brennie
reviewbot
  1. Tool: PEP8 Style Checker
    Ignored Files:
        djblets/configforms/templates/configforms/config.html
    
    
    
    Tool: Pyflakes
    Ignored Files:
        djblets/configforms/templates/configforms/config.html
    
    
  2. 
      
david
  1. 
      
  2. djblets/configforms/templates/configforms/config.html (Diff revision 3)
     
     
     
     
     
     
     
     
     
     
    Show all issues

    We have a conditional around form.js_model_class on line 87--how is that different from js_model_class?

    1. The ConfigPagesView class has a js_model_class, which is used for maintaining the state of the entire page -- that is the js_model_class template variable.

      The form.js_model_class is the ConfigPageForm.js_model_class attribute, i.e., the model for an individual form.

  3. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Ignored Files:
        djblets/configforms/templates/configforms/config.html
    
    
    
    Tool: PEP8 Style Checker
    Ignored Files:
        djblets/configforms/templates/configforms/config.html
    
    
  2. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Ignored Files:
        djblets/configforms/templates/configforms/config.html
    
    
    
    Tool: PEP8 Style Checker
    Ignored Files:
        djblets/configforms/templates/configforms/config.html
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
brennie
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.8.x (206ee25)
Loading...