1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-17 18:21:11 +01:00

Have DifferentialRevisionListView return ObjectBoxView

Summary: Uses PHUIObjectBoxView to display lists of diffs in Differential and Diffusion, unless embedded on a dashboard.

Test Plan:
Test Dashboard panel, Differential home, Commit, and Diff

{F282173}

{F282174}

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11659
This commit is contained in:
Chad Little 2015-02-19 08:11:17 -08:00
parent f59a382189
commit 4c2e36f561
7 changed files with 35 additions and 13 deletions

View file

@ -7,7 +7,7 @@
*/
return array(
'names' => array(
'core.pkg.css' => 'a3a54ca1',
'core.pkg.css' => '8edbf4c0',
'core.pkg.js' => '23d653bb',
'darkconsole.pkg.js' => '8ab24e01',
'differential.pkg.css' => '380f07e5',
@ -52,7 +52,7 @@ return array(
'rsrc/css/application/conpherence/widget-pane.css' => '3d575438',
'rsrc/css/application/contentsource/content-source-view.css' => '4b8b05d4',
'rsrc/css/application/countdown/timer.css' => '86b7b0a0',
'rsrc/css/application/dashboard/dashboard.css' => 'ec324e2a',
'rsrc/css/application/dashboard/dashboard.css' => 'c0062064',
'rsrc/css/application/diff/inline-comment-summary.css' => 'eb5f8e8c',
'rsrc/css/application/differential/add-comment.css' => 'c478bcaa',
'rsrc/css/application/differential/changeset-view.css' => 'b2b71e76',
@ -138,7 +138,7 @@ return array(
'rsrc/css/phui/phui-info-panel.css' => '27ea50a1',
'rsrc/css/phui/phui-list.css' => '53deb25c',
'rsrc/css/phui/phui-object-box.css' => 'b8b7fd78',
'rsrc/css/phui/phui-object-item-list-view.css' => 'da095b41',
'rsrc/css/phui/phui-object-item-list-view.css' => '86e05b7c',
'rsrc/css/phui/phui-pinboard-view.css' => '3dd4a269',
'rsrc/css/phui/phui-property-list-view.css' => '51480060',
'rsrc/css/phui/phui-remarkup-preview.css' => '19ad512b',
@ -717,7 +717,7 @@ return array(
'phabricator-content-source-view-css' => '4b8b05d4',
'phabricator-core-css' => 'd7f6ec35',
'phabricator-countdown-css' => '86b7b0a0',
'phabricator-dashboard-css' => 'ec324e2a',
'phabricator-dashboard-css' => 'c0062064',
'phabricator-drag-and-drop-file-upload' => '8c49f386',
'phabricator-draggable-list' => 'a16ec1c6',
'phabricator-fatal-config-template-css' => '25d446d6',
@ -792,7 +792,7 @@ return array(
'phui-info-panel-css' => '27ea50a1',
'phui-list-view-css' => '53deb25c',
'phui-object-box-css' => 'b8b7fd78',
'phui-object-item-list-view-css' => 'da095b41',
'phui-object-item-list-view-css' => '86e05b7c',
'phui-pinboard-view-css' => '3dd4a269',
'phui-property-list-view-css' => '51480060',
'phui-remarkup-preview-css' => '19ad512b',

View file

@ -778,6 +778,7 @@ final class DifferentialRevisionViewController extends DifferentialController {
$user = $this->getRequest()->getUser();
$view = id(new DifferentialRevisionListView())
->setHeader(pht('Open Revisions Affecting These Files'))
->setRevisions($revisions)
->setUser($user);
@ -785,9 +786,7 @@ final class DifferentialRevisionViewController extends DifferentialController {
$handles = $this->loadViewerHandles($phids);
$view->setHandles($handles);
return id(new PHUIObjectBoxView())
->setHeaderText(pht('Open Revisions Affecting These Files'))
->appendChild($view);
return $view;
}

View file

@ -261,7 +261,8 @@ final class DifferentialRevisionSearchEngine
$viewer = $this->requireViewer();
$template = id(new DifferentialRevisionListView())
->setUser($viewer);
->setUser($viewer)
->setNoBox($this->isPanelContext());
$views = array();
if ($query->getQueryKey() == 'active') {

View file

@ -10,6 +10,7 @@ final class DifferentialRevisionListView extends AphrontView {
private $highlightAge;
private $header;
private $noDataString;
private $noBox;
public function setNoDataString($no_data_string) {
$this->noDataString = $no_data_string;
@ -32,6 +33,11 @@ final class DifferentialRevisionListView extends AphrontView {
return $this;
}
public function setNoBox($box) {
$this->noBox = $box;
return $this;
}
public function getRequiredHandlePHIDs() {
$phids = array();
foreach ($this->revisions as $revision) {
@ -179,9 +185,18 @@ final class DifferentialRevisionListView extends AphrontView {
$list->addItem($item);
}
$list->setHeader($this->header);
$list->setNoDataString($this->noDataString);
if ($this->header && !$this->noBox) {
$list->setFlush(true);
$list = id(new PHUIObjectBoxView())
->setHeaderText($this->header)
->appendChild($list);
} else {
$list->setHeader($this->header);
}
return $list;
}

View file

@ -208,6 +208,7 @@ abstract class DiffusionBrowseController extends DiffusionController {
}
$view = id(new DifferentialRevisionListView())
->setHeader(pht('Pending Differential Revisions'))
->setRevisions($revisions)
->setUser($user);
@ -215,9 +216,7 @@ abstract class DiffusionBrowseController extends DiffusionController {
$handles = $this->loadViewerHandles($phids);
$view->setHandles($handles);
return id(new PHUIObjectBoxView())
->setHeaderText(pht('Pending Differential Revisions'))
->appendChild($view);
return $view;
}
}

View file

@ -70,6 +70,10 @@
margin: 0;
}
.dashboard-panel .phui-object-item-empty .phui-error-view {
margin: 0;
}
.dashboard-panel .dashboard-box {
padding: 12px;
background: #fff;

View file

@ -69,6 +69,10 @@ ul.phui-object-item-list-view {
margin: 0 0 4px 0;
}
.phui-object-box .phui-object-list-flush .phui-object-item {
margin: 0;
}
.phui-object-item-name {
font-weight: bold;
padding: 8px 8px 0;