Added new client side hook for validating draft reviews

Review Request #8052 — Created March 10, 2016 and discarded — Latest diff uploaded

Information

Review Board
release-2.5.x

Reviewers

Added new client side hook for validating draft reviews.
The idea behind this hook is that some extensions add client side widgets
which shouldn't be skipped accidentally when the user is reviewing code.
For example, with the checklist extension, they shouldn't forget to check off
all the items on their checklist.

This code is generic in that it support any type of extension as well as multiple
extensions hooking into the publish validation simultaneously. Extensions can
choose to allow, abort, or warn about a review being published. Warnings
will be presented as a browser confirmation dialog, giving the user the choice to
either force the publish or cancel it. Abortions will be presented as a simple
alert box with a message about why the validation failed.

See the attachement below for an example.

Manually tested this with the Checklist Extension.
Tested this feature with multiple hooks at the same time.
Tested each combination of 2 hooks doing allow, abort, and warning actions.


    Loading...