1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-04-01 23:18:15 +02:00

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
This commit is contained in:
Chad Little 2016-04-04 16:30:55 -07:00
parent 0b54810ba1
commit e2685a248b
6 changed files with 69 additions and 36 deletions

View file

@ -511,19 +511,22 @@ final class PhabricatorConduitAPIController
'wide', 'wide',
)); ));
$param_panel = new PHUIObjectBoxView(); $param_panel = id(new PHUIObjectBoxView())
$param_panel->setHeaderText(pht('Method Parameters')); ->setHeaderText(pht('Method Parameters'))
$param_panel->setTable($param_table); ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setTable($param_table);
$result_panel = new PHUIObjectBoxView(); $result_panel = id(new PHUIObjectBoxView())
$result_panel->setHeaderText(pht('Method Result')); ->setHeaderText(pht('Method Result'))
$result_panel->setTable($result_table); ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setTable($result_table);
$method_uri = $this->getApplicationURI('method/'.$method.'/'); $method_uri = $this->getApplicationURI('method/'.$method.'/');
$crumbs = $this->buildApplicationCrumbs() $crumbs = $this->buildApplicationCrumbs()
->addTextCrumb($method, $method_uri) ->addTextCrumb($method, $method_uri)
->addTextCrumb(pht('Call')); ->addTextCrumb(pht('Call'))
->setBorder(true);
$example_panel = null; $example_panel = null;
if ($request && $method_implementation) { if ($request && $method_implementation) {
@ -533,16 +536,26 @@ final class PhabricatorConduitAPIController
$params); $params);
} }
return $this->buildApplicationPage( $title = pht('Method Call Result');
array( $header = id(new PHUIHeaderView())
$crumbs, ->setHeader($title)
->setHeaderIcon('fa-exchange');
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$param_panel, $param_panel,
$result_panel, $result_panel,
$example_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) { private function renderAPIValue($value) {

View file

@ -85,37 +85,41 @@ final class PhabricatorConduitConsoleController
$header = id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setUser($viewer) ->setUser($viewer)
->setHeader($method->getAPIMethodName()); ->setHeader($method->getAPIMethodName())
->setHeaderIcon('fa-tty');
$form_box = id(new PHUIObjectBoxView()) $form_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Call Method')) ->setHeaderText(pht('Call Method'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form); ->setForm($form);
$content = array();
$properties = $this->buildMethodProperties($method); $properties = $this->buildMethodProperties($method);
$info_box = id(new PHUIObjectBoxView()) $info_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('API Method: %s', $method->getAPIMethodName())) ->setHeaderText(pht('API Method: %s', $method->getAPIMethodName()))
->setFormErrors($errors) ->setFormErrors($errors)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($properties); ->appendChild($properties);
$content[] = $info_box;
$content[] = $method->getMethodDocumentation();
$content[] = $form_box;
$content[] = $this->renderExampleBox($method, null);
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($method->getAPIMethodName()); $crumbs->addTextCrumb($method->getAPIMethodName());
$crumbs->setBorder(true);
return $this->buildApplicationPage( $view = id(new PHUITwoColumnView())
array( ->setHeader($header)
$crumbs, ->setFooter(array(
$content, $info_box,
), $method->getMethodDocumentation(),
array( $form_box,
'title' => $method->getAPIMethodName(), $this->renderExampleBox($method, null),
)); ));
$title = $method->getAPIMethodName();
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->appendChild($view);
} }
private function buildMethodProperties(ConduitAPIMethod $method) { private function buildMethodProperties(ConduitAPIMethod $method) {

View file

@ -56,6 +56,7 @@ abstract class PhabricatorConduitController extends PhabricatorController {
return id(new PHUIObjectBoxView()) return id(new PHUIObjectBoxView())
->setHeaderText(pht('Examples')) ->setHeaderText(pht('Examples'))
->setInfoView($info_view) ->setInfoView($info_view)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->addPropertyList($arc_example, pht('arc call-conduit')) ->addPropertyList($arc_example, pht('arc call-conduit'))
->addPropertyList($curl_example, pht('cURL')) ->addPropertyList($curl_example, pht('cURL'))
->addPropertyList($php_example, pht('PHP')); ->addPropertyList($php_example, pht('PHP'));

View file

@ -55,19 +55,26 @@ final class PhabricatorConduitTokenController
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Install Certificate')); $crumbs->addTextCrumb(pht('Install Certificate'));
$crumbs->setBorder(true);
$object_box = id(new PHUIObjectBoxView()) $object_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Certificate Token')) ->setHeaderText(pht('Certificate Token'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form); ->setForm($form);
return $this->buildApplicationPage( $title = pht('Certificate Install Token');
array(
$crumbs, $header = id(new PHUIHeaderView())
$object_box, ->setHeader($title);
),
array( $view = id(new PHUITwoColumnView())
'title' => pht('Certificate Install Token'), ->setHeader($header)
)); ->setFooter($object_box);
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->appendChild($view);
} }
} }

