Move more review request editing responsibilities to the model.

Review Request #4105 — Created May 5, 2013 and submitted

Information

Review Board
master

Reviewers

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.
reviewbot
  1. 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
    
    
  2. 
      
chipx86
reviewbot
  1. 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
    
    
  2. 
      
david
  1. 
      
  2. What's this XXX for?
    1. Both those globals are going away soon. Removing gReviewRequest and gCommentIssueManager will be moving.
    2. Can you add that explanation to the comment?
  3. 
      
chipx86
reviewbot
  1. 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
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed