1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 01:02:42 +01:00

Remove magic "help" in global search

Summary: Fixes T7425. Overall, this is surprising and confusing after jump nav was merged with global search.

Test Plan: Searched for "help", got documents matching the word "help".

Reviewers: chad, btrahan

Reviewed By: btrahan

Subscribers: chasemp, epriestley

Maniphest Tasks: T7425

Differential Revision: https://secure.phabricator.com/D11936
This commit is contained in:
epriestley 2015-03-02 14:32:08 -08:00
parent b170d1c15f
commit a6ec787df5
2 changed files with 12 additions and 19 deletions

View file

@ -4,22 +4,20 @@ final class PhabricatorJumpNavHandler {
public static function getJumpResponse(PhabricatorUser $viewer, $jump) {
$jump = trim($jump);
$help_href = PhabricatorEnv::getDocLink('Jump Nav User Guide');
$patterns = array(
'/^help/i' => 'exturi:'.$help_href,
'/^a$/i' => 'uri:/audit/',
'/^f$/i' => 'uri:/feed/',
'/^d$/i' => 'uri:/differential/',
'/^r$/i' => 'uri:/diffusion/',
'/^t$/i' => 'uri:/maniphest/',
'/^p$/i' => 'uri:/project/',
'/^u$/i' => 'uri:/people/',
'/^p\s+(.+)$/i' => 'project',
'/^u\s+(\S+)$/i' => 'user',
'/^task:\s*(.+)/i' => 'create-task',
'/^(?:s|symbol)\s+(\S+)/i' => 'find-symbol',
'/^r\s+(.+)$/i' => 'find-repository',
'/^a$/i' => 'uri:/audit/',
'/^f$/i' => 'uri:/feed/',
'/^d$/i' => 'uri:/differential/',
'/^r$/i' => 'uri:/diffusion/',
'/^t$/i' => 'uri:/maniphest/',
'/^p$/i' => 'uri:/project/',
'/^u$/i' => 'uri:/people/',
'/^p\s+(.+)$/i' => 'project',
'/^u\s+(\S+)$/i' => 'user',
'/^task:\s*(.+)/i' => 'create-task',
'/^(?:s)\s+(\S+)/i' => 'find-symbol',
'/^r\s+(.+)$/i' => 'find-repository',
);
foreach ($patterns as $pattern => $effect) {
@ -28,10 +26,6 @@ final class PhabricatorJumpNavHandler {
if (!strncmp($effect, 'uri:', 4)) {
return id(new AphrontRedirectResponse())
->setURI(substr($effect, 4));
} else if (!strncmp($effect, 'exturi:', 7)) {
return id(new AphrontRedirectResponse())
->setURI(substr($effect, 7))
->setIsExternal(true);
} else {
switch ($effect) {
case 'user':

View file

@ -10,7 +10,6 @@ a navigational command into the box and press return.
= Supported Commands =
- **help** - Jump to this document.
- **T** - Jump to Maniphest.
- **T123** - Jump to Maniphest Task 123.
- **D** - Jump to Differential.