View file

@ -151,6 +151,7 @@ EOTEXT
return id(new PHUIObjectBoxView()) return id(new PHUIObjectBoxView())
->setHeaderText(pht('Builtin and Saved Queries')) ->setHeaderText(pht('Builtin and Saved Queries'))
->setCollapsed(true) ->setCollapsed(true)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($this->buildRemarkup($info)) ->appendChild($this->buildRemarkup($info))
->appendChild($table); ->appendChild($table);
} }
@ -236,6 +237,7 @@ EOTEXT
return id(new PHUIObjectBoxView()) return id(new PHUIObjectBoxView())
->setHeaderText(pht('Custom Query Constraints')) ->setHeaderText(pht('Custom Query Constraints'))
->setCollapsed(true) ->setCollapsed(true)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($this->buildRemarkup($info)) ->appendChild($this->buildRemarkup($info))
->appendChild($table); ->appendChild($table);
} }
@ -342,6 +344,7 @@ EOTEXT
return id(new PHUIObjectBoxView()) return id(new PHUIObjectBoxView())
->setHeaderText(pht('Result Ordering')) ->setHeaderText(pht('Result Ordering'))
->setCollapsed(true) ->setCollapsed(true)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($this->buildRemarkup($orders_info)) ->appendChild($this->buildRemarkup($orders_info))
->appendChild($orders_table) ->appendChild($orders_table)
->appendChild($this->buildRemarkup($columns_info)) ->appendChild($this->buildRemarkup($columns_info))
@ -422,6 +425,7 @@ EOTEXT
return id(new PHUIObjectBoxView()) return id(new PHUIObjectBoxView())
->setHeaderText(pht('Object Fields')) ->setHeaderText(pht('Object Fields'))
->setCollapsed(true) ->setCollapsed(true)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($this->buildRemarkup($info)) ->appendChild($this->buildRemarkup($info))
->appendChild($table); ->appendChild($table);
} }
@ -510,6 +514,7 @@ EOTEXT
return id(new PHUIObjectBoxView()) return id(new PHUIObjectBoxView())
->setHeaderText(pht('Attachments')) ->setHeaderText(pht('Attachments'))
->setCollapsed(true) ->setCollapsed(true)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($this->buildRemarkup($info)) ->appendChild($this->buildRemarkup($info))
->appendChild($table); ->appendChild($table);
} }
@ -580,6 +585,7 @@ EOTEXT
return id(new PHUIObjectBoxView()) return id(new PHUIObjectBoxView())
->setHeaderText(pht('Paging and Limits')) ->setHeaderText(pht('Paging and Limits'))
->setCollapsed(true) ->setCollapsed(true)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($this->buildRemarkup($info)); ->appendChild($this->buildRemarkup($info));
} }

View file

@ -94,6 +94,7 @@ abstract class PhabricatorEditEngineAPIMethod
$boxes[] = id(new PHUIObjectBoxView()) $boxes[] = id(new PHUIObjectBoxView())
->setHeaderText(pht('Transaction Types')) ->setHeaderText(pht('Transaction Types'))
->setCollapsed(true) ->setCollapsed(true)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($this->buildRemarkup($summary_info)) ->appendChild($this->buildRemarkup($summary_info))
->appendChild($summary_table); ->appendChild($summary_table);
@ -140,6 +141,7 @@ abstract class PhabricatorEditEngineAPIMethod
$boxes[] = id(new PHUIObjectBoxView()) $boxes[] = id(new PHUIObjectBoxView())
->setHeaderText(pht('Transaction Type: %s', $type->getEditType())) ->setHeaderText(pht('Transaction Type: %s', $type->getEditType()))
->setCollapsed(true) ->setCollapsed(true)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($this->buildRemarkup($section)) ->appendChild($this->buildRemarkup($section))
->appendChild($type_table); ->appendChild($type_table);
} }