Give each ReviewRequestPageEntry direct access to the page data.

Review Request #9279 — Created Oct. 17, 2017 and submitted — Latest diff uploaded

Information

Review Board
release-3.0.x
aa1e454...

Reviewers

ReviewRequestPageEntry used to be pretty independent from
ReviewRequestPageData, with each entry either taking specific objects
(like a HTTP request, review request, and other state) in the
constructor or in utility methods, and the build_entries function
bridging the data and entries. This was a nice separation, but over time
as the entry needed to do more it ended up resulting in a lot of state
having to be passed around and inconsistency in what data was available
on what entry. With some upcoming work, this only got worse. In the end,
this maybe wasn't a necessary separation to keep, since they're always
used together.

Entries are now passed the ReviewRequestPageData directly, giving them
direct access to the review request, HTTP request, and calculated state.
This simplifies function signatures, entry building, code paths, and
will allow upcoming changes to give entries more control over their own
state.

Unit tests pass.

Tested manually with a review request I have that tests all entry states.

    Loading...