@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Hide empty build logs

Summary: This automatically hides any empty build logs from Harbormaster, so that they do not appear.

Test Plan: Viewed a build plan where the logs were empty and didn't see them appear.

Reviewers: chad, #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D10091

+68 -3
+2 -2
resources/celerity/map.php
··· 67 67 'rsrc/css/application/feed/feed.css' => '4e544db4', 68 68 'rsrc/css/application/files/global-drag-and-drop.css' => '697324ad', 69 69 'rsrc/css/application/flag/flag.css' => '5337623f', 70 - 'rsrc/css/application/harbormaster/harbormaster.css' => 'cec833b7', 70 + 'rsrc/css/application/harbormaster/harbormaster.css' => '49d64eb4', 71 71 'rsrc/css/application/herald/herald-test.css' => '778b008e', 72 72 'rsrc/css/application/herald/herald.css' => 'c544dd1c', 73 73 'rsrc/css/application/maniphest/batch-editor.css' => '8f380ebc', ··· 538 538 'font-fontawesome' => '73d075c3', 539 539 'font-source-sans-pro' => '91d53463', 540 540 'global-drag-and-drop-css' => '697324ad', 541 - 'harbormaster-css' => 'cec833b7', 541 + 'harbormaster-css' => '49d64eb4', 542 542 'herald-css' => 'c544dd1c', 543 543 'herald-rule-editor' => '3fc2c8f2', 544 544 'herald-test-css' => '778b008e',
+58 -1
src/applications/harbormaster/controller/HarbormasterBuildViewController.php
··· 205 205 ->withBuildTargetPHIDs(array($build_target->getPHID())) 206 206 ->execute(); 207 207 208 + $empty_logs = array(); 209 + 208 210 $log_boxes = array(); 209 211 foreach ($logs as $log) { 210 212 $start = 1; ··· 217 219 $start = 1; 218 220 } 219 221 } 222 + 223 + $id = null; 224 + $is_empty = false; 225 + if (count($lines) === 1 && trim($lines[0]) === '') { 226 + // Prevent Harbormaster from showing empty build logs. 227 + $id = celerity_generate_unique_node_id(); 228 + $empty_logs[] = $id; 229 + $is_empty = true; 230 + } 231 + 220 232 $log_view = new ShellLogView(); 221 233 $log_view->setLines($lines); 222 234 $log_view->setStart($start); ··· 230 242 ->setSubheader($this->createLogHeader($build, $log)) 231 243 ->setUser($viewer); 232 244 233 - $log_boxes[] = id(new PHUIObjectBoxView()) 245 + $log_box = id(new PHUIObjectBoxView()) 234 246 ->setHeader($header) 235 247 ->setForm($log_view); 248 + 249 + if ($is_empty) { 250 + require_celerity_resource('harbormaster-css'); 251 + 252 + $log_box = phutil_tag( 253 + 'div', 254 + array( 255 + 'style' => 'display: none', 256 + 'id' => $id), 257 + $log_box); 258 + } 259 + 260 + $log_boxes[] = $log_box; 261 + } 262 + 263 + if ($empty_logs) { 264 + $hide_id = celerity_generate_unique_node_id(); 265 + 266 + Javelin::initBehavior('phabricator-reveal-content'); 267 + 268 + $expand = phutil_tag( 269 + 'div', 270 + array( 271 + 'id' => $hide_id, 272 + 'class' => 'harbormaster-empty-logs-are-hidden mlr mlt mll', 273 + ), 274 + array( 275 + pht( 276 + '%s empty logs are hidden.', 277 + new PhutilNumber(count($empty_logs))), 278 + ' ', 279 + javelin_tag( 280 + 'a', 281 + array( 282 + 'href' => '#', 283 + 'sigil' => 'reveal-content', 284 + 'meta' => array( 285 + 'showIDs' => $empty_logs, 286 + 'hideIDs' => array($hide_id), 287 + ), 288 + ), 289 + pht('Show all logs.')), 290 + )); 291 + 292 + array_unshift($log_boxes, $expand); 236 293 } 237 294 238 295 return $log_boxes;
+8
webroot/rsrc/css/application/harbormaster/harbormaster.css
··· 17 17 margin-bottom: 2px; 18 18 color: {$darkbluetext}; 19 19 } 20 + 21 + .harbormaster-empty-logs-are-hidden { 22 + background: {$lightyellow}; 23 + border: 1px solid {$yellow}; 24 + text-align: center; 25 + padding: 12px; 26 + color: {$darkgreytext}; 27 + }