From 607f4bfab8d188ac41d5025451fb059da8069880 Mon Sep 17 00:00:00 2001 From: lkassianik Date: Mon, 26 May 2014 11:15:28 -0700 Subject: [PATCH] Remove dedicated "Jump Nav" navigation element Summary: Fixes T5175. Not sure if I cleaned out everything, but this seemed like a reasonable first pass. Attempted to delete all code that belonged to Jump Nav feature only. Test Plan: Open phabricator homepage, verify Jump Nav element is gone, verify the Search bar still autocompletes and jumps to shortcuts. Reviewers: chad, epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Maniphest Tasks: T5175 Differential Revision: https://secure.phabricator.com/D9301 --- resources/celerity/map.php | 83 ++++++++-------- resources/celerity/packages.php | 2 - .../PhabricatorHomeMainController.php | 95 ------------------- .../directory/phabricator-jump-nav.css | 25 ----- 4 files changed, 40 insertions(+), 165 deletions(-) delete mode 100644 webroot/rsrc/css/application/directory/phabricator-jump-nav.css diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 3e0eeef667..86fc00d4ce 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,7 +7,7 @@ return array( 'names' => array( - 'core.pkg.css' => '0d0b7e0c', + 'core.pkg.css' => 'c404fb89', 'core.pkg.js' => '7db41c19', 'darkconsole.pkg.js' => 'ca8671ce', 'differential.pkg.css' => 'fbf57382', @@ -64,7 +64,6 @@ return array( 'rsrc/css/application/diffusion/commit-view.css' => '92d1e8f9', 'rsrc/css/application/diffusion/diffusion-icons.css' => '384a0f7d', 'rsrc/css/application/diffusion/diffusion-source.css' => '66fdf661', - 'rsrc/css/application/directory/phabricator-jump-nav.css' => 'f0c5e726', 'rsrc/css/application/feed/feed.css' => 'dd43ce00', 'rsrc/css/application/files/global-drag-and-drop.css' => '697324ad', 'rsrc/css/application/flag/flag.css' => '5337623f', @@ -707,7 +706,6 @@ return array( 'phabricator-flag-css' => '5337623f', 'phabricator-hovercard' => '4f344388', 'phabricator-hovercard-view-css' => '46a13cf0', - 'phabricator-jump-nav' => 'f0c5e726', 'phabricator-keyboard-shortcut' => '1ae869f2', 'phabricator-keyboard-shortcut-manager' => 'ad7a69ca', 'phabricator-main-menu-view' => '0207239c', @@ -2114,46 +2112,45 @@ return array( 8 => 'aphront-tokenizer-control-css', 9 => 'aphront-typeahead-control-css', 10 => 'aphront-list-filter-view-css', - 11 => 'phabricator-jump-nav', - 12 => 'phabricator-remarkup-css', - 13 => 'syntax-highlighting-css', - 14 => 'aphront-pager-view-css', - 15 => 'phabricator-transaction-view-css', - 16 => 'aphront-tooltip-css', - 17 => 'phabricator-flag-css', - 18 => 'aphront-error-view-css', - 19 => 'sprite-remarkup-css', - 20 => 'sprite-gradient-css', - 21 => 'sprite-menu-css', - 22 => 'sprite-apps-large-css', - 23 => 'phabricator-main-menu-view', - 24 => 'phabricator-notification-css', - 25 => 'phabricator-notification-menu-css', - 26 => 'lightbox-attachment-css', - 27 => 'phui-header-view-css', - 28 => 'phabricator-filetree-view-css', - 29 => 'phabricator-nav-view-css', - 30 => 'phabricator-side-menu-view-css', - 31 => 'phabricator-crumbs-view-css', - 32 => 'phui-object-item-list-view-css', - 33 => 'global-drag-and-drop-css', - 34 => 'phui-spacing-css', - 35 => 'phui-form-css', - 36 => 'phui-icon-view-css', - 37 => 'phabricator-application-launch-view-css', - 38 => 'phabricator-action-list-view-css', - 39 => 'phui-property-list-view-css', - 40 => 'phui-tag-view-css', - 41 => 'phui-list-view-css', - 42 => 'font-fontawesome', - 43 => 'phui-font-icon-base-css', - 44 => 'sprite-main-header-css', - 45 => 'phui-box-css', - 46 => 'phui-object-box-css', - 47 => 'phui-timeline-view-css', - 48 => 'sprite-tokens-css', - 49 => 'tokens-css', - 50 => 'phui-status-list-view-css', + 11 => 'phabricator-remarkup-css', + 12 => 'syntax-highlighting-css', + 13 => 'aphront-pager-view-css', + 14 => 'phabricator-transaction-view-css', + 15 => 'aphront-tooltip-css', + 16 => 'phabricator-flag-css', + 17 => 'aphront-error-view-css', + 18 => 'sprite-remarkup-css', + 19 => 'sprite-gradient-css', + 20 => 'sprite-menu-css', + 21 => 'sprite-apps-large-css', + 22 => 'phabricator-main-menu-view', + 23 => 'phabricator-notification-css', + 24 => 'phabricator-notification-menu-css', + 25 => 'lightbox-attachment-css', + 26 => 'phui-header-view-css', + 27 => 'phabricator-filetree-view-css', + 28 => 'phabricator-nav-view-css', + 29 => 'phabricator-side-menu-view-css', + 30 => 'phabricator-crumbs-view-css', + 31 => 'phui-object-item-list-view-css', + 32 => 'global-drag-and-drop-css', + 33 => 'phui-spacing-css', + 34 => 'phui-form-css', + 35 => 'phui-icon-view-css', + 36 => 'phabricator-application-launch-view-css', + 37 => 'phabricator-action-list-view-css', + 38 => 'phui-property-list-view-css', + 39 => 'phui-tag-view-css', + 40 => 'phui-list-view-css', + 41 => 'font-fontawesome', + 42 => 'phui-font-icon-base-css', + 43 => 'sprite-main-header-css', + 44 => 'phui-box-css', + 45 => 'phui-object-box-css', + 46 => 'phui-timeline-view-css', + 47 => 'sprite-tokens-css', + 48 => 'tokens-css', + 49 => 'phui-status-list-view-css', ), 'core.pkg.js' => array( diff --git a/resources/celerity/packages.php b/resources/celerity/packages.php index 692099f2d5..e056c0c4ff 100644 --- a/resources/celerity/packages.php +++ b/resources/celerity/packages.php @@ -83,8 +83,6 @@ return array( 'aphront-typeahead-control-css', 'aphront-list-filter-view-css', - 'phabricator-jump-nav', - 'phabricator-remarkup-css', 'syntax-highlighting-css', 'aphront-pager-view-css', diff --git a/src/applications/home/controller/PhabricatorHomeMainController.php b/src/applications/home/controller/PhabricatorHomeMainController.php index adfad2863d..693695e300 100644 --- a/src/applications/home/controller/PhabricatorHomeMainController.php +++ b/src/applications/home/controller/PhabricatorHomeMainController.php @@ -16,10 +16,6 @@ final class PhabricatorHomeMainController public function processRequest() { $user = $this->getRequest()->getUser(); - - if ($this->filter == 'jump') { - return $this->buildJumpResponse(); - } $nav = $this->buildNav(); $dashboard = PhabricatorDashboardInstall::getDashboard( @@ -92,8 +88,6 @@ final class PhabricatorHomeMainController $welcome_panel = null; } - $jump_panel = $this->buildJumpPanel(); - if ($has_differential) { $revision_panel = $this->buildRevisionPanel(); } else { @@ -101,7 +95,6 @@ final class PhabricatorHomeMainController } $content = array( - $jump_panel, $welcome_panel, $unbreak_panel, $triage_panel, @@ -118,27 +111,6 @@ final class PhabricatorHomeMainController } - private function buildJumpResponse() { - $request = $this->getRequest(); - $jump = $request->getStr('jump'); - - $response = PhabricatorJumpNavHandler::getJumpResponse( - $request->getUser(), - $jump); - - if ($response) { - return $response; - } else if ($request->isFormPost()) { - $uri = new PhutilURI('/search/'); - $uri->setQueryParam('query', $jump); - $uri->setQueryParam('search:primary', 'true'); - - return id(new AphrontRedirectResponse())->setURI((string)$uri); - } else { - return id(new AphrontRedirectResponse())->setURI('/'); - } - } - private function buildUnbreakNowPanel() { $unbreak_now = PhabricatorEnv::getEnvConfig( 'maniphest.priorities.unbreak-now'); @@ -330,73 +302,6 @@ final class PhabricatorHomeMainController return $view; } - private function buildJumpPanel($query=null) { - $request = $this->getRequest(); - $user = $request->getUser(); - - $uniq_id = celerity_generate_unique_node_id(); - - Javelin::initBehavior( - 'phabricator-autofocus', - array( - 'id' => $uniq_id, - )); - - require_celerity_resource('phabricator-jump-nav'); - - $doc_href = PhabricatorEnv::getDocLink('Jump Nav User Guide'); - $doc_link = phutil_tag( - 'a', - array( - 'href' => $doc_href, - ), - 'Jump Nav User Guide'); - - $jump_input = phutil_tag( - 'input', - array( - 'type' => 'text', - 'class' => 'phabricator-jump-nav', - 'name' => 'jump', - 'id' => $uniq_id, - 'value' => $query, - )); - $jump_caption = phutil_tag( - 'p', - array( - 'class' => 'phabricator-jump-nav-caption', - ), - hsprintf( - 'Enter the name of an object like D123 to quickly jump to '. - 'it. See %s or type help.', - $doc_link)); - - $form = phabricator_form( - $user, - array( - 'action' => '/jump/', - 'method' => 'POST', - 'class' => 'phabricator-jump-nav-form', - ), - array( - $jump_input, - $jump_caption, - )); - - $panel = new AphrontPanelView(); - $panel->setNoBackground(); - // $panel->appendChild(); - - $list_filter = new AphrontListFilterView(); - $list_filter->appendChild($form); - - $container = phutil_tag('div', - array('class' => 'phabricator-jump-nav-container'), - $list_filter); - - return $container; - } - private function renderSectionHeader($title, $href) { $header = phutil_tag( 'a', diff --git a/webroot/rsrc/css/application/directory/phabricator-jump-nav.css b/webroot/rsrc/css/application/directory/phabricator-jump-nav.css deleted file mode 100644 index fe06c4c973..0000000000 --- a/webroot/rsrc/css/application/directory/phabricator-jump-nav.css +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @provides phabricator-jump-nav - */ - -.phabricator-jump-nav-form { - text-align: center; - padding: 0px; - margin: 0; -} - -input.phabricator-jump-nav[type='text'] { - font-size: 16px; - width: 100%; -} - -.phabricator-jump-nav-caption { - margin-top: 4px; - font-size: 11px; - color: {$greytext}; - text-align: left; -} - -.phabricator-jump-nav-container form { - padding: 12px 16px; -}