1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

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
This commit is contained in:
James Rhodes 2014-08-06 10:34:39 +10:00
parent cefe30d737
commit 9c1c4bb5ae
4 changed files with 54 additions and 26 deletions

View file

@ -7,7 +7,7 @@
*/
return array(
'names' => array(
'core.pkg.css' => '66ada2ec',
'core.pkg.css' => '519e8478',
'core.pkg.js' => '4c28870b',
'darkconsole.pkg.js' => 'df001cab',
'differential.pkg.css' => '4a93db37',
@ -137,7 +137,7 @@ return array(
'rsrc/css/phui/phui-object-box.css' => 'e9f7e938',
'rsrc/css/phui/phui-object-item-list-view.css' => '7ac40b5a',
'rsrc/css/phui/phui-pinboard-view.css' => '3dd4a269',
'rsrc/css/phui/phui-property-list-view.css' => '2f7199e8',
'rsrc/css/phui/phui-property-list-view.css' => '86f9df88',
'rsrc/css/phui/phui-remarkup-preview.css' => '19ad512b',
'rsrc/css/phui/phui-spacing.css' => '042804d6',
'rsrc/css/phui/phui-status.css' => '2f562399',
@ -787,7 +787,7 @@ return array(
'phui-object-box-css' => 'e9f7e938',
'phui-object-item-list-view-css' => '7ac40b5a',
'phui-pinboard-view-css' => '3dd4a269',
'phui-property-list-view-css' => '2f7199e8',
'phui-property-list-view-css' => '86f9df88',
'phui-remarkup-preview-css' => '19ad512b',
'phui-spacing-css' => '042804d6',
'phui-status-list-view-css' => '2f562399',

View file

@ -23,6 +23,8 @@ final class HarbormasterBuildViewController
return new Aphront404Response();
}
require_celerity_resource('harbormaster-css');
$title = pht('Build %d', $id);
$header = id(new PHUIHeaderView())
@ -127,18 +129,26 @@ final class HarbormasterBuildViewController
$target_box->addPropertyList($properties, pht('Variables'));
}
$artifacts = $this->buildArtifacts($build_target);
if ($artifacts) {
$properties = new PHUIPropertyListView();
$properties->addRawContent($artifacts);
$target_box->addPropertyList($properties, pht('Artifacts'));
}
$build_messages = idx($messages, $build_target->getPHID(), array());
if ($build_messages) {
$properties = new PHUIPropertyListView();
$properties->addRawContent($this->buildMessages($build_messages));
$target_box->addPropertyList($properties, pht('Messages'));
}
$properties = new PHUIPropertyListView();
$properties->addProperty('Build Target ID', $build_target->getID());
$target_box->addPropertyList($properties, pht('Metadata'));
$targets[] = $target_box;
$build_messages = idx($messages, $build_target->getPHID(), array());
if ($build_messages) {
$targets[] = $this->buildMessages($build_messages);
}
$targets[] = $this->buildArtifacts($build_target);
$targets[] = $this->buildLog($build, $build_target);
}
@ -163,7 +173,9 @@ final class HarbormasterBuildViewController
));
}
private function buildArtifacts(HarbormasterBuildTarget $build_target) {
private function buildArtifacts(
HarbormasterBuildTarget $build_target) {
$request = $this->getRequest();
$viewer = $request->getUser();
@ -176,20 +188,14 @@ final class HarbormasterBuildViewController
return null;
}
$list = new PHUIObjectItemListView();
$list = id(new PHUIObjectItemListView())
->setFlush(true);
foreach ($artifacts as $artifact) {
$list->addItem($artifact->getObjectItemView($viewer));
}
$header = id(new PHUIHeaderView())
->setHeader(pht('Build Artifacts'))
->setUser($viewer);
$box = id(new PHUIObjectBoxView())
->setHeader($header);
return array($box, $list);
return $list;
}
private function buildLog(
@ -247,8 +253,6 @@ final class HarbormasterBuildViewController
->setForm($log_view);
if ($is_empty) {
require_celerity_resource('harbormaster-css');
$log_box = phutil_tag(
'div',
array(
@ -475,11 +479,7 @@ final class HarbormasterBuildViewController
'date',
));
$box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Build Target Messages'))
->appendChild($table);
return $box;
return $table;
}

View file

@ -81,6 +81,14 @@ final class PHUIPropertyListView extends AphrontView {
return $this;
}
public function addRawContent($content) {
$this->parts[] = array(
'type' => 'raw',
'content' => $content,
);
return $this;
}
public function addImageContent($content) {
$this->parts[] = array(
'type' => 'image',
@ -143,6 +151,9 @@ final class PHUIPropertyListView extends AphrontView {
case 'image':
$items[] = $this->renderTextPart($part);
break;
case 'raw':
$items[] = $this->renderRawPart($part);
break;
default:
throw new Exception(pht("Unknown part type '%s'!", $type));
}
@ -263,4 +274,15 @@ final class PHUIPropertyListView extends AphrontView {
$part['content']);
}
private function renderRawPart(array $part) {
$classes = array();
$classes[] = 'phui-property-list-raw-content';
return phutil_tag(
'div',
array(
'class' => implode($classes, ' '),
),
$part['content']);
}
}

View file

@ -118,6 +118,12 @@
padding: 8px;
}
.phui-property-list-raw-content {
padding: 0px;
background: #fff;
overflow: hidden;
}
/* In the common case where we immediately follow a header, move back up 30px
so we snuggle next to the header. */
.device-desktop .phui-header-view