Page MenuHomePhabricator

D13405.id32465.diff
No OneTemporary

D13405.id32465.diff

diff --git a/src/applications/harbormaster/event/HarbormasterUIEventListener.php b/src/applications/harbormaster/event/HarbormasterUIEventListener.php
--- a/src/applications/harbormaster/event/HarbormasterUIEventListener.php
+++ b/src/applications/harbormaster/event/HarbormasterUIEventListener.php
@@ -51,22 +51,17 @@
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 @@
$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());

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 23, 9:04 PM (1 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7469550
Default Alt Text
D13405.id32465.diff (1 KB)

Event Timeline