Commit a4784e03 authored by Chad Little's avatar Chad Little
Browse files

[Redesign] Add Table, Collapse support to ObjectBox

Summary: Converts most all tables to be directly set via `setTable` to an ObjectBox. I think this path is more flexible design wise, as we can change the box based on children, and not just CSS. We also already do this with PropertyList, Forms, ObjectList, and Header. `setCollapsed` is added to ObjectBox to all children objects to bleed to the edges (like diffs).

Test Plan: I did a grep of `appendChild($table)` as well as searches for `PHUIObjectBoxView`, also with manual opening of hundreds of files. I'm sure I missed 5-8 places. If you just appendChild($table) nothing breaks, it just looks a little funny.

Reviewers: epriestley, btrahan

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D12955
parent 667159eb
......@@ -176,7 +176,7 @@ abstract class AlmanacController
return id(new PHUIObjectBoxView())
->setHeader($header)
->appendChild($table);
->setTable($table);
}
protected function addLockMessage(PHUIObjectBoxView $box, $message) {
......
......@@ -141,7 +141,7 @@ final class AlmanacDeviceEditController
$box = id(new PHUIObjectBoxView())
->setValidationException($validation_exception)
->setHeaderText($title)
->appendChild($form);
->setForm($form);
$crumbs = $this->buildApplicationCrumbs();
if ($is_new) {
......
......@@ -139,7 +139,7 @@ final class AlmanacDeviceViewController
return id(new PHUIObjectBoxView())
->setHeader($header)
->appendChild($table);
->setTable($table);
}
private function buildSSHKeysTable(AlmanacDevice $device) {
......@@ -200,7 +200,7 @@ final class AlmanacDeviceViewController
return id(new PHUIObjectBoxView())
->setHeader($header)
->appendChild($table);
->setTable($table);
}
......@@ -249,7 +249,7 @@ final class AlmanacDeviceViewController
return id(new PHUIObjectBoxView())
->setHeaderText(pht('Bound Services'))
->appendChild($table);
->setTable($table);
}
......
......@@ -132,7 +132,7 @@ final class AlmanacInterfaceEditController
$box = id(new PHUIObjectBoxView())
->setValidationException($validation_exception)
->setHeaderText($title)
->appendChild($form);
->setForm($form);
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($device->getName(), $device_uri);
......
......@@ -120,7 +120,7 @@ final class AlmanacNetworkEditController
$box = id(new PHUIObjectBoxView())
->setValidationException($validation_exception)
->setHeaderText($title)
->appendChild($form);
->setForm($form);
$crumbs = $this->buildApplicationCrumbs();
if ($is_new) {
......
......@@ -238,7 +238,7 @@ final class AlmanacServiceEditController
$box = id(new PHUIObjectBoxView())
->setFormErrors($errors)
->setHeaderText($title)
->appendChild($form);
->setForm($form);
return $this->buildApplicationPage(
array(
......
......@@ -141,7 +141,7 @@ final class AlmanacServiceViewController
return id(new PHUIObjectBoxView())
->setHeader($header)
->appendChild($table);
->setTable($table);
}
}
......@@ -94,7 +94,7 @@ final class PhabricatorPasswordAuthProvider extends PhabricatorAuthProvider {
return id(new PHUIObjectBoxView())
->setHeader($header)
->appendChild($table);
->setTable($table);
}
public function getDescriptionForCreate() {
......
......@@ -104,6 +104,6 @@ final class PhabricatorAuthInviteSearchEngine
return id(new PHUIObjectBoxView())
->setHeaderText(pht('Email Invitations'))
->appendChild($table);
->setTable($table);
}
}
......@@ -29,10 +29,14 @@ final class PhabricatorChatLogChannelListController
->buildApplicationCrumbs()
->addTextCrumb(pht('Channel List'), $this->getApplicationURI());
$box = id(new PHUIObjectBoxView())
->setHeaderText('Channel List')
->setObjectList($list);
return $this->buildApplicationPage(
array(
$crumbs,
$list,
$box,
),
array(
'title' => pht('Channel List'),
......
......@@ -566,11 +566,11 @@ final class PhabricatorConduitAPIController
$param_panel = new PHUIObjectBoxView();
$param_panel->setHeaderText(pht('Method Parameters'));
$param_panel->appendChild($param_table);
$param_panel->setTable($param_table);
$result_panel = new PHUIObjectBoxView();
$result_panel->setHeaderText(pht('Method Result'));
$result_panel->appendChild($result_table);
$result_panel->setTable($result_table);
$method_uri = $this->getApplicationURI('method/'.$method.'/');
......
......@@ -86,7 +86,7 @@ final class PhabricatorConduitConsoleController
$form_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Call Method'))
->appendChild($form);
->setForm($form);
$content = array();
......@@ -129,7 +129,7 @@ final class PhabricatorConduitConsoleController
));
$content[] = id(new PHUIObjectBoxView())
->setHeaderText(pht('Builtin Orders'))
->appendChild($table);
->setTable($table);
$columns = $query->getOrderableColumns();
......@@ -154,7 +154,7 @@ final class PhabricatorConduitConsoleController
));
$content[] = id(new PHUIObjectBoxView())
->setHeaderText(pht('Column Orders'))
->appendChild($table);
->setTable($table);
}
$crumbs = $this->buildApplicationCrumbs();
......
......@@ -37,7 +37,7 @@ final class PhabricatorConduitLogController
$table = $this->renderCallTable($calls, $conns);
$box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Call Logs'))
->appendChild($table);
->setTable($table);
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Call Logs'));
......
......@@ -108,7 +108,7 @@ final class PhabricatorConduitTokensSettingsPanel
$panel = id(new PHUIObjectBoxView())
->setHeader($header)
->appendChild($table);
->setTable($table);
return $panel;
}
......
......@@ -57,7 +57,7 @@ final class PhabricatorConfigAllController
$panel = new PHUIObjectBoxView();
$panel->setHeaderText(pht('Current Settings'));
$panel->appendChild($table);
$panel->setTable($table);
$versions = $this->loadVersions();
......
......@@ -92,7 +92,7 @@ final class PhabricatorConfigCacheController
return id(new PHUIObjectBoxView())
->setHeaderText(pht('Data Cache'))
->addPropertyList($properties)
->appendChild($table);
->setTable($table);
}
private function renderCommonProperties(
......
......@@ -150,7 +150,7 @@ final class PhabricatorConfigDatabaseIssueController
$table_box = id(new PHUIObjectBoxView())
->setHeader($this->buildHeaderWithDocumentationLink($title))
->setFormErrors($errors)
->appendChild($table);
->setTable($table);
$nav = $this->buildSideNavView();
$nav->selectFilter('dbissue/');
......
......@@ -165,12 +165,15 @@ final class PhabricatorConfigDatabaseStatusController
),
$comp->getIssues());
$box = id(new PHUIObjectBoxView())
$prop_box = id(new PHUIObjectBoxView())
->setHeader($this->buildHeaderWithDocumentationLink($title))
->addPropertyList($properties)
->appendChild($table);
->addPropertyList($properties);
return $this->buildResponse($title, $box);
$table_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Databases'))
->setTable($table);
return $this->buildResponse($title, array($prop_box, $table_box));
}
private function renderDatabase(
......@@ -219,7 +222,7 @@ final class PhabricatorConfigDatabaseStatusController
null,
));
$title = pht('Database Status: %s', $database_name);
$title = pht('Database: %s', $database_name);
$actual_database = $actual->getDatabase($database_name);
if ($actual_database) {
......@@ -260,12 +263,15 @@ final class PhabricatorConfigDatabaseStatusController
),
$database->getIssues());
$box = id(new PHUIObjectBoxView())
$prop_box = id(new PHUIObjectBoxView())
->setHeader($this->buildHeaderWithDocumentationLink($title))
->addPropertyList($properties)
->appendChild($table);
->addPropertyList($properties);
return $this->buildResponse($title, $box);
$table_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Database Status'))
->setTable($table);
return $this->buildResponse($title, array($prop_box, $table_box));
}
private function renderTable(
......@@ -443,7 +449,7 @@ final class PhabricatorConfigDatabaseStatusController
null,
));
$title = pht('Database Status: %s.%s', $database_name, $table_name);
$title = pht('Database: %s.%s', $database_name, $table_name);
if ($actual_table) {
$actual_collation = $actual_table->getCollation();
......@@ -470,13 +476,19 @@ final class PhabricatorConfigDatabaseStatusController
),
$table->getIssues());
$box = id(new PHUIObjectBoxView())
$prop_box = id(new PHUIObjectBoxView())
->setHeader($this->buildHeaderWithDocumentationLink($title))
->addPropertyList($properties)
->appendChild($table_view)
->appendChild($keys_view);
->addPropertyList($properties);
return $this->buildResponse($title, $box);
$table_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Database'))
->setTable($table_view);
$key_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Keys'))
->setTable($keys_view);
return $this->buildResponse($title, array($prop_box, $table_box, $key_box));
}
private function renderColumn(
......
......@@ -28,25 +28,25 @@ final class PhabricatorConfigIssueListController
$setup_issues[] = id(new PHUIObjectBoxView())
->setHeaderText(pht('Important Setup Issues'))
->setColor(PHUIObjectBoxView::COLOR_RED)
->appendChild($important);
->setObjectList($important);
}
if ($php) {
$setup_issues[] = id(new PHUIObjectBoxView())
->setHeaderText(pht('PHP Setup Issues'))
->appendChild($php);
->setObjectList($php);
}
if ($mysql) {
$setup_issues[] = id(new PHUIObjectBoxView())
->setHeaderText(pht('MySQL Setup Issues'))
->appendChild($mysql);
->setObjectList($mysql);
}
if ($other) {
$setup_issues[] = id(new PHUIObjectBoxView())
->setHeaderText(pht('Other Setup Issues'))
->appendChild($other);
->setObjectList($other);
}
if (empty($setup_issues)) {
......
......@@ -18,7 +18,7 @@ final class PhabricatorConfigListController
$core = id(new PHUIObjectBoxView())
->setHeaderText($title)
->appendChild($core_list);
->setObjectList($core_list);
$apps = id(new PHUIObjectBoxView())
->setHeaderText(pht('Applications Configuration'))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment