mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +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:
parent
b074cdeb4c
commit
9656e6e6b1
1 changed files with 28 additions and 10 deletions
|
@ -51,22 +51,17 @@ final class HarbormasterUIEventListener
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$buildables = id(new HarbormasterBuildableQuery())
|
$buildable = id(new HarbormasterBuildableQuery())
|
||||||
->setViewer($user)
|
->setViewer($user)
|
||||||
->withManualBuildables(false)
|
->withManualBuildables(false)
|
||||||
->withBuildablePHIDs(array($buildable_phid))
|
->withBuildablePHIDs(array($buildable_phid))
|
||||||
->execute();
|
->needBuilds(true)
|
||||||
if (!$buildables) {
|
->executeOne();
|
||||||
|
if (!$buildable) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$builds = id(new HarbormasterBuildQuery())
|
$builds = $buildable->getBuilds();
|
||||||
->setViewer($user)
|
|
||||||
->withBuildablePHIDs(mpull($buildables, 'getPHID'))
|
|
||||||
->execute();
|
|
||||||
if (!$builds) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$build_handles = id(new PhabricatorHandleQuery())
|
$build_handles = id(new PhabricatorHandleQuery())
|
||||||
->setViewer($user)
|
->setViewer($user)
|
||||||
|
@ -75,6 +70,29 @@ final class HarbormasterUIEventListener
|
||||||
|
|
||||||
$status_view = new PHUIStatusListView();
|
$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) {
|
foreach ($builds as $build) {
|
||||||
$item = new PHUIStatusItemView();
|
$item = new PHUIStatusItemView();
|
||||||
$item->setTarget($build_handles[$build->getPHID()]->renderLink());
|
$item->setTarget($build_handles[$build->getPHID()]->renderLink());
|
||||||
|
|
Loading…
Reference in a new issue