mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
In PHUIInfoView, only show list UI if more than 1 item
Summary: We often just setError as an array even if it's only one error. This just makes the UI a little cleaner in these cases. Test Plan: Remove all reviewers from a diff, see status error without list styling. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D14308
This commit is contained in:
parent
4cb2ec1120
commit
bbbda23678
1 changed files with 3 additions and 1 deletions
|
@ -50,7 +50,7 @@ final class PHUIInfoView extends AphrontView {
|
||||||
require_celerity_resource('phui-info-view-css');
|
require_celerity_resource('phui-info-view-css');
|
||||||
|
|
||||||
$errors = $this->errors;
|
$errors = $this->errors;
|
||||||
if ($errors) {
|
if (count($errors) > 1) {
|
||||||
$list = array();
|
$list = array();
|
||||||
foreach ($errors as $error) {
|
foreach ($errors as $error) {
|
||||||
$list[] = phutil_tag(
|
$list[] = phutil_tag(
|
||||||
|
@ -64,6 +64,8 @@ final class PHUIInfoView extends AphrontView {
|
||||||
'class' => 'phui-info-view-list',
|
'class' => 'phui-info-view-list',
|
||||||
),
|
),
|
||||||
$list);
|
$list);
|
||||||
|
} else if (count($errors) == 1) {
|
||||||
|
$list = $this->errors[0];
|
||||||
} else {
|
} else {
|
||||||
$list = null;
|
$list = null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue