@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.

Move artifacts and build target messages into tabs

Summary: This moves artifacts and build target messages into tabs.

Test Plan: Viewed build plan, saw the tabs appear when the steps had appropriate artifacts and / or messages.

Reviewers: #blessed_reviewers, epriestley, chad

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

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

+54 -26
+3 -3
resources/celerity/map.php
··· 7 7 */ 8 8 return array( 9 9 'names' => array( 10 - 'core.pkg.css' => '66ada2ec', 10 + 'core.pkg.css' => '519e8478', 11 11 'core.pkg.js' => '4c28870b', 12 12 'darkconsole.pkg.js' => 'df001cab', 13 13 'differential.pkg.css' => '4a93db37', ··· 137 137 'rsrc/css/phui/phui-object-box.css' => 'e9f7e938', 138 138 'rsrc/css/phui/phui-object-item-list-view.css' => '7ac40b5a', 139 139 'rsrc/css/phui/phui-pinboard-view.css' => '3dd4a269', 140 - 'rsrc/css/phui/phui-property-list-view.css' => '2f7199e8', 140 + 'rsrc/css/phui/phui-property-list-view.css' => '86f9df88', 141 141 'rsrc/css/phui/phui-remarkup-preview.css' => '19ad512b', 142 142 'rsrc/css/phui/phui-spacing.css' => '042804d6', 143 143 'rsrc/css/phui/phui-status.css' => '2f562399', ··· 787 787 'phui-object-box-css' => 'e9f7e938', 788 788 'phui-object-item-list-view-css' => '7ac40b5a', 789 789 'phui-pinboard-view-css' => '3dd4a269', 790 - 'phui-property-list-view-css' => '2f7199e8', 790 + 'phui-property-list-view-css' => '86f9df88', 791 791 'phui-remarkup-preview-css' => '19ad512b', 792 792 'phui-spacing-css' => '042804d6', 793 793 'phui-status-list-view-css' => '2f562399',
+23 -23
src/applications/harbormaster/controller/HarbormasterBuildViewController.php
··· 23 23 return new Aphront404Response(); 24 24 } 25 25 26 + require_celerity_resource('harbormaster-css'); 27 + 26 28 $title = pht('Build %d', $id); 27 29 28 30 $header = id(new PHUIHeaderView()) ··· 127 129 $target_box->addPropertyList($properties, pht('Variables')); 128 130 } 129 131 132 + $artifacts = $this->buildArtifacts($build_target); 133 + if ($artifacts) { 134 + $properties = new PHUIPropertyListView(); 135 + $properties->addRawContent($artifacts); 136 + $target_box->addPropertyList($properties, pht('Artifacts')); 137 + } 138 + 139 + $build_messages = idx($messages, $build_target->getPHID(), array()); 140 + if ($build_messages) { 141 + $properties = new PHUIPropertyListView(); 142 + $properties->addRawContent($this->buildMessages($build_messages)); 143 + $target_box->addPropertyList($properties, pht('Messages')); 144 + } 145 + 130 146 $properties = new PHUIPropertyListView(); 131 147 $properties->addProperty('Build Target ID', $build_target->getID()); 132 148 $target_box->addPropertyList($properties, pht('Metadata')); 133 149 134 150 $targets[] = $target_box; 135 151 136 - $build_messages = idx($messages, $build_target->getPHID(), array()); 137 - if ($build_messages) { 138 - $targets[] = $this->buildMessages($build_messages); 139 - } 140 - 141 - $targets[] = $this->buildArtifacts($build_target); 142 152 $targets[] = $this->buildLog($build, $build_target); 143 153 } 144 154 ··· 163 173 )); 164 174 } 165 175 166 - private function buildArtifacts(HarbormasterBuildTarget $build_target) { 176 + private function buildArtifacts( 177 + HarbormasterBuildTarget $build_target) { 178 + 167 179 $request = $this->getRequest(); 168 180 $viewer = $request->getUser(); 169 181 ··· 176 188 return null; 177 189 } 178 190 179 - $list = new PHUIObjectItemListView(); 191 + $list = id(new PHUIObjectItemListView()) 192 + ->setFlush(true); 180 193 181 194 foreach ($artifacts as $artifact) { 182 195 $list->addItem($artifact->getObjectItemView($viewer)); 183 196 } 184 197 185 - $header = id(new PHUIHeaderView()) 186 - ->setHeader(pht('Build Artifacts')) 187 - ->setUser($viewer); 188 - 189 - $box = id(new PHUIObjectBoxView()) 190 - ->setHeader($header); 191 - 192 - return array($box, $list); 198 + return $list; 193 199 } 194 200 195 201 private function buildLog( ··· 247 253 ->setForm($log_view); 248 254 249 255 if ($is_empty) { 250 - require_celerity_resource('harbormaster-css'); 251 - 252 256 $log_box = phutil_tag( 253 257 'div', 254 258 array( ··· 475 479 'date', 476 480 )); 477 481 478 - $box = id(new PHUIObjectBoxView()) 479 - ->setHeaderText(pht('Build Target Messages')) 480 - ->appendChild($table); 481 - 482 - return $box; 482 + return $table; 483 483 } 484 484 485 485
+22
src/view/phui/PHUIPropertyListView.php
··· 81 81 return $this; 82 82 } 83 83 84 + public function addRawContent($content) { 85 + $this->parts[] = array( 86 + 'type' => 'raw', 87 + 'content' => $content, 88 + ); 89 + return $this; 90 + } 91 + 84 92 public function addImageContent($content) { 85 93 $this->parts[] = array( 86 94 'type' => 'image', ··· 142 150 case 'text': 143 151 case 'image': 144 152 $items[] = $this->renderTextPart($part); 153 + break; 154 + case 'raw': 155 + $items[] = $this->renderRawPart($part); 145 156 break; 146 157 default: 147 158 throw new Exception(pht("Unknown part type '%s'!", $type)); ··· 255 266 if ($part['type'] == 'image') { 256 267 $classes[] = 'phui-property-list-image-content'; 257 268 } 269 + return phutil_tag( 270 + 'div', 271 + array( 272 + 'class' => implode($classes, ' '), 273 + ), 274 + $part['content']); 275 + } 276 + 277 + private function renderRawPart(array $part) { 278 + $classes = array(); 279 + $classes[] = 'phui-property-list-raw-content'; 258 280 return phutil_tag( 259 281 'div', 260 282 array(
+6
webroot/rsrc/css/phui/phui-property-list-view.css
··· 118 118 padding: 8px; 119 119 } 120 120 121 + .phui-property-list-raw-content { 122 + padding: 0px; 123 + background: #fff; 124 + overflow: hidden; 125 + } 126 + 121 127 /* In the common case where we immediately follow a header, move back up 30px 122 128 so we snuggle next to the header. */ 123 129 .device-desktop .phui-header-view