From 968a75b5792c5f9aab3644ad93a64b138696c13c Mon Sep 17 00:00:00 2001 From: Chad Little Date: Mon, 4 Apr 2016 12:37:32 -0700 Subject: [PATCH] Update typeahead for new UI Summary: Uses modern UI, `newPage`, etc. Changes table behavior to always scroll if too large for container, can't find anything this breaks, but be on the lookout. Test Plan: Pull up help and view pages, search for some people and projects. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D15611 --- resources/celerity/map.php | 6 +++--- ...ricatorTypeaheadFunctionHelpController.php | 15 ++++++-------- ...orTypeaheadModularDatasourceController.php | 20 +++++++++++++------ webroot/rsrc/css/aphront/table-view.css | 3 +-- 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 2b6873c89d..930a2e5b41 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,7 +7,7 @@ */ return array( 'names' => array( - 'core.pkg.css' => '5de0f7af', + 'core.pkg.css' => 'a3016dac', 'core.pkg.js' => 'e5484f37', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => '7ba78475', @@ -25,7 +25,7 @@ return array( 'rsrc/css/aphront/notification.css' => '7f684b62', 'rsrc/css/aphront/panel-view.css' => '8427b78d', 'rsrc/css/aphront/phabricator-nav-view.css' => 'ac79a758', - 'rsrc/css/aphront/table-view.css' => '036b6cdc', + 'rsrc/css/aphront/table-view.css' => '9258e19f', 'rsrc/css/aphront/tokenizer.css' => '056da01b', 'rsrc/css/aphront/tooltip.css' => '1a07aea8', 'rsrc/css/aphront/typeahead-browse.css' => 'd8581d2c', @@ -526,7 +526,7 @@ return array( 'aphront-list-filter-view-css' => '5d6f0526', 'aphront-multi-column-view-css' => 'fd18389d', 'aphront-panel-view-css' => '8427b78d', - 'aphront-table-view-css' => '036b6cdc', + 'aphront-table-view-css' => '9258e19f', 'aphront-tokenizer-control-css' => '056da01b', 'aphront-tooltip-css' => '1a07aea8', 'aphront-typeahead-control-css' => 'd4f16145', diff --git a/src/applications/typeahead/controller/PhabricatorTypeaheadFunctionHelpController.php b/src/applications/typeahead/controller/PhabricatorTypeaheadFunctionHelpController.php index a771bf0747..3084b2d434 100644 --- a/src/applications/typeahead/controller/PhabricatorTypeaheadFunctionHelpController.php +++ b/src/applications/typeahead/controller/PhabricatorTypeaheadFunctionHelpController.php @@ -126,21 +126,18 @@ final class PhabricatorTypeaheadFunctionHelpController $header = id(new PHUIHeaderView()) ->setHeader($title); - $document = id(new PHUIDocumentView()) + $document = id(new PHUIDocumentViewPro()) ->setHeader($header) ->appendChild($content_box); $crumbs = $this->buildApplicationCrumbs(); $crumbs->addTextCrumb(pht('Function Help')); + $crumbs->setBorder(true); - return $this->buildApplicationPage( - array( - $crumbs, - $document, - ), - array( - 'title' => $title, - )); + return $this->newPage() + ->setTitle($title) + ->setCrumbs($crumbs) + ->appendChild($document); } } diff --git a/src/applications/typeahead/controller/PhabricatorTypeaheadModularDatasourceController.php b/src/applications/typeahead/controller/PhabricatorTypeaheadModularDatasourceController.php index b3687b85e8..15650a33fd 100644 --- a/src/applications/typeahead/controller/PhabricatorTypeaheadModularDatasourceController.php +++ b/src/applications/typeahead/controller/PhabricatorTypeaheadModularDatasourceController.php @@ -309,6 +309,7 @@ final class PhabricatorTypeaheadModularDatasourceController $form_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Token Query')) + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->setForm($form); $table = new AphrontTableView($content); @@ -329,17 +330,24 @@ final class PhabricatorTypeaheadModularDatasourceController $result_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Token Results (%s)', $class)) + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->appendChild($table); - return $this->buildApplicationPage( - array( + $title = pht('Typeahead Results'); + + $header = id(new PHUIHeaderView()) + ->setHeader($title); + + $view = id(new PHUITwoColumnView()) + ->setHeader($header) + ->setFooter(array( $form_box, $result_box, - ), - array( - 'title' => pht('Typeahead Results'), - 'device' => false, )); + + return $this->newPage() + ->setTitle($title) + ->appendChild($view); } } diff --git a/webroot/rsrc/css/aphront/table-view.css b/webroot/rsrc/css/aphront/table-view.css index b2efc8c3c0..af304c930a 100644 --- a/webroot/rsrc/css/aphront/table-view.css +++ b/webroot/rsrc/css/aphront/table-view.css @@ -2,8 +2,7 @@ * @provides aphront-table-view-css */ -.device-phone .aphront-table-wrap, -.device-tablet .aphront-table-wrap { +.aphront-table-wrap { overflow-x: auto; }