Add a set of views for managing reviewable pages.

Review Request #4229 — Created June 11, 2013 and submitted

Information

Review Board
master

Reviewers

Add a set of views for managing reviewable pages.

This introduces three new views for managing the reviewable pages.

ReviewablePageView is the main/base class for reviewable pages. It
constructs all the important objects, listens for updates on the review
request from the server, and handles certain page actions.

ReviewRequestPageView extends that, and owns the ReviewBoxListView and
the diff fragment loading.

DiffViewerPageView is for the diff viewer page. It's very small right
now, but will grow.

These are instantiated on the appropriate pages. The bulk of the
initialization comes from a .js template file, which handles all the
main parameters to the page views. The pages can provide additional
parameters as well.

With this, I was able to get rid of a bunch more globals, which is
always good.

Also, reviews.js is now gone! Tada!
Tested that each page loaded its contents correctly.

Tested update notification bubbles.

Tested that reviewing code and images works.

Tested the review box expand/collapse functionality.

Tested clicking "Reply" in the comment dialog for an existing comment
opened the review request page and opened a comment box for the correct
comment.

Unit tests pass.
Description From Last Updated

Can you put "Update Page" in quotes?

daviddavid

Can you put "Ignore" in quotes?

daviddavid

This would be cleaner with .every: this._boxes.every(function(box) { var reviewReplyEditorView; if (box.getReviewReplyEditorView) { reviewReplyEditorView = box.getReviewReplyEditorView(contextType, contextID); if (reviewReplyEditorView) { …

daviddavid
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        reviewboard/settings.py
      Ignored Files:
        reviewboard/templates/diffviewer/view_diff.html
        reviewboard/static/rb/js/views/reviewReplyEditorView.js
        reviewboard/static/rb/js/views/draftReviewBannerView.js
        reviewboard/static/rb/js/pages/views/reviewRequestPageView.js
        reviewboard/static/rb/js/views/reviewBoxView.js
        reviewboard/static/rb/js/views/tests/reviewBoxViewTests.js
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/views/reviewBoxListView.js
        reviewboard/static/rb/js/views/commentIssueBarView.js
        reviewboard/static/rb/js/pages/views/tests/reviewablePageViewTests.js
        reviewboard/static/rb/js/views/reviewDialogView.js
        reviewboard/templates/reviews/reviewable_page_data.js
        reviewboard/static/rb/js/views/tests/reviewBoxListViewTests.js
        reviewboard/static/rb/js/reviews.js
        reviewboard/static/rb/js/views/tests/reviewReplyEditorViewTests.js
        reviewboard/static/rb/js/views/commentDialogView.js
        reviewboard/templates/reviews/reviewable_base.html
        reviewboard/static/rb/js/pages/views/reviewablePageView.js
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
  2. 
      
david
  1. 
      
  2. Show all issues
    Can you put "Update Page" in quotes?
  3. Show all issues
    Can you put "Ignore" in quotes?
  4. reviewboard/static/rb/js/views/reviewBoxListView.js (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    Show all issues
    This would be cleaner with .every:
    
    this._boxes.every(function(box) {
        var reviewReplyEditorView;
    
        if (box.getReviewReplyEditorView) {
            reviewReplyEditorView =
                box.getReviewReplyEditorView(contextType, contextID);
    
            if (reviewReplyEditorView) {
                reviewReplyEditorView.openCommentEditor();
                return false;
            }
        }
        return true;
    });
    1. Ah, nice. I was looking for something that would let me loop but break out when needed. I guess I missed every().
  5. 
      
chipx86
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        reviewboard/settings.py
      Ignored Files:
        reviewboard/templates/diffviewer/view_diff.html
        reviewboard/static/rb/js/views/reviewReplyEditorView.js
        reviewboard/static/rb/js/views/draftReviewBannerView.js
        reviewboard/static/rb/js/pages/views/reviewRequestPageView.js
        reviewboard/static/rb/js/views/reviewBoxView.js
        reviewboard/static/rb/js/views/tests/reviewBoxViewTests.js
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/views/reviewBoxListView.js
        reviewboard/static/rb/js/views/commentIssueBarView.js
        reviewboard/static/rb/js/pages/views/tests/reviewablePageViewTests.js
        reviewboard/static/rb/js/views/reviewDialogView.js
        reviewboard/templates/reviews/reviewable_page_data.js
        reviewboard/static/rb/js/views/tests/reviewBoxListViewTests.js
        reviewboard/static/rb/js/reviews.js
        reviewboard/static/rb/js/views/tests/reviewReplyEditorViewTests.js
        reviewboard/static/rb/js/views/commentDialogView.js
        reviewboard/templates/reviews/reviewable_base.html
        reviewboard/static/rb/js/pages/views/reviewablePageView.js
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed