Add optional Markdown support to the Review dialog.

Review Request #6483 — Created Oct. 21, 2014 and submitted

Information

Review Board
release-2.0.x
e1fae31...

Reviewers

This adds checkboxes below the text fields in the Review dialog for
toggling Markdown support. It also loads the correct values from the
API, depending on the user's defaultUseRichText setting in UserSession.

If the default is to use Markdown, the review and comments will be
requested with text normalized to Markdown, and all TextEditorViews will
be set to save as Markdown by default.

If the default is to use plain text, the review and comments will be
requested without any text normalization, allowing the default values to
come in. All TextEditorViews will therefore reflect the stored value.

Toggling the new "Enable Markdown" checkbox for any field will mark that
field as dirty, so that it will be saved when saving or publishing the
review. That will then be saved along with the appropriate Rich Text
setting.

Tested loading the body and comment fields with both Markdown and plain text
flags set, and with different defaultUseRichText values set.

Tested saving with both Markdown and plain text.

Viewed the payloads to make sure we were loading what was expected.

Unit tests pass.

reviewbot
  1. Tool: PEP8 Style Checker
    Ignored Files:
        reviewboard/static/rb/js/resources/collections/resourceCollection.js
        reviewboard/static/rb/js/views/reviewDialogView.js
        reviewboard/static/rb/js/views/tests/reviewDialogViewTests.js
        reviewboard/static/rb/js/resources/models/reviewModel.js
    
    
    
    Tool: Pyflakes
    Ignored Files:
        reviewboard/static/rb/js/resources/collections/resourceCollection.js
        reviewboard/static/rb/js/views/reviewDialogView.js
        reviewboard/static/rb/js/views/tests/reviewDialogViewTests.js
        reviewboard/static/rb/js/resources/models/reviewModel.js
    
    
  2. 
      
david
  1. 
      
  2. Hrm. Does _.extend({}, undefined) return {}?

  3. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to markdown-redesign (fb07246)
Loading...