From bbbda23678ddbee4a8e473fa7966c7ad15e0a60e Mon Sep 17 00:00:00 2001 From: Chad Little Date: Mon, 19 Oct 2015 20:08:30 -0700 Subject: [PATCH] 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 --- src/view/form/PHUIInfoView.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/view/form/PHUIInfoView.php b/src/view/form/PHUIInfoView.php index 2ebbbe44e7..3a8f259f52 100644 --- a/src/view/form/PHUIInfoView.php +++ b/src/view/form/PHUIInfoView.php @@ -50,7 +50,7 @@ final class PHUIInfoView extends AphrontView { require_celerity_resource('phui-info-view-css'); $errors = $this->errors; - if ($errors) { + if (count($errors) > 1) { $list = array(); foreach ($errors as $error) { $list[] = phutil_tag( @@ -64,6 +64,8 @@ final class PHUIInfoView extends AphrontView { 'class' => 'phui-info-view-list', ), $list); + } else if (count($errors) == 1) { + $list = $this->errors[0]; } else { $list = null; }