Move more review request editing responsibilities to the model.
Review Request #4105 — Created May 5, 2013 and submitted
Move more review request editing responsibilities to the model. While moving things into ReviewRequestEditor*, much of the logic needed to be in the view until we were more or less complete with the transfer. Now, draft publishing, field setting and validation live in the model. The view listens for events and calls into the model for more things. The ReviewRequest model and associated draft are now instantiated with the content from the database, meaning we can now work with the raw content in the model instead of processing data in the DOM. This last part had an impact on load order in reviews.js, so some things had to be shifted around.
Tested manually setting each field. Tested that a first edit of a review request still brought up the draft banner. Tested change descriptions. Tested editing and reverting fields. Tested validation of reviewers, summary and description before publish. Tested successful publishes. Tested publishing with some fields open causing the fields to save before publish. All unit tests (including new ones) pass.
- Change Summary:
-
Revert an unnecessary change.
- Diff:
-
Revision 2 (+619 -196)
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: Ignored Files: reviewboard/templates/reviews/review_flags.js reviewboard/templates/js/tests.html reviewboard/static/rb/js/models/tests/reviewRequestEditorModelTests.js reviewboard/static/rb/js/models/tests/draftReviewRequestModelTests.js reviewboard/static/rb/js/models/draftReviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js reviewboard/static/rb/js/models/draftResourceModelMixin.js reviewboard/static/rb/js/reviews.js reviewboard/static/rb/js/models/reviewRequestModel.js reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/templates/reviews/reviewable_base.html reviewboard/static/rb/js/views/tests/reviewRequestEditorViewTests.js
- Change Summary:
-
Added a comment explaining that some of the globals we set need to go away.
- Diff:
-
Revision 3 (+624 -196)
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: Ignored Files: reviewboard/templates/reviews/review_flags.js reviewboard/templates/js/tests.html reviewboard/static/rb/js/models/tests/reviewRequestEditorModelTests.js reviewboard/static/rb/js/models/tests/draftReviewRequestModelTests.js reviewboard/static/rb/js/models/draftReviewRequestModel.js reviewboard/static/rb/js/views/reviewRequestEditorView.js reviewboard/static/rb/js/models/draftResourceModelMixin.js reviewboard/static/rb/js/reviews.js reviewboard/static/rb/js/models/reviewRequestModel.js reviewboard/static/rb/js/models/reviewRequestEditorModel.js reviewboard/templates/reviews/reviewable_base.html reviewboard/static/rb/js/views/tests/reviewRequestEditorViewTests.js