Move field editing to ReviewRequestEditorView.

Review Request #4098 — Created May 2, 2013 and submitted

Information

Review Board
master

Reviewers

Move field editing to ReviewRequestEditorView.

This moves all our field editing code to ReviewRequestEditorView. This
includes the completion formatters, auto-complete, and then everything
we no longer need in reviews.js such as publishDraft and the draft
banners.

Instead of the old model where there were "edit complete handlers" and
we just operated on anything with ".editable", we now have a basic field
registration system. All the fields we have today are registered, and
part of that registration are things like "Only use the edit icon to
enable editing" or "here's the formatter." This keeps things sane and
readable, and down the road will let us dynamically add new fields.

Unit tests were added as well for the new fields and events.

There's some work planned for later to simplify field IDs on the
elements, so there's consistency between field names in the model and
elements, which will let us remove some of the required metadata and
guessing in field registration.
Tested various values for every field.

Tested that saving the fields persisted.

Tested opening fields for edit and then reloading, to make sure the edit
counts worked properly to pop up the "Are you sure?" confirmation.

Tested closing the fields and making sure I didn't get a confirmation when
leaving the page.

Tested editing fields and then discarding to make sure that property updates
(fields being reset to null) didn't break anything and that nothing persisted.

All unit tests pass.
Description From Last Updated

Test against "len"?

daviddavid

===

daviddavid

===

daviddavid

===

daviddavid
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
      Ignored Files:
        reviewboard/static/rb/js/reviews.js
        reviewboard/static/rb/js/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
        reviewboard/static/rb/js/views/tests/reviewRequestEditorViewTests.js
    
    
  2. 
      
david
  1. 
      
  2. Show all issues
    Test against "len"?
  3. Show all issues
    ===
  4. Show all issues
    ===
  5. Show all issues
    ===
  6. 
      
chipx86
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
      Ignored Files:
        reviewboard/static/rb/js/reviews.js
        reviewboard/static/rb/js/models/reviewRequestModel.js
        reviewboard/static/rb/js/views/tests/reviewRequestEditorViewTests.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (95451d5)
Loading...