diff --git a/resources/celerity/map.php b/resources/celerity/map.php --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -8,7 +8,7 @@ return array( 'names' => array( 'core.pkg.css' => '1eed0b4f', - 'core.pkg.js' => '57dff7df', + 'core.pkg.js' => '6ae03393', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => '2de124c9', 'differential.pkg.js' => '64e69521', @@ -492,7 +492,7 @@ 'rsrc/js/core/behavior-reorder-applications.js' => '76b9fc3e', 'rsrc/js/core/behavior-reveal-content.js' => '60821bc7', 'rsrc/js/core/behavior-scrollbar.js' => '834a1173', - 'rsrc/js/core/behavior-search-typeahead.js' => '048330fa', + 'rsrc/js/core/behavior-search-typeahead.js' => '0b7a4f6e', 'rsrc/js/core/behavior-select-on-click.js' => '4e3e79a6', 'rsrc/js/core/behavior-time-typeahead.js' => 'f80d6bf0', 'rsrc/js/core/behavior-toggle-class.js' => '5d7c9f33', @@ -640,7 +640,7 @@ 'javelin-behavior-phabricator-oncopy' => '2926fff2', 'javelin-behavior-phabricator-remarkup-assist' => 'b60b6d9b', 'javelin-behavior-phabricator-reveal-content' => '60821bc7', - 'javelin-behavior-phabricator-search-typeahead' => '048330fa', + 'javelin-behavior-phabricator-search-typeahead' => '0b7a4f6e', 'javelin-behavior-phabricator-show-older-transactions' => 'dbbf48b6', 'javelin-behavior-phabricator-tooltips' => '3ee3408b', 'javelin-behavior-phabricator-transaction-comment-form' => 'b23b49e6', @@ -878,16 +878,6 @@ 'javelin-behavior-device', 'phabricator-title', ), - '048330fa' => array( - 'javelin-behavior', - 'javelin-typeahead-ondemand-source', - 'javelin-typeahead', - 'javelin-dom', - 'javelin-uri', - 'javelin-util', - 'javelin-stratcom', - 'phabricator-prefab', - ), '05270951' => array( 'javelin-util', 'javelin-magical-init', @@ -915,6 +905,16 @@ 'javelin-dom', 'javelin-router', ), + '0b7a4f6e' => array( + 'javelin-behavior', + 'javelin-typeahead-ondemand-source', + 'javelin-typeahead', + 'javelin-dom', + 'javelin-uri', + 'javelin-util', + 'javelin-stratcom', + 'phabricator-prefab', + ), '0f764c35' => array( 'javelin-install', 'javelin-util', diff --git a/src/applications/diffusion/typeahead/DiffusionRepositoryDatasource.php b/src/applications/diffusion/typeahead/DiffusionRepositoryDatasource.php --- a/src/applications/diffusion/typeahead/DiffusionRepositoryDatasource.php +++ b/src/applications/diffusion/typeahead/DiffusionRepositoryDatasource.php @@ -24,13 +24,31 @@ ->withDatasourceQuery($raw_query); $repos = $this->executeQuery($query); + $type_icon = id(new PhabricatorRepositoryRepositoryPHIDType()) + ->getTypeIcon(); + + $image_sprite = + "phabricator-search-icon phui-font-fa phui-icon-view {$type_icon}"; + $results = array(); foreach ($repos as $repo) { + $display_name = $repo->getMonogram().' '.$repo->getName(); + + $name = $display_name; + $slug = $repo->getRepositorySlug(); + if (strlen($slug)) { + $name = "{$name} {$slug}"; + } + $results[] = id(new PhabricatorTypeaheadResult()) - ->setName($repo->getMonogram().' '.$repo->getName()) + ->setName($name) + ->setDisplayName($display_name) ->setURI($repo->getURI()) ->setPHID($repo->getPHID()) - ->setPriorityString($repo->getMonogram()); + ->setPriorityString($repo->getMonogram()) + ->setPriorityType('repo') + ->setImageSprite($image_sprite) + ->setDisplayType(pht('Repository')); } return $results; diff --git a/src/applications/repository/phid/PhabricatorRepositoryRepositoryPHIDType.php b/src/applications/repository/phid/PhabricatorRepositoryRepositoryPHIDType.php --- a/src/applications/repository/phid/PhabricatorRepositoryRepositoryPHIDType.php +++ b/src/applications/repository/phid/PhabricatorRepositoryRepositoryPHIDType.php @@ -10,7 +10,7 @@ } public function getTypeIcon() { - return 'fa-database'; + return 'fa-code'; } public function newObject() { diff --git a/src/applications/repository/query/PhabricatorRepositoryQuery.php b/src/applications/repository/query/PhabricatorRepositoryQuery.php --- a/src/applications/repository/query/PhabricatorRepositoryQuery.php +++ b/src/applications/repository/query/PhabricatorRepositoryQuery.php @@ -606,9 +606,10 @@ } $where[] = qsprintf( $conn, - 'r.name LIKE %> OR r.callsign LIKE %>', + 'r.name LIKE %> OR r.callsign LIKE %> OR r.repositorySlug LIKE %>', $query, - $callsign); + $callsign, + $query); } if ($this->slugs !== null) { diff --git a/src/applications/search/typeahead/PhabricatorSearchDatasource.php b/src/applications/search/typeahead/PhabricatorSearchDatasource.php --- a/src/applications/search/typeahead/PhabricatorSearchDatasource.php +++ b/src/applications/search/typeahead/PhabricatorSearchDatasource.php @@ -21,6 +21,7 @@ new PhabricatorProjectDatasource(), new PhabricatorApplicationDatasource(), new PhabricatorTypeaheadMonogramDatasource(), + new DiffusionRepositoryDatasource(), new DiffusionSymbolDatasource(), ); } diff --git a/webroot/rsrc/js/core/behavior-search-typeahead.js b/webroot/rsrc/js/core/behavior-search-typeahead.js --- a/webroot/rsrc/js/core/behavior-search-typeahead.js +++ b/webroot/rsrc/js/core/behavior-search-typeahead.js @@ -54,7 +54,8 @@ 'apps' : 2, 'proj' : 3, 'user' : 4, - 'symb' : 5 + 'repo' : 5, + 'symb' : 6 }; var tokens = this.tokenize(value);