Add ?include-text-types= to the API to replace ?include-raw-text-fields.

Review Request #6553 — Created Nov. 3, 2014 and submitted

Information

Review Board
release-2.0.x
deae0c3...

Reviewers

The new review dialog demonstrated a need to have not just HTML-forced
text in API payloads, but Markdown-forced as well. The API didn't
previously provide a way to make this happen.

This change introduces a new option for including multiple text types in
one payload. This directly replaces ?include-raw-text-fields, allowing
for the client to request raw text, HTML, Markdown, and/or plain text in
one request. These all end up in their own container fields in the
payload (such as markdown_text_fields, raw_text_fields, etc.). It also
works pretty well as a replacement for ?force-text-type= in most cases,
though does not necessarily warrant deprecating that option.

Documentation was updated for this support, with a note on the
deprecation of ?include-raw-text-fields=.

Python and JavaScript unit tests pass.

Tested manually with the older ?include-raw-text-fields=1 and
with different combinations and values for ?include-text-types=.
Verified the payload contents match what I'd expect.

Tested different review request fields and replies in the UI with
fields with rich text on and off, and with the user option on and
off.

reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/tests/test_review_request_draft.py
        reviewboard/webapi/tests/mixins_review.py
        reviewboard/webapi/mixins.py
        reviewboard/webapi/tests/mixins_comment.py
    
    Ignored Files:
        reviewboard/static/rb/js/models/tests/reviewRequestEditorModelTests.js
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/resources/models/reviewReplyModel.js
        reviewboard/static/rb/js/models/reviewRequestEditorModel.js
        reviewboard/static/rb/js/views/tests/reviewDialogViewTests.js
        reviewboard/static/rb/js/resources/models/baseCommentModel.js
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/js/models/reviewReplyEditorModel.js
        reviewboard/static/rb/js/views/reviewDialogView.js
        reviewboard/static/rb/js/resources/models/baseCommentReplyModel.js
        docs/manual/webapi/2.0/rich-text-fields.rst
        reviewboard/static/rb/js/resources/models/reviewModel.js
        reviewboard/static/rb/js/views/tests/reviewRequestEditorViewTests.js
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/tests/test_review_request_draft.py
        reviewboard/webapi/tests/mixins_review.py
        reviewboard/webapi/mixins.py
        reviewboard/webapi/tests/mixins_comment.py
    
    Ignored Files:
        reviewboard/static/rb/js/models/tests/reviewRequestEditorModelTests.js
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/resources/models/reviewReplyModel.js
        reviewboard/static/rb/js/models/reviewRequestEditorModel.js
        reviewboard/static/rb/js/views/tests/reviewDialogViewTests.js
        reviewboard/static/rb/js/resources/models/baseCommentModel.js
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/js/models/reviewReplyEditorModel.js
        reviewboard/static/rb/js/views/reviewDialogView.js
        reviewboard/static/rb/js/resources/models/baseCommentReplyModel.js
        docs/manual/webapi/2.0/rich-text-fields.rst
        reviewboard/static/rb/js/resources/models/reviewModel.js
        reviewboard/static/rb/js/views/tests/reviewRequestEditorViewTests.js
    
    
  2. 
      
chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/tests/test_review_request_draft.py
        reviewboard/webapi/tests/mixins_review.py
        reviewboard/webapi/mixins.py
        reviewboard/webapi/tests/mixins_comment.py
    
    Ignored Files:
        reviewboard/static/rb/js/models/tests/reviewRequestEditorModelTests.js
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/resources/models/reviewReplyModel.js
        reviewboard/static/rb/js/models/reviewRequestEditorModel.js
        reviewboard/static/rb/js/views/tests/reviewDialogViewTests.js
        reviewboard/static/rb/js/resources/models/baseCommentModel.js
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/js/models/reviewReplyEditorModel.js
        reviewboard/static/rb/js/views/reviewDialogView.js
        reviewboard/static/rb/js/resources/models/baseCommentReplyModel.js
        docs/manual/webapi/2.0/rich-text-fields.rst
        reviewboard/static/rb/js/resources/models/reviewModel.js
        reviewboard/static/rb/js/views/tests/reviewRequestEditorViewTests.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/tests/test_review_request_draft.py
        reviewboard/webapi/tests/mixins_review.py
        reviewboard/webapi/mixins.py
        reviewboard/webapi/tests/mixins_comment.py
    
    Ignored Files:
        reviewboard/static/rb/js/models/tests/reviewRequestEditorModelTests.js
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/resources/models/reviewReplyModel.js
        reviewboard/static/rb/js/models/reviewRequestEditorModel.js
        reviewboard/static/rb/js/views/tests/reviewDialogViewTests.js
        reviewboard/static/rb/js/resources/models/baseCommentModel.js
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
        reviewboard/static/rb/js/models/reviewReplyEditorModel.js
        reviewboard/static/rb/js/views/reviewDialogView.js
        reviewboard/static/rb/js/resources/models/baseCommentReplyModel.js
        docs/manual/webapi/2.0/rich-text-fields.rst
        reviewboard/static/rb/js/resources/models/reviewModel.js
        reviewboard/static/rb/js/views/tests/reviewRequestEditorViewTests.js
    
    
  2. 
      
david
  1. Ship It!

  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to markdown-redesign (4a4ae4d)