From c1a4b102cc21fc43bcc7d8e3f44fd42eb2ce60ae Mon Sep 17 00:00:00 2001 From: epriestley Date: Sat, 24 May 2014 12:54:56 -0700 Subject: [PATCH] Order projects near the top of results Summary: Reorder main search typehaead as Jump, Apps, Prjoects, Users, Symbols instead of having projects at the bottom. Ref T5176. Test Plan: {F159689} Reviewers: btrahan, chad Reviewed By: chad Subscribers: epriestley Maniphest Tasks: T5176 Differential Revision: https://secure.phabricator.com/D9283 --- resources/celerity/map.php | 26 +++++++++---------- ...torTypeaheadCommonDatasourceController.php | 1 + .../rsrc/js/core/behavior-search-typeahead.js | 5 ++-- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 73f43d82cd..3e0eeef667 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -8,7 +8,7 @@ return array( 'names' => array( 'core.pkg.css' => '0d0b7e0c', - 'core.pkg.js' => 'e01fd8e2', + 'core.pkg.js' => '7db41c19', 'darkconsole.pkg.js' => 'ca8671ce', 'differential.pkg.css' => 'fbf57382', 'differential.pkg.js' => 'f4c86691', @@ -470,7 +470,7 @@ return array( 'rsrc/js/core/behavior-refresh-csrf.js' => '7814b593', 'rsrc/js/core/behavior-remarkup-preview.js' => 'f7379f45', 'rsrc/js/core/behavior-reveal-content.js' => '8f24abfc', - 'rsrc/js/core/behavior-search-typeahead.js' => 'd8469741', + 'rsrc/js/core/behavior-search-typeahead.js' => '86549ee3', 'rsrc/js/core/behavior-select-on-click.js' => '0e34ca02', 'rsrc/js/core/behavior-toggle-class.js' => 'a82a7769', 'rsrc/js/core/behavior-tokenizer.js' => 'b3a4b884', @@ -609,7 +609,7 @@ return array( 'javelin-behavior-phabricator-oncopy' => 'c3e218fe', 'javelin-behavior-phabricator-remarkup-assist' => 'c021950a', 'javelin-behavior-phabricator-reveal-content' => '8f24abfc', - 'javelin-behavior-phabricator-search-typeahead' => 'd8469741', + 'javelin-behavior-phabricator-search-typeahead' => '86549ee3', 'javelin-behavior-phabricator-show-all-transactions' => '7c273581', 'javelin-behavior-phabricator-tooltips' => '48db4145', 'javelin-behavior-phabricator-transaction-comment-form' => '9084a36f', @@ -1455,6 +1455,16 @@ return array( 1 => 'javelin-dom', 2 => 'javelin-reactor-dom', ), + '86549ee3' => + array( + 0 => 'javelin-behavior', + 1 => 'javelin-typeahead-ondemand-source', + 2 => 'javelin-typeahead', + 3 => 'javelin-dom', + 4 => 'javelin-uri', + 5 => 'javelin-util', + 6 => 'javelin-stratcom', + ), '889c96f3' => array( 0 => 'javelin-behavior', @@ -1855,16 +1865,6 @@ return array( 3 => 'javelin-dom', 4 => 'phabricator-keyboard-shortcut', ), - 'd8469741' => - array( - 0 => 'javelin-behavior', - 1 => 'javelin-typeahead-ondemand-source', - 2 => 'javelin-typeahead', - 3 => 'javelin-dom', - 4 => 'javelin-uri', - 5 => 'javelin-util', - 6 => 'javelin-stratcom', - ), 'd8e135db' => array( 0 => 'javelin-behavior', diff --git a/src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php b/src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php index 5d2b22dd76..7122222155 100644 --- a/src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php +++ b/src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php @@ -289,6 +289,7 @@ final class PhabricatorTypeaheadCommonDatasourceController ->setURI('/project/view/'.$proj->getID().'/') ->setPHID($proj->getPHID()) ->setIcon($proj->getIcon().' bluegrey') + ->setPriorityType('proj') ->setClosed($closed); $proj_result->setImageURI($proj->getProfileImageURI()); diff --git a/webroot/rsrc/js/core/behavior-search-typeahead.js b/webroot/rsrc/js/core/behavior-search-typeahead.js index 59fd3d381b..2b5fa4c66c 100644 --- a/webroot/rsrc/js/core/behavior-search-typeahead.js +++ b/webroot/rsrc/js/core/behavior-search-typeahead.js @@ -53,8 +53,9 @@ JX.behavior('phabricator-search-typeahead', function(config) { var type_priority = { 'jump' : 1, 'apps' : 2, - 'user' : 3, - 'symb' : 4 + 'proj' : 3, + 'user' : 4, + 'symb' : 5 }; var tokens = this.tokenize(value);