Rework and fix text types for custom fields.
Review Request #6530 — Created Oct. 29, 2014 and submitted
Custom review request fields were pretty broken. We tried to write the
<fieldname>_rich_text=value in requests, but had a bug causing the
wrong key to be generated.This was also designed in a way that resulted in some inconsistencies
with the rest of the API, with the goal of making things consistent with
the database models. Instead of accepting atext_type=string in
requests, we'd accept arich_text=boolean, which differed from other
text fields.The API would still return a custom
text_type=value in theextra_data
payload, to help, but that would sit along therich_text=, and would be
inconsistent when forcing text types.We now use
text_typeeverywhere. Things are much simpler now.
Unit tests pass.
Tried changing values for a custom field in the UI. Saw that the proper
values were saved to the database, and that they were used as a basis
for rendering when forcing text types in a request.
Tool: Pyflakes Processed Files: reviewboard/reviews/fields.py reviewboard/webapi/mixins.py Ignored Files: reviewboard/static/rb/js/models/tests/reviewRequestEditorModelTests.js reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/fields.py reviewboard/webapi/mixins.py Ignored Files: reviewboard/static/rb/js/models/tests/reviewRequestEditorModelTests.js reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js