Refactor revision selectors for future file attachment support.

Review Request #6342 — Created Sept. 19, 2014 and submitted

Information

Review Board
master
df43e22...

Reviewers

This change refactors the DiffRevisionSelectorView control to abstract out
common functionality into a new RevisionSelectorView abstract base class. This
is then inherited by the existing DiffRevisionSelectorView and a new
FileAttachmentRevisionSelectorView.

Tested the various behavior in the DiffRevisionSelectorView.
FileAttachmentRevisionSelectorView is currently un-tested.

Description From Last Updated

Why aren't we using initialize? Might also be nice for future-expansion and consistency to have this take an options .

chipx86chipx86

We should also assert that options isn't undefined.

chipx86chipx86

I noticed the parameters are getting documented everywhere. How about having this take an options instead, so it's all self-documenting?

chipx86chipx86

Should optimistically be listed alphabetically.

chipx86chipx86
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/staticbundles.py
    
    Ignored Files:
        reviewboard/static/rb/js/diffviewer/views/diffRevisionLabelView.js
        reviewboard/static/rb/js/views/revisionSelectorView.js
        reviewboard/static/rb/js/diffviewer/views/diffCommentsHintView.js
        reviewboard/static/rb/js/diffviewer/views/diffRevisionSelectorView.js
        reviewboard/static/rb/js/views/fileAttachmentRevisionSelectorView.js
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/staticbundles.py
    
    Ignored Files:
        reviewboard/static/rb/js/diffviewer/views/diffRevisionLabelView.js
        reviewboard/static/rb/js/views/revisionSelectorView.js
        reviewboard/static/rb/js/diffviewer/views/diffCommentsHintView.js
        reviewboard/static/rb/js/diffviewer/views/diffRevisionSelectorView.js
        reviewboard/static/rb/js/views/fileAttachmentRevisionSelectorView.js
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
  2. 
      
chipx86
  1. 
      
  2. Show all issues

    Why aren't we using initialize?

    Might also be nice for future-expansion and consistency to have this take an options .

  3. Show all issues

    I noticed the parameters are getting documented everywhere. How about having this take an options instead, so it's all self-documenting?

    1. I've moved the initialActive parameter into the options for initialize, so this isn't confusing anymore.

  4. reviewboard/staticbundles.py (Diff revision 1)
     
     
    Show all issues

    Should optimistically be listed alphabetically.

    1. I'm really not at all sure what "alphabetically" means for this list, but I've moved this to come above the various file attachment views, since fileAttachmentRevisionSelectorView.js will need to go in after this and before fileAttachmentReviewableView.js

  5. 
      
david
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/staticbundles.py
    
    Ignored Files:
        reviewboard/static/rb/js/diffviewer/views/diffRevisionLabelView.js
        reviewboard/static/rb/js/views/revisionSelectorView.js
        reviewboard/static/rb/js/diffviewer/views/diffCommentsHintView.js
        reviewboard/static/rb/js/diffviewer/views/diffRevisionSelectorView.js
        reviewboard/static/rb/js/views/fileAttachmentRevisionSelectorView.js
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/staticbundles.py
    
    Ignored Files:
        reviewboard/static/rb/js/diffviewer/views/diffRevisionLabelView.js
        reviewboard/static/rb/js/views/revisionSelectorView.js
        reviewboard/static/rb/js/diffviewer/views/diffCommentsHintView.js
        reviewboard/static/rb/js/diffviewer/views/diffRevisionSelectorView.js
        reviewboard/static/rb/js/views/fileAttachmentRevisionSelectorView.js
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
  2. 
      
chipx86
  1. 
      
  2. Show all issues

    We should also assert that options isn't undefined.

  3. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to master (470e7b8)