1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 19:40:55 +01:00

Link prominently to Harbormaster Buildables in build result output

Summary: Ref T8096. We don't currently link to the buildable, which I think contributes to Harbormaster feeling a little scattered.

Test Plan: {F528095}

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T8096

Differential Revision: https://secure.phabricator.com/D13405
This commit is contained in:
epriestley 2015-06-23 13:33:53 -07:00
parent b074cdeb4c
commit 9656e6e6b1

View file

@ -51,22 +51,17 @@ final class HarbormasterUIEventListener
return;
}
$buildables = id(new HarbormasterBuildableQuery())
$buildable = id(new HarbormasterBuildableQuery())
->setViewer($user)
->withManualBuildables(false)
->withBuildablePHIDs(array($buildable_phid))
->execute();
if (!$buildables) {
->needBuilds(true)
->executeOne();
if (!$buildable) {
return;
}
$builds = id(new HarbormasterBuildQuery())
->setViewer($user)
->withBuildablePHIDs(mpull($buildables, 'getPHID'))
->execute();
if (!$builds) {
return;
}
$builds = $buildable->getBuilds();
$build_handles = id(new PhabricatorHandleQuery())
->setViewer($user)
@ -75,6 +70,29 @@ final class HarbormasterUIEventListener
$status_view = new PHUIStatusListView();
$buildable_status = $buildable->getBuildableStatus();
$buildable_icon = HarbormasterBuildable::getBuildableStatusIcon(
$buildable_status);
$buildable_color = HarbormasterBuildable::getBuildableStatusColor(
$buildable_status);
$buildable_name = HarbormasterBuildable::getBuildableStatusName(
$buildable_status);
$target = phutil_tag(
'a',
array(
'href' => '/'.$buildable->getMonogram(),
),
pht('Buildable %d', $buildable->getID()));
$target = phutil_tag('strong', array(), $target);
$status_view
->addItem(
id(new PHUIStatusItemView())
->setIcon($buildable_icon, $buildable_color, $buildable_name)
->setTarget($target));
foreach ($builds as $build) {
$item = new PHUIStatusItemView();
$item->setTarget($build_handles[$build->getPHID()]->renderLink());