From 99daadb251ca5899dc18756c277cf3108710cbe9 Mon Sep 17 00:00:00 2001 From: lkassianik Date: Mon, 2 Nov 2015 13:04:34 -0800 Subject: [PATCH] Phurl URL object should show a banner if the URL is invalid Summary: Ref T8989, Phurl URL should always show an info banner if the URL isn't valid Test Plan: Phurl objects with URL "google.com" should show an error banner, but objects with URL "http://google.com" should not show banner. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin Maniphest Tasks: T8989 Differential Revision: https://secure.phabricator.com/D14386 --- .../phurl/controller/PhabricatorPhurlURLViewController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/applications/phurl/controller/PhabricatorPhurlURLViewController.php b/src/applications/phurl/controller/PhabricatorPhurlURLViewController.php index 00ab160c1a..b067a30813 100644 --- a/src/applications/phurl/controller/PhabricatorPhurlURLViewController.php +++ b/src/applications/phurl/controller/PhabricatorPhurlURLViewController.php @@ -35,9 +35,13 @@ final class PhabricatorPhurlURLViewController $properties = $this->buildPropertyView($url); $properties->setActionList($actions); + $url_error = id(new PHUIInfoView()) + ->setErrors(array(pht('This URL is invalid due to a bad protocol.'))) + ->setIsHidden($url->isValid()); $box = id(new PHUIObjectBoxView()) ->setHeader($header) - ->addPropertyList($properties); + ->addPropertyList($properties) + ->setInfoView($url_error); $is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); $add_comment_header = $is_serious