1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 22:10:55 +01:00

Add PHUIObjectItemView Status Display to Harbormaster

Summary: Took a short pass here with the new UI, holler if something is TOO EXTREME.

Test Plan:
Tested with manual sleep builds.

{F148693}

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D8901
This commit is contained in:
Chad Little 2014-04-29 11:10:16 -07:00
parent 692a28b5b2
commit db42aae361
2 changed files with 21 additions and 5 deletions

View file

@ -32,6 +32,7 @@ final class HarbormasterBuildableListController
$viewer = $this->getRequest()->getUser(); $viewer = $this->getRequest()->getUser();
$list = new PHUIObjectItemListView(); $list = new PHUIObjectItemListView();
$list->setStates(true);
foreach ($buildables as $buildable) { foreach ($buildables as $buildable) {
$id = $buildable->getID(); $id = $buildable->getID();
@ -52,19 +53,30 @@ final class HarbormasterBuildableListController
$item->addIcon('wrench-grey', pht('Manual')); $item->addIcon('wrench-grey', pht('Manual'));
} }
$list->addItem($item);
switch ($buildable->getBuildableStatus()) { switch ($buildable->getBuildableStatus()) {
case HarbormasterBuildable::STATUS_PASSED: case HarbormasterBuildable::STATUS_PASSED:
$item->setBarColor('green'); $item->setState(PHUIObjectItemView::STATE_SUCCESS);
break; break;
case HarbormasterBuildable::STATUS_FAILED: case HarbormasterBuildable::STATUS_FAILED:
$item->setBarColor('red'); $item->setState(PHUIObjectItemView::STATE_FAIL);
break;
case HarbormasterBuildable::STATUS_BUILDING:
$item->setState(PHUIObjectItemView::STATE_BUILD);
break;
default:
$item->setState(PHUIObjectItemView::STATE_WARN);
break; break;
} }
$list->addItem($item);
} }
return $list; $box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Buildables'))
->appendChild($list);
return $box;
} }
public function buildSideNavView($for_app = false) { public function buildSideNavView($for_app = false) {

View file

@ -30,6 +30,7 @@ final class PHUIObjectItemView extends AphrontTagView {
const STATE_FAIL = 'red'; const STATE_FAIL = 'red';
const STATE_WARN = 'yellow'; const STATE_WARN = 'yellow';
const STATE_NOTE = 'blue'; const STATE_NOTE = 'blue';
const STATE_BUILD = 'sky';
public function setDisabled($disabled) { public function setDisabled($disabled) {
$this->disabled = $disabled; $this->disabled = $disabled;
@ -129,6 +130,9 @@ final class PHUIObjectItemView extends AphrontTagView {
case self::STATE_NOTE: case self::STATE_NOTE:
$fi = 'fa-info-circle blue'; $fi = 'fa-info-circle blue';
break; break;
case self::STATE_BUILD:
$fi = 'fa-refresh ph-spin sky';
break;
} }
$this->fontIcon = id(new PHUIIconView()) $this->fontIcon = id(new PHUIIconView())
->setIconFont($fi.' fa-2x'); ->setIconFont($fi.' fa-2x');