Page MenuHomePhabricator

D10091.id.diff
No OneTemporary

D10091.id.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -67,7 +67,7 @@
'rsrc/css/application/feed/feed.css' => '4e544db4',
'rsrc/css/application/files/global-drag-and-drop.css' => '697324ad',
'rsrc/css/application/flag/flag.css' => '5337623f',
- 'rsrc/css/application/harbormaster/harbormaster.css' => 'cec833b7',
+ 'rsrc/css/application/harbormaster/harbormaster.css' => '49d64eb4',
'rsrc/css/application/herald/herald-test.css' => '778b008e',
'rsrc/css/application/herald/herald.css' => 'c544dd1c',
'rsrc/css/application/maniphest/batch-editor.css' => '8f380ebc',
@@ -538,7 +538,7 @@
'font-fontawesome' => '73d075c3',
'font-source-sans-pro' => '91d53463',
'global-drag-and-drop-css' => '697324ad',
- 'harbormaster-css' => 'cec833b7',
+ 'harbormaster-css' => '49d64eb4',
'herald-css' => 'c544dd1c',
'herald-rule-editor' => '3fc2c8f2',
'herald-test-css' => '778b008e',
diff --git a/src/applications/harbormaster/controller/HarbormasterBuildViewController.php b/src/applications/harbormaster/controller/HarbormasterBuildViewController.php
--- a/src/applications/harbormaster/controller/HarbormasterBuildViewController.php
+++ b/src/applications/harbormaster/controller/HarbormasterBuildViewController.php
@@ -205,6 +205,8 @@
->withBuildTargetPHIDs(array($build_target->getPHID()))
->execute();
+ $empty_logs = array();
+
$log_boxes = array();
foreach ($logs as $log) {
$start = 1;
@@ -217,6 +219,16 @@
$start = 1;
}
}
+
+ $id = null;
+ $is_empty = false;
+ if (count($lines) === 1 && trim($lines[0]) === '') {
+ // Prevent Harbormaster from showing empty build logs.
+ $id = celerity_generate_unique_node_id();
+ $empty_logs[] = $id;
+ $is_empty = true;
+ }
+
$log_view = new ShellLogView();
$log_view->setLines($lines);
$log_view->setStart($start);
@@ -230,9 +242,54 @@
->setSubheader($this->createLogHeader($build, $log))
->setUser($viewer);
- $log_boxes[] = id(new PHUIObjectBoxView())
+ $log_box = id(new PHUIObjectBoxView())
->setHeader($header)
->setForm($log_view);
+
+ if ($is_empty) {
+ require_celerity_resource('harbormaster-css');
+
+ $log_box = phutil_tag(
+ 'div',
+ array(
+ 'style' => 'display: none',
+ 'id' => $id),
+ $log_box);
+ }
+
+ $log_boxes[] = $log_box;
+ }
+
+ if ($empty_logs) {
+ $hide_id = celerity_generate_unique_node_id();
+
+ Javelin::initBehavior('phabricator-reveal-content');
+
+ $expand = phutil_tag(
+ 'div',
+ array(
+ 'id' => $hide_id,
+ 'class' => 'harbormaster-empty-logs-are-hidden mlr mlt mll',
+ ),
+ array(
+ pht(
+ '%s empty logs are hidden.',
+ new PhutilNumber(count($empty_logs))),
+ ' ',
+ javelin_tag(
+ 'a',
+ array(
+ 'href' => '#',
+ 'sigil' => 'reveal-content',
+ 'meta' => array(
+ 'showIDs' => $empty_logs,
+ 'hideIDs' => array($hide_id),
+ ),
+ ),
+ pht('Show all logs.')),
+ ));
+
+ array_unshift($log_boxes, $expand);
}
return $log_boxes;
diff --git a/webroot/rsrc/css/application/harbormaster/harbormaster.css b/webroot/rsrc/css/application/harbormaster/harbormaster.css
--- a/webroot/rsrc/css/application/harbormaster/harbormaster.css
+++ b/webroot/rsrc/css/application/harbormaster/harbormaster.css
@@ -17,3 +17,11 @@
margin-bottom: 2px;
color: {$darkbluetext};
}
+
+.harbormaster-empty-logs-are-hidden {
+ background: {$lightyellow};
+ border: 1px solid {$yellow};
+ text-align: center;
+ padding: 12px;
+ color: {$darkgreytext};
+}

File Metadata

Mime Type
text/plain
Expires
Sun, Oct 20, 5:22 PM (4 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6737044
Default Alt Text
D10091.id.diff (3 KB)

Event Timeline