Page MenuHomePhabricator

D10091.id24297.diff
No OneTemporary

D10091.id24297.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',
@@ -390,7 +390,7 @@
'rsrc/js/application/doorkeeper/behavior-doorkeeper-tag.js' => 'e5822781',
'rsrc/js/application/files/behavior-icon-composer.js' => '8ef9ab58',
'rsrc/js/application/files/behavior-launch-icon-composer.js' => '48086888',
- 'rsrc/js/application/harbormaster/behavior-reorder-steps.js' => 'b716477f',
+ 'rsrc/js/application/harbormaster/behavior-show-empty-logs.js' => '0b2c5a68',
'rsrc/js/application/herald/HeraldRuleEditor.js' => '3fc2c8f2',
'rsrc/js/application/herald/PathTypeahead.js' => 'f7fc67ec',
'rsrc/js/application/herald/herald-rule-editor.js' => '7ebaeed3',
@@ -539,7 +539,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',
@@ -591,7 +591,6 @@
'javelin-behavior-error-log' => 'a5d7cf86',
'javelin-behavior-fancy-datepicker' => 'a5573bcd',
'javelin-behavior-global-drag-and-drop' => '3672899b',
- 'javelin-behavior-harbormaster-reorder-steps' => 'b716477f',
'javelin-behavior-herald-rule-editor' => '7ebaeed3',
'javelin-behavior-high-security-warning' => '8fc1c918',
'javelin-behavior-history-install' => '7ee2b591',
@@ -629,6 +628,7 @@
'javelin-behavior-phabricator-reveal-content' => '60821bc7',
'javelin-behavior-phabricator-search-typeahead' => 'd712ac5f',
'javelin-behavior-phabricator-show-all-transactions' => '7c273581',
+ 'javelin-behavior-phabricator-show-empty-logs' => '0b2c5a68',
'javelin-behavior-phabricator-tooltips' => '3ee3408b',
'javelin-behavior-phabricator-transaction-comment-form' => '9f7309fb',
'javelin-behavior-phabricator-transaction-list' => '71f66c08',
@@ -885,6 +885,11 @@
'javelin-dom',
'javelin-router',
),
+ '0b2c5a68' => array(
+ 'javelin-behavior',
+ 'javelin-stratcom',
+ 'javelin-dom',
+ ),
'0c33c1a0' => array(
'javelin-view',
'javelin-install',
@@ -1620,13 +1625,6 @@
'javelin-install',
'javelin-util',
),
- 'b716477f' => array(
- 'javelin-behavior',
- 'javelin-stratcom',
- 'javelin-workflow',
- 'javelin-dom',
- 'phabricator-draggable-list',
- ),
'bba9eedf' => array(
'javelin-behavior',
'javelin-stratcom',
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
@@ -166,6 +166,8 @@
->withBuildTargetPHIDs(array($build_target->getPHID()))
->execute();
+ $empty_logs = array();
+
$log_boxes = array();
foreach ($logs as $log) {
$start = 1;
@@ -178,6 +180,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);
@@ -191,9 +203,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
Oct 19 2024, 3:15 AM (4 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6730040
Default Alt Text
D10091.id24297.diff (5 KB)

Event Timeline