Move field editing to ReviewRequestEditorView.

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

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.