mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-31 06:28:13 +02: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:
parent
b170d1c15f
commit
a6ec787df5
2 changed files with 12 additions and 19 deletions
src
|
@ -4,22 +4,20 @@ final class PhabricatorJumpNavHandler {
|
||||||
|
|
||||||
public static function getJumpResponse(PhabricatorUser $viewer, $jump) {
|
public static function getJumpResponse(PhabricatorUser $viewer, $jump) {
|
||||||
$jump = trim($jump);
|
$jump = trim($jump);
|
||||||
$help_href = PhabricatorEnv::getDocLink('Jump Nav User Guide');
|
|
||||||
|
|
||||||
$patterns = array(
|
$patterns = array(
|
||||||
'/^help/i' => 'exturi:'.$help_href,
|
'/^a$/i' => 'uri:/audit/',
|
||||||
'/^a$/i' => 'uri:/audit/',
|
'/^f$/i' => 'uri:/feed/',
|
||||||
'/^f$/i' => 'uri:/feed/',
|
'/^d$/i' => 'uri:/differential/',
|
||||||
'/^d$/i' => 'uri:/differential/',
|
'/^r$/i' => 'uri:/diffusion/',
|
||||||
'/^r$/i' => 'uri:/diffusion/',
|
'/^t$/i' => 'uri:/maniphest/',
|
||||||
'/^t$/i' => 'uri:/maniphest/',
|
'/^p$/i' => 'uri:/project/',
|
||||||
'/^p$/i' => 'uri:/project/',
|
'/^u$/i' => 'uri:/people/',
|
||||||
'/^u$/i' => 'uri:/people/',
|
'/^p\s+(.+)$/i' => 'project',
|
||||||
'/^p\s+(.+)$/i' => 'project',
|
'/^u\s+(\S+)$/i' => 'user',
|
||||||
'/^u\s+(\S+)$/i' => 'user',
|
'/^task:\s*(.+)/i' => 'create-task',
|
||||||
'/^task:\s*(.+)/i' => 'create-task',
|
'/^(?:s)\s+(\S+)/i' => 'find-symbol',
|
||||||
'/^(?:s|symbol)\s+(\S+)/i' => 'find-symbol',
|
'/^r\s+(.+)$/i' => 'find-repository',
|
||||||
'/^r\s+(.+)$/i' => 'find-repository',
|
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($patterns as $pattern => $effect) {
|
foreach ($patterns as $pattern => $effect) {
|
||||||
|
@ -28,10 +26,6 @@ final class PhabricatorJumpNavHandler {
|
||||||
if (!strncmp($effect, 'uri:', 4)) {
|
if (!strncmp($effect, 'uri:', 4)) {
|
||||||
return id(new AphrontRedirectResponse())
|
return id(new AphrontRedirectResponse())
|
||||||
->setURI(substr($effect, 4));
|
->setURI(substr($effect, 4));
|
||||||
} else if (!strncmp($effect, 'exturi:', 7)) {
|
|
||||||
return id(new AphrontRedirectResponse())
|
|
||||||
->setURI(substr($effect, 7))
|
|
||||||
->setIsExternal(true);
|
|
||||||
} else {
|
} else {
|
||||||
switch ($effect) {
|
switch ($effect) {
|
||||||
case 'user':
|
case 'user':
|
||||||
|
|
|
@ -10,7 +10,6 @@ a navigational command into the box and press return.
|
||||||
|
|
||||||
= Supported Commands =
|
= Supported Commands =
|
||||||
|
|
||||||
- **help** - Jump to this document.
|
|
||||||
- **T** - Jump to Maniphest.
|
- **T** - Jump to Maniphest.
|
||||||
- **T123** - Jump to Maniphest Task 123.
|
- **T123** - Jump to Maniphest Task 123.
|
||||||
- **D** - Jump to Differential.
|
- **D** - Jump to Differential.
|
||||||
|
|
Loading…
Add table
Reference in a new issue