mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-18 19:40:55 +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:
parent
cefe30d737
commit
9c1c4bb5ae
4 changed files with 54 additions and 26 deletions
|
@ -7,7 +7,7 @@
|
||||||
*/
|
*/
|
||||||
return array(
|
return array(
|
||||||
'names' => array(
|
'names' => array(
|
||||||
'core.pkg.css' => '66ada2ec',
|
'core.pkg.css' => '519e8478',
|
||||||
'core.pkg.js' => '4c28870b',
|
'core.pkg.js' => '4c28870b',
|
||||||
'darkconsole.pkg.js' => 'df001cab',
|
'darkconsole.pkg.js' => 'df001cab',
|
||||||
'differential.pkg.css' => '4a93db37',
|
'differential.pkg.css' => '4a93db37',
|
||||||
|
@ -137,7 +137,7 @@ return array(
|
||||||
'rsrc/css/phui/phui-object-box.css' => 'e9f7e938',
|
'rsrc/css/phui/phui-object-box.css' => 'e9f7e938',
|
||||||
'rsrc/css/phui/phui-object-item-list-view.css' => '7ac40b5a',
|
'rsrc/css/phui/phui-object-item-list-view.css' => '7ac40b5a',
|
||||||
'rsrc/css/phui/phui-pinboard-view.css' => '3dd4a269',
|
'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-remarkup-preview.css' => '19ad512b',
|
||||||
'rsrc/css/phui/phui-spacing.css' => '042804d6',
|
'rsrc/css/phui/phui-spacing.css' => '042804d6',
|
||||||
'rsrc/css/phui/phui-status.css' => '2f562399',
|
'rsrc/css/phui/phui-status.css' => '2f562399',
|
||||||
|
@ -787,7 +787,7 @@ return array(
|
||||||
'phui-object-box-css' => 'e9f7e938',
|
'phui-object-box-css' => 'e9f7e938',
|
||||||
'phui-object-item-list-view-css' => '7ac40b5a',
|
'phui-object-item-list-view-css' => '7ac40b5a',
|
||||||
'phui-pinboard-view-css' => '3dd4a269',
|
'phui-pinboard-view-css' => '3dd4a269',
|
||||||
'phui-property-list-view-css' => '2f7199e8',
|
'phui-property-list-view-css' => '86f9df88',
|
||||||
'phui-remarkup-preview-css' => '19ad512b',
|
'phui-remarkup-preview-css' => '19ad512b',
|
||||||
'phui-spacing-css' => '042804d6',
|
'phui-spacing-css' => '042804d6',
|
||||||
'phui-status-list-view-css' => '2f562399',
|
'phui-status-list-view-css' => '2f562399',
|
||||||
|
|
|
@ -23,6 +23,8 @@ final class HarbormasterBuildViewController
|
||||||
return new Aphront404Response();
|
return new Aphront404Response();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
require_celerity_resource('harbormaster-css');
|
||||||
|
|
||||||
$title = pht('Build %d', $id);
|
$title = pht('Build %d', $id);
|
||||||
|
|
||||||
$header = id(new PHUIHeaderView())
|
$header = id(new PHUIHeaderView())
|
||||||
|
@ -127,18 +129,26 @@ final class HarbormasterBuildViewController
|
||||||
$target_box->addPropertyList($properties, pht('Variables'));
|
$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 = new PHUIPropertyListView();
|
||||||
$properties->addProperty('Build Target ID', $build_target->getID());
|
$properties->addProperty('Build Target ID', $build_target->getID());
|
||||||
$target_box->addPropertyList($properties, pht('Metadata'));
|
$target_box->addPropertyList($properties, pht('Metadata'));
|
||||||
|
|
||||||
$targets[] = $target_box;
|
$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);
|
$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();
|
$request = $this->getRequest();
|
||||||
$viewer = $request->getUser();
|
$viewer = $request->getUser();
|
||||||
|
|
||||||
|
@ -176,20 +188,14 @@ final class HarbormasterBuildViewController
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$list = new PHUIObjectItemListView();
|
$list = id(new PHUIObjectItemListView())
|
||||||
|
->setFlush(true);
|
||||||
|
|
||||||
foreach ($artifacts as $artifact) {
|
foreach ($artifacts as $artifact) {
|
||||||
$list->addItem($artifact->getObjectItemView($viewer));
|
$list->addItem($artifact->getObjectItemView($viewer));
|
||||||
}
|
}
|
||||||
|
|
||||||
$header = id(new PHUIHeaderView())
|
return $list;
|
||||||
->setHeader(pht('Build Artifacts'))
|
|
||||||
->setUser($viewer);
|
|
||||||
|
|
||||||
$box = id(new PHUIObjectBoxView())
|
|
||||||
->setHeader($header);
|
|
||||||
|
|
||||||
return array($box, $list);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function buildLog(
|
private function buildLog(
|
||||||
|
@ -247,8 +253,6 @@ final class HarbormasterBuildViewController
|
||||||
->setForm($log_view);
|
->setForm($log_view);
|
||||||
|
|
||||||
if ($is_empty) {
|
if ($is_empty) {
|
||||||
require_celerity_resource('harbormaster-css');
|
|
||||||
|
|
||||||
$log_box = phutil_tag(
|
$log_box = phutil_tag(
|
||||||
'div',
|
'div',
|
||||||
array(
|
array(
|
||||||
|
@ -475,11 +479,7 @@ final class HarbormasterBuildViewController
|
||||||
'date',
|
'date',
|
||||||
));
|
));
|
||||||
|
|
||||||
$box = id(new PHUIObjectBoxView())
|
return $table;
|
||||||
->setHeaderText(pht('Build Target Messages'))
|
|
||||||
->appendChild($table);
|
|
||||||
|
|
||||||
return $box;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -81,6 +81,14 @@ final class PHUIPropertyListView extends AphrontView {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function addRawContent($content) {
|
||||||
|
$this->parts[] = array(
|
||||||
|
'type' => 'raw',
|
||||||
|
'content' => $content,
|
||||||
|
);
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
public function addImageContent($content) {
|
public function addImageContent($content) {
|
||||||
$this->parts[] = array(
|
$this->parts[] = array(
|
||||||
'type' => 'image',
|
'type' => 'image',
|
||||||
|
@ -143,6 +151,9 @@ final class PHUIPropertyListView extends AphrontView {
|
||||||
case 'image':
|
case 'image':
|
||||||
$items[] = $this->renderTextPart($part);
|
$items[] = $this->renderTextPart($part);
|
||||||
break;
|
break;
|
||||||
|
case 'raw':
|
||||||
|
$items[] = $this->renderRawPart($part);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Exception(pht("Unknown part type '%s'!", $type));
|
throw new Exception(pht("Unknown part type '%s'!", $type));
|
||||||
}
|
}
|
||||||
|
@ -263,4 +274,15 @@ final class PHUIPropertyListView extends AphrontView {
|
||||||
$part['content']);
|
$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']);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,6 +118,12 @@
|
||||||
padding: 8px;
|
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
|
/* In the common case where we immediately follow a header, move back up 30px
|
||||||
so we snuggle next to the header. */
|
so we snuggle next to the header. */
|
||||||
.device-desktop .phui-header-view
|
.device-desktop .phui-header-view
|
||||||
|
|
Loading…
Reference in a new issue