Make errors in dialogs look reasonable instead of hideous

Summary: I accidentally made these exceptionally ugly recently.

Test Plan: {F137411}

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley, chad

Differential Revision: https://secure.phabricator.com/D8684
This commit is contained in:
epriestley
2014-04-03 11:23:03 -07:00
parent 957b9c1729
commit c9311a9eae
6 changed files with 34 additions and 39 deletions

View File

@@ -19,6 +19,7 @@ final class AphrontDialogView extends AphrontView {
private $disableWorkflowOnSubmit;
private $disableWorkflowOnCancel;
private $width = 'default';
private $errors;
const WIDTH_DEFAULT = 'default';
const WIDTH_FORM = 'form';
@@ -34,6 +35,11 @@ final class AphrontDialogView extends AphrontView {
return $this;
}
public function setErrors(array $errors) {
$this->errors = $errors;
return $this;
}
public function getIsStandalone() {
return $this->isStandalone;
}
@@ -252,6 +258,12 @@ final class AphrontDialogView extends AphrontView {
$children = $this->renderChildren();
if ($this->errors) {
$children = array(
id(new AphrontErrorView())->setErrors($this->errors),
$children);
}
$header = new PhabricatorActionHeaderView();
$header->setHeaderTitle($this->title);
$header->setHeaderColor($this->headerColor);