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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user