Convert ReviewRequest to Backbone.js.

Review Request #4051 — Created April 15, 2013 and submitted

Information

Review Board
master

Reviewers

Convert ReviewRequest to Backbone.js.

This introduces a new RB.ReviewRequest and a RB.DraftReviewRequest,
both based on BaseResource. These are the last resource classes that
needed to be converted.

RB.ReviewRequest operates on a review request and provides operations
like closing a review request, reopening, checking for updates, and
creating child objects. It has a 'draft' parameter pointing to a
DraftReviewRequest.

DraftReviewRequest handles setting of fields on a review request and
publishing the draft.

All the hacky .cid checks have been removed, meaning we can now rely on
new-style objects for resources.

Some additional work had to be done to transition our editors over to
the new class. These will end up looking nicer when that code is also
transitioned to new classes. For now, they operate on some raw data
(passing API field names to options.data instead of using attribute
names). This is considered temporary.
Unit tests pass.

Set every field on a review request to blank and to valid values.

Set invalid values for user/group reviewers and saw the error and the
field revert to the server value.

Set values that had partial items and invalid items for user/group
reviewers. Again, we respected the server-side results (which
filtered out the bad ones and gave us an error).

Closed review requests as submitted, and as discarded.

Set close descriptions.

Reopened review requests.

Published changed review request drafts.

Published new review requests.

Opened a review request in two tabs. Made a review in one of them.
Saw the "<user> has updated the review request" popup in the other.

Tested that uploading diffs and file attachments worked.

Tested that I could create reviews.
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        reviewboard/settings.py
      Ignored Files:
        reviewboard/static/rb/js/models/tests/draftReviewRequestModelTests.js
        reviewboard/static/rb/js/models/draftReviewRequestModel.js
        reviewboard/static/rb/js/models/baseResourceModel.js
        reviewboard/static/rb/js/reviews.js
        reviewboard/static/rb/js/models/draftResourceModelMixin.js
        reviewboard/static/rb/js/models/tests/reviewRequestModelTests.js
        reviewboard/static/rb/js/models/reviewRequestModel.js
        reviewboard/static/rb/js/common.js
        reviewboard/static/rb/js/datastore.js
    
    
  2. 
      
david
  1. 
      
  2. Remove this line?
    1. It's a different group of constants. I don't like the idea of removing it.
  3. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (e9d9c3a)
Loading...