Add new models and views representing review boxes and reply UI.

Review Request #4123 — Created May 9, 2013 and submitted

Information

Review Board
master

Reviewers

Add new models and views representing review boxes and reply UI.

The complexity around making a reply to a review or to one of the three
types of comments on a review is now safely confined to a
ReviewReplyEditor model. This knows how to save the reply and remove it
when the reply is cleared.

There's an equivalent view, ReviewReplyEditorView, for handling the
reply UI for a thread of discussion.

A ReviewBoxView manages the ReviewReplyEditorViews for each comment and
body top/bottom, as well as the collapse state and the reply banner.

A ReviewBoxListView manages all the ReviewBoxViews on a review request
page. It deals with loading the ReviewBoxes, their equivalent Reviews
(based on properties in the HTML), and handling Collapse/Expand All.

Unit tests were added for all this.

The new design drastically reduces the number of <script> tags on the
page (used to load each comment reply section). These were probably very
fast to load, but it's nice not having them, as technically they slow
down the rendering of the page, and we have fewer document.ready
handlers.
Tested the interaction of the review boxes. This included:

* Creating replies (testing with the bodies and diff/file attachment comments)
* Discarded replies.
* Published replies.
* Cleared the text of a comment when other comments were present. Only the one I cleared went away, and the draft banner remained.
* Cleared the text of the only comment on a review, and both it and the draft banner went away.
* Expanded/collapsed individual boxes.
* Expanded/collapsed all boxes.

All unit tests pass.
Description From Last Updated

The rest of the id has underscores instead of hyphens.

daviddavid
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        reviewboard/settings.py
      Ignored Files:
        reviewboard/templates/reviews/review_reply_section.html
        reviewboard/static/rb/js/models/tests/reviewReplyEditorModelTests.js
        reviewboard/static/rb/js/views/tests/reviewBoxListViewTests.js
        reviewboard/static/rb/css/reviews.less
        reviewboard/static/rb/js/views/tests/reviewBoxViewTests.js
        reviewboard/static/rb/js/views/reviewBoxListView.js
        reviewboard/static/rb/js/utils/consoleUtils.js
        reviewboard/static/rb/js/models/baseResourceModel.js
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/reviews.js
        reviewboard/static/rb/js/models/reviewReplyEditorModel.js
        reviewboard/static/rb/js/views/reviewReplyEditorView.js
        reviewboard/static/rb/js/views/reviewBoxView.js
    
    
  2. 
      
david
  1. 
      
  2. Show all issues
    The rest of the id has underscores instead of hyphens.
  3. 
      
chipx86
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        reviewboard/settings.py
      Ignored Files:
        reviewboard/static/rb/js/utils/consoleUtils.js
        reviewboard/static/rb/js/views/tests/reviewBoxListViewTests.js
        reviewboard/static/rb/js/views/reviewReplyEditorView.js
        reviewboard/static/rb/css/reviews.less
        reviewboard/static/rb/js/views/tests/reviewBoxViewTests.js
        reviewboard/static/rb/js/views/reviewBoxListView.js
        reviewboard/templates/reviews/review_reply_section.html
        reviewboard/static/rb/js/models/baseResourceModel.js
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/reviews.js
        reviewboard/static/rb/js/models/reviewReplyEditorModel.js
        reviewboard/static/rb/js/models/tests/reviewReplyEditorModelTests.js
        reviewboard/static/rb/js/views/reviewBoxView.js
    
    
  2. 
      
david
  1. The interdiff looks empty...
  2. 
      
chipx86
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        reviewboard/settings.py
      Ignored Files:
        reviewboard/static/rb/js/utils/consoleUtils.js
        reviewboard/static/rb/js/views/tests/reviewBoxListViewTests.js
        reviewboard/static/rb/js/views/reviewReplyEditorView.js
        reviewboard/static/rb/css/reviews.less
        reviewboard/static/rb/js/views/tests/reviewBoxViewTests.js
        reviewboard/static/rb/js/views/reviewBoxListView.js
        reviewboard/templates/reviews/review_reply_section.html
        reviewboard/static/rb/js/models/baseResourceModel.js
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/reviews.js
        reviewboard/static/rb/js/models/reviewReplyEditorModel.js
        reviewboard/static/rb/js/models/tests/reviewReplyEditorModelTests.js
        reviewboard/static/rb/js/views/reviewBoxView.js
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed