From c2c8b00c5c6bfb35bfcd718931384b5411fd82c4 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 10 Aug 2015 14:15:43 -0700 Subject: [PATCH] Always show build target tabs, even if they have no data Summary: Ref T8096. Hit this on IRC: > epriestley: what's in the Messages tab? > jdoe: what Messages tab??! > epriestley: ughhhh Test Plan: Clicked "Messages" tab, saw helpful "no messages" message. Reviewers: chad Reviewed By: chad Maniphest Tasks: T8096 Differential Revision: https://secure.phabricator.com/D13846 --- .../HarbormasterBuildViewController.php | 39 +++++++------------ 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/src/applications/harbormaster/controller/HarbormasterBuildViewController.php b/src/applications/harbormaster/controller/HarbormasterBuildViewController.php index 2b5d2c7222..cdc5baec60 100644 --- a/src/applications/harbormaster/controller/HarbormasterBuildViewController.php +++ b/src/applications/harbormaster/controller/HarbormasterBuildViewController.php @@ -172,34 +172,26 @@ final class HarbormasterBuildViewController } $details = $build_target->getDetails(); - if ($details) { - $properties = new PHUIPropertyListView(); - foreach ($details as $key => $value) { - $properties->addProperty($key, $value); - } - $target_box->addPropertyList($properties, pht('Configuration')); + $properties = new PHUIPropertyListView(); + foreach ($details as $key => $value) { + $properties->addProperty($key, $value); } + $target_box->addPropertyList($properties, pht('Configuration')); $variables = $build_target->getVariables(); - if ($variables) { - $properties = new PHUIPropertyListView(); - $properties->addRawContent($this->buildProperties($variables)); - $target_box->addPropertyList($properties, pht('Variables')); - } + $properties = new PHUIPropertyListView(); + $properties->addRawContent($this->buildProperties($variables)); + $target_box->addPropertyList($properties, pht('Variables')); $artifacts = $this->buildArtifacts($build_target); - if ($artifacts) { - $properties = new PHUIPropertyListView(); - $properties->addRawContent($artifacts); - $target_box->addPropertyList($properties, pht('Artifacts')); - } + $properties = new PHUIPropertyListView(); + $properties->addRawContent($artifacts); + $target_box->addPropertyList($properties, pht('Artifacts')); $build_messages = idx($messages, $build_target->getPHID(), array()); - if ($build_messages) { - $properties = new PHUIPropertyListView(); - $properties->addRawContent($this->buildMessages($build_messages)); - $target_box->addPropertyList($properties, pht('Messages')); - } + $properties = new PHUIPropertyListView(); + $properties->addRawContent($this->buildMessages($build_messages)); + $target_box->addPropertyList($properties, pht('Messages')); $properties = new PHUIPropertyListView(); $properties->addProperty( @@ -243,11 +235,8 @@ final class HarbormasterBuildViewController ->withBuildTargetPHIDs(array($build_target->getPHID())) ->execute(); - if (count($artifacts) === 0) { - return null; - } - $list = id(new PHUIObjectItemListView()) + ->setNoDataString(pht('This target has no associated artifacts.')) ->setFlush(true); foreach ($artifacts as $artifact) {