From e2685a248b8c3071ab5619506ee7d2c2171f03c5 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Mon, 4 Apr 2016 16:30:55 -0700 Subject: [PATCH] Update Conduit for new UI Summary: View various conduit pages and update to new UI and add calls to newPage Test Plan: View list, view method, make a call. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D15613 --- .../PhabricatorConduitAPIController.php | 39 ++++++++++++------- .../PhabricatorConduitConsoleController.php | 34 +++++++++------- .../PhabricatorConduitController.php | 1 + .../PhabricatorConduitTokenController.php | 23 +++++++---- .../PhabricatorSearchEngineAPIMethod.php | 6 +++ .../PhabricatorEditEngineAPIMethod.php | 2 + 6 files changed, 69 insertions(+), 36 deletions(-) diff --git a/src/applications/conduit/controller/PhabricatorConduitAPIController.php b/src/applications/conduit/controller/PhabricatorConduitAPIController.php index e335772b7f..005b23d505 100644 --- a/src/applications/conduit/controller/PhabricatorConduitAPIController.php +++ b/src/applications/conduit/controller/PhabricatorConduitAPIController.php @@ -511,19 +511,22 @@ final class PhabricatorConduitAPIController 'wide', )); - $param_panel = new PHUIObjectBoxView(); - $param_panel->setHeaderText(pht('Method Parameters')); - $param_panel->setTable($param_table); + $param_panel = id(new PHUIObjectBoxView()) + ->setHeaderText(pht('Method Parameters')) + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) + ->setTable($param_table); - $result_panel = new PHUIObjectBoxView(); - $result_panel->setHeaderText(pht('Method Result')); - $result_panel->setTable($result_table); + $result_panel = id(new PHUIObjectBoxView()) + ->setHeaderText(pht('Method Result')) + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) + ->setTable($result_table); $method_uri = $this->getApplicationURI('method/'.$method.'/'); $crumbs = $this->buildApplicationCrumbs() ->addTextCrumb($method, $method_uri) - ->addTextCrumb(pht('Call')); + ->addTextCrumb(pht('Call')) + ->setBorder(true); $example_panel = null; if ($request && $method_implementation) { @@ -533,16 +536,26 @@ final class PhabricatorConduitAPIController $params); } - return $this->buildApplicationPage( - array( - $crumbs, + $title = pht('Method Call Result'); + $header = id(new PHUIHeaderView()) + ->setHeader($title) + ->setHeaderIcon('fa-exchange'); + + $view = id(new PHUITwoColumnView()) + ->setHeader($header) + ->setFooter(array( $param_panel, $result_panel, $example_panel, - ), - array( - 'title' => pht('Method Call Result'), )); + + $title = pht('Method Call Result'); + + return $this->newPage() + ->setTitle($title) + ->setCrumbs($crumbs) + ->appendChild($view); + } private function renderAPIValue($value) { diff --git a/src/applications/conduit/controller/PhabricatorConduitConsoleController.php b/src/applications/conduit/controller/PhabricatorConduitConsoleController.php index f11415795e..5ee76b44f7 100644 --- a/src/applications/conduit/controller/PhabricatorConduitConsoleController.php +++ b/src/applications/conduit/controller/PhabricatorConduitConsoleController.php @@ -85,37 +85,41 @@ final class PhabricatorConduitConsoleController $header = id(new PHUIHeaderView()) ->setUser($viewer) - ->setHeader($method->getAPIMethodName()); + ->setHeader($method->getAPIMethodName()) + ->setHeaderIcon('fa-tty'); $form_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Call Method')) + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->setForm($form); - $content = array(); - $properties = $this->buildMethodProperties($method); $info_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('API Method: %s', $method->getAPIMethodName())) ->setFormErrors($errors) + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->appendChild($properties); - $content[] = $info_box; - $content[] = $method->getMethodDocumentation(); - $content[] = $form_box; - $content[] = $this->renderExampleBox($method, null); - $crumbs = $this->buildApplicationCrumbs(); $crumbs->addTextCrumb($method->getAPIMethodName()); + $crumbs->setBorder(true); - return $this->buildApplicationPage( - array( - $crumbs, - $content, - ), - array( - 'title' => $method->getAPIMethodName(), + $view = id(new PHUITwoColumnView()) + ->setHeader($header) + ->setFooter(array( + $info_box, + $method->getMethodDocumentation(), + $form_box, + $this->renderExampleBox($method, null), )); + + $title = $method->getAPIMethodName(); + + return $this->newPage() + ->setTitle($title) + ->setCrumbs($crumbs) + ->appendChild($view); } private function buildMethodProperties(ConduitAPIMethod $method) { diff --git a/src/applications/conduit/controller/PhabricatorConduitController.php b/src/applications/conduit/controller/PhabricatorConduitController.php index 4fa11dbfad..000d01f888 100644 --- a/src/applications/conduit/controller/PhabricatorConduitController.php +++ b/src/applications/conduit/controller/PhabricatorConduitController.php @@ -56,6 +56,7 @@ abstract class PhabricatorConduitController extends PhabricatorController { return id(new PHUIObjectBoxView()) ->setHeaderText(pht('Examples')) ->setInfoView($info_view) + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->addPropertyList($arc_example, pht('arc call-conduit')) ->addPropertyList($curl_example, pht('cURL')) ->addPropertyList($php_example, pht('PHP')); diff --git a/src/applications/conduit/controller/PhabricatorConduitTokenController.php b/src/applications/conduit/controller/PhabricatorConduitTokenController.php index b5501a2805..fe6d676b68 100644 --- a/src/applications/conduit/controller/PhabricatorConduitTokenController.php +++ b/src/applications/conduit/controller/PhabricatorConduitTokenController.php @@ -55,19 +55,26 @@ final class PhabricatorConduitTokenController $crumbs = $this->buildApplicationCrumbs(); $crumbs->addTextCrumb(pht('Install Certificate')); + $crumbs->setBorder(true); $object_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Certificate Token')) + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->setForm($form); - return $this->buildApplicationPage( - array( - $crumbs, - $object_box, - ), - array( - 'title' => pht('Certificate Install Token'), - )); + $title = pht('Certificate Install Token'); + + $header = id(new PHUIHeaderView()) + ->setHeader($title); + + $view = id(new PHUITwoColumnView()) + ->setHeader($header) + ->setFooter($object_box); + + return $this->newPage() + ->setTitle($title) + ->setCrumbs($crumbs) + ->appendChild($view); } } diff --git a/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php b/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php index f411c208bf..b5cd52471b 100644 --- a/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php +++ b/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php @@ -151,6 +151,7 @@ EOTEXT return id(new PHUIObjectBoxView()) ->setHeaderText(pht('Builtin and Saved Queries')) ->setCollapsed(true) + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->appendChild($this->buildRemarkup($info)) ->appendChild($table); } @@ -236,6 +237,7 @@ EOTEXT return id(new PHUIObjectBoxView()) ->setHeaderText(pht('Custom Query Constraints')) ->setCollapsed(true) + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->appendChild($this->buildRemarkup($info)) ->appendChild($table); } @@ -342,6 +344,7 @@ EOTEXT return id(new PHUIObjectBoxView()) ->setHeaderText(pht('Result Ordering')) ->setCollapsed(true) + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->appendChild($this->buildRemarkup($orders_info)) ->appendChild($orders_table) ->appendChild($this->buildRemarkup($columns_info)) @@ -422,6 +425,7 @@ EOTEXT return id(new PHUIObjectBoxView()) ->setHeaderText(pht('Object Fields')) ->setCollapsed(true) + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->appendChild($this->buildRemarkup($info)) ->appendChild($table); } @@ -510,6 +514,7 @@ EOTEXT return id(new PHUIObjectBoxView()) ->setHeaderText(pht('Attachments')) ->setCollapsed(true) + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->appendChild($this->buildRemarkup($info)) ->appendChild($table); } @@ -580,6 +585,7 @@ EOTEXT return id(new PHUIObjectBoxView()) ->setHeaderText(pht('Paging and Limits')) ->setCollapsed(true) + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->appendChild($this->buildRemarkup($info)); } diff --git a/src/applications/transactions/editengine/PhabricatorEditEngineAPIMethod.php b/src/applications/transactions/editengine/PhabricatorEditEngineAPIMethod.php index 3cf04aeca8..b6f95ecd1b 100644 --- a/src/applications/transactions/editengine/PhabricatorEditEngineAPIMethod.php +++ b/src/applications/transactions/editengine/PhabricatorEditEngineAPIMethod.php @@ -94,6 +94,7 @@ abstract class PhabricatorEditEngineAPIMethod $boxes[] = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Transaction Types')) ->setCollapsed(true) + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->appendChild($this->buildRemarkup($summary_info)) ->appendChild($summary_table); @@ -140,6 +141,7 @@ abstract class PhabricatorEditEngineAPIMethod $boxes[] = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Transaction Type: %s', $type->getEditType())) ->setCollapsed(true) + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->appendChild($this->buildRemarkup($section)) ->appendChild($type_table); }