Move all our review request field logic into new field classes.

Review Request #5200 — Created Jan. 6, 2014 and submitted — Latest diff uploaded

Information

Review Board
master

Reviewers

Move all our review request field logic into new field classes.

This introduces a new set of classes and functions for representing
fields on a review request. These classes are responsible for rendering
the list of fields on the review request page, loading values from the
database, saving from a draft, recording change description info, and
rendering that change description info.

Fields are grouped by Fieldsets. There are three default fieldsets:
"main" (the area for Submitter, Description, and Testing Done), "info"
(Repository, Bugs, etc.), and "reviewers". Additional fieldsets can be
registered, and fields placed in them. These will render on the side,
below Reviewers.

This work allows us to simplify a lot of our template code for the
review request, as well as the change description rendering code. It
also allows us to provide a level of extensibility for fields. Soon,
extensions will be able to easily provide their own fields on a review
request.

There's also a small but measurable impact on load times. By reducing
the work the template has to do, one review request I have with about 10
change descriptions saves about 10ms of render time.

Verified that everything displayed exactly as it did before. This includes
all fields, with and without values, and all combinations of change description
items.

Saved every type of field and published drafts. The new values persisted and
their changedescription entries were recorded and shown.