Move lint/unit test warning code forward to Transactions

Summary: Ref T2222. Makes the "lint/unit errors" warnings work again.

Test Plan: Viewed some revisions with and without these warnings.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2222

Differential Revision: https://secure.phabricator.com/D8475
This commit is contained in:
epriestley
2014-03-09 13:18:17 -07:00
parent 20cc85878e
commit a49fec39be
10 changed files with 74 additions and 127 deletions

View File

@@ -336,6 +336,19 @@ final class DifferentialRevisionViewController extends DifferentialController {
$comment_form = new DifferentialAddCommentView();
$comment_form->setRevision($revision);
$review_warnings = array();
foreach ($field_list->getFields() as $field) {
$review_warnings[] = $field->getWarningsForDetailView();
}
$review_warnings = array_mergev($review_warnings);
if ($review_warnings) {
$review_warnings_panel = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_WARNING)
->setErrors($review_warnings);
$comment_form->setErrorView($review_warnings_panel);
}
// TODO: Restore the ability for fields to add accept warnings.
$comment_form->setActions($this->getRevisionCommentActions($revision));