Add views and tests for a branches selector.

Review Request #4321 — Created July 11, 2013 and submitted

Information

Review Board
master

Reviewers

Add views and tests for a branches selector.

This change adds views to show a RepositoryBranchesCollection using a <select>
tag. This is used in the new post-commit review request creator.
- Ran unit tests.
- Used this in my post-commit UI.
Description From Last Updated

I think you can just register this event in the events {} table. It'll do the binding and unbinding for …

chipx86chipx86

Oh also, can you add some docs for functions?

chipx86chipx86

You can combine these.

chipx86chipx86

These are going to make jshint very sad. I think we need to not name things "default" and find a …

chipx86chipx86
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        reviewboard/settings.py
      Ignored Files:
        reviewboard/static/rb/js/newReviewRequest/views/tests/branchesViewTests.js
        reviewboard/static/rb/js/newReviewRequest/views/branchView.js
        reviewboard/static/rb/js/newReviewRequest/views/branchesView.js
    
    
  2. 
      
reviewbot
  1. This is a review from Review Bot.
      Tool: Pyflakes
      Processed Files:
        reviewboard/settings.py
      Ignored Files:
        reviewboard/static/rb/js/newReviewRequest/views/tests/branchesViewTests.js
        reviewboard/static/rb/js/newReviewRequest/views/branchView.js
        reviewboard/static/rb/js/newReviewRequest/views/branchesView.js
    
    
  2. 
      
chipx86
  1. 
      
  2. Show all issues
    I think you can just register this event in the events {} table. It'll do the binding and unbinding for you.
  3. Show all issues
    You can combine these.
  4. Show all issues
    These are going to make jshint very sad. I think we need to not name things "default" and find a non-keyword name, like "isDefault".
    
    Can you run jshint on this change and make sure it's happy?
  5. Is this necessary? I wouldn't expect the above to be async, unless the browser's really handling the selected changes in the next event loop?
  6. 
      
chipx86
  1. 
      
  2. Show all issues
    Oh also, can you add some docs for functions?
  3. 
      
david
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        reviewboard/settings.py
      Ignored Files:
        reviewboard/static/rb/js/resources/collections/tests/repositoryBranchesCollectionTests.js
        reviewboard/static/rb/js/resources/models/tests/repositoryBranchModelTests.js
        reviewboard/static/rb/js/resources/models/repositoryBranchModel.js
        reviewboard/static/rb/js/newReviewRequest/views/branchView.js
        reviewboard/static/rb/js/resources/models/validateDiffModel.js
        reviewboard/static/rb/js/newReviewRequest/views/tests/branchesViewTests.js
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/newReviewRequest/views/branchesView.js
    
    
  2. 
      
reviewbot
  1. This is a review from Review Bot.
      Tool: Pyflakes
      Processed Files:
        reviewboard/settings.py
      Ignored Files:
        reviewboard/static/rb/js/resources/collections/tests/repositoryBranchesCollectionTests.js
        reviewboard/static/rb/js/resources/models/tests/repositoryBranchModelTests.js
        reviewboard/static/rb/js/resources/models/repositoryBranchModel.js
        reviewboard/static/rb/js/newReviewRequest/views/branchView.js
        reviewboard/static/rb/js/resources/models/validateDiffModel.js
        reviewboard/static/rb/js/newReviewRequest/views/tests/branchesViewTests.js
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/newReviewRequest/views/branchesView.js
    
    
  2. 
      
david
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        reviewboard/settings.py
      Ignored Files:
        reviewboard/static/rb/js/resources/collections/tests/repositoryBranchesCollectionTests.js
        reviewboard/static/rb/js/resources/models/tests/repositoryBranchModelTests.js
        reviewboard/static/rb/js/resources/models/repositoryBranchModel.js
        reviewboard/static/rb/js/newReviewRequest/views/branchView.js
        reviewboard/static/rb/js/resources/models/validateDiffModel.js
        reviewboard/static/rb/js/newReviewRequest/views/tests/branchesViewTests.js
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/newReviewRequest/views/branchesView.js
    
    
  2. 
      
reviewbot
  1. This is a review from Review Bot.
      Tool: Pyflakes
      Processed Files:
        reviewboard/settings.py
      Ignored Files:
        reviewboard/static/rb/js/resources/collections/tests/repositoryBranchesCollectionTests.js
        reviewboard/static/rb/js/resources/models/tests/repositoryBranchModelTests.js
        reviewboard/static/rb/js/resources/models/repositoryBranchModel.js
        reviewboard/static/rb/js/newReviewRequest/views/branchView.js
        reviewboard/static/rb/js/resources/models/validateDiffModel.js
        reviewboard/static/rb/js/newReviewRequest/views/tests/branchesViewTests.js
        reviewboard/static/rb/js/resources/models/reviewRequestModel.js
        reviewboard/static/rb/js/newReviewRequest/views/branchesView.js
    
    
  2. 
      
chipx86
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to master (19dd215).