Fix the display of the Add Comment button in the Review Dialog.

Review Request #8855 — Created March 27, 2017 and submitted — Latest diff uploaded

Information

Review Board
release-3.0.x
fb33fc4...

Reviewers

The Review Dialog's Add Comment button (used for general comments)
required a flag to be passed during construction. The "Review" action on
the review request passed this action in, but the "Edit Review" button
on the review banner did not.

Rather than fix up the review banner (plumbing the state through several
more objects), we now have a RB.EnabledFeatures dictionary where we can
set the enabled state for features we care about. The Review Dialog
accesses this directly, instead of taking in an option during
construction.

The dialog also no longer tries to load general comments if the feature
is disabled. This was causing an error before, given that the API would
not be accessible.

Unit tests were added to test both the enabled and disabled states.

Tested with the feature enabled and disabled. I only saw the Add Comment
dialog when the feature was enabled, and loading comments no longer
failed when disabled.

Unit tests pass with the feature enabled and disabled.