Rewrite the CommentReply objects to be based on Backbone.js.
Review Request #3838 — Created Feb. 3, 2013 and submitted
Rewrite the CommentReply objects to be based on Backbone.js. The new objects perform the same way the old ones did, but share much of the code and make use of the BaseResource model. There's a BaseCommentReply that does all the actual work, and subclasses for diffs, file attachments, and screenshots. All the actual logic is common, and the subclasses only provide the 'rspNamespace' key used to parse the payload from the server. Unit tests were added to cover the base serialization/deserialization and validation.
Unit tests pass. I created a reply to all 3 types of comments (both with and without an existing draft) and published them. I also tested editing the comments. Verified they saved and loaded. Tested erasing the contents. Saw the comment delete.
- Change Summary:
-
Added some missing docs for the subclasses.
- Diff:
-
Revision 2 (+239 -448)
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: reviewboard/settings.py Ignored Files: reviewboard/static/rb/js/models/baseCommentModel.js reviewboard/static/rb/js/datastore.js reviewboard/static/rb/js/models/tests/baseCommentReplyModelTests.js reviewboard/static/rb/js/models/fileAttachmentCommentReplyModel.js reviewboard/static/rb/js/models/baseResourceModel.js reviewboard/static/rb/js/models/tests/baseCommentModelTests.js reviewboard/static/rb/js/models/baseCommentReplyModel.js reviewboard/static/rb/js/models/screenshotCommentReplyModel.js reviewboard/static/rb/js/reviews.js reviewboard/static/rb/js/models/diffCommentReplyModel.js