mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 12:00: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:
parent
692a28b5b2
commit
db42aae361
2 changed files with 21 additions and 5 deletions
|
@ -32,6 +32,7 @@ final class HarbormasterBuildableListController
|
|||
$viewer = $this->getRequest()->getUser();
|
||||
|
||||
$list = new PHUIObjectItemListView();
|
||||
$list->setStates(true);
|
||||
foreach ($buildables as $buildable) {
|
||||
$id = $buildable->getID();
|
||||
|
||||
|
@ -52,19 +53,30 @@ final class HarbormasterBuildableListController
|
|||
$item->addIcon('wrench-grey', pht('Manual'));
|
||||
}
|
||||
|
||||
$list->addItem($item);
|
||||
|
||||
switch ($buildable->getBuildableStatus()) {
|
||||
case HarbormasterBuildable::STATUS_PASSED:
|
||||
$item->setBarColor('green');
|
||||
$item->setState(PHUIObjectItemView::STATE_SUCCESS);
|
||||
break;
|
||||
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;
|
||||
}
|
||||
|
||||
$list->addItem($item);
|
||||
|
||||
}
|
||||
|
||||
return $list;
|
||||
$box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Buildables'))
|
||||
->appendChild($list);
|
||||
|
||||
return $box;
|
||||
}
|
||||
|
||||
public function buildSideNavView($for_app = false) {
|
||||
|
|
|
@ -30,6 +30,7 @@ final class PHUIObjectItemView extends AphrontTagView {
|
|||
const STATE_FAIL = 'red';
|
||||
const STATE_WARN = 'yellow';
|
||||
const STATE_NOTE = 'blue';
|
||||
const STATE_BUILD = 'sky';
|
||||
|
||||
public function setDisabled($disabled) {
|
||||
$this->disabled = $disabled;
|
||||
|
@ -129,6 +130,9 @@ final class PHUIObjectItemView extends AphrontTagView {
|
|||
case self::STATE_NOTE:
|
||||
$fi = 'fa-info-circle blue';
|
||||
break;
|
||||
case self::STATE_BUILD:
|
||||
$fi = 'fa-refresh ph-spin sky';
|
||||
break;
|
||||
}
|
||||
$this->fontIcon = id(new PHUIIconView())
|
||||
->setIconFont($fi.' fa-2x');
|
||||
|
|
Loading…
Reference in a new issue