From 7e0edd8ef0436103b6f1e9e4bffe83f978b02494 Mon Sep 17 00:00:00 2001 From: James Rhodes Date: Fri, 1 Aug 2014 08:09:32 +1000 Subject: [PATCH] Show status icon on build view Summary: This shows the status icon and color along side the build status on the build view controller. Test Plan: Viewed a build, saw the icon appear. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D10094 --- .../HarbormasterBuildViewController.php | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/applications/harbormaster/controller/HarbormasterBuildViewController.php b/src/applications/harbormaster/controller/HarbormasterBuildViewController.php index d3baf9ef2e..6b41e14b86 100644 --- a/src/applications/harbormaster/controller/HarbormasterBuildViewController.php +++ b/src/applications/harbormaster/controller/HarbormasterBuildViewController.php @@ -353,11 +353,27 @@ final class HarbormasterBuildViewController } private function getStatus(HarbormasterBuild $build) { + $status_view = new PHUIStatusListView(); + + $item = new PHUIStatusItemView(); + if ($build->isStopping()) { - return pht('Stopping'); + $status_name = pht('Stopping'); + $icon = PHUIStatusItemView::ICON_RIGHT; + $color = 'dark'; + } else { + $status = $build->getBuildStatus(); + $status_name = + HarbormasterBuild::getBuildStatusName($status); + $icon = HarbormasterBuild::getBuildStatusIcon($status); + $color = HarbormasterBuild::getBuildStatusColor($status); } - return HarbormasterBuild::getBuildStatusName($build->getBuildStatus()); + $item->setTarget($status_name); + $item->setIcon($icon, $color); + $status_view->addItem($item); + + return $status_view; } private function buildMessages(array $messages) {