1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 14:00:56 +01:00

Make JumpNav work with Paste

Summary: Fixes T2336

Test Plan: Searched for Pastes successfully.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2336

Differential Revision: https://secure.phabricator.com/D4521
This commit is contained in:
Debarghya Das 2013-01-18 15:54:53 -08:00 committed by epriestley
parent 760ab135eb
commit ed2c050bd5
2 changed files with 6 additions and 0 deletions

View file

@ -72,7 +72,9 @@ final class PhabricatorDirectoryMainController
$jump = $request->getStr('jump'); $jump = $request->getStr('jump');
$response = PhabricatorJumpNavHandler::jumpPostResponse($jump); $response = PhabricatorJumpNavHandler::jumpPostResponse($jump);
if ($response) { if ($response) {
return $response; return $response;
} else if ($request->isFormPost()) { } else if ($request->isFormPost()) {
$query = new PhabricatorSearchQuery(); $query = new PhabricatorSearchQuery();

View file

@ -19,6 +19,7 @@ final class PhabricatorJumpNavHandler {
'/^r([A-Z]+)(\S+)$/' => 'commit', '/^r([A-Z]+)(\S+)$/' => 'commit',
'/^d(\d+)$/i' => 'revision', '/^d(\d+)$/i' => 'revision',
'/^t(\d+)$/i' => 'task', '/^t(\d+)$/i' => 'task',
'/^p(\d+)$/i' => 'paste',
'/^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',
@ -49,6 +50,9 @@ final class PhabricatorJumpNavHandler {
case 'user': case 'user':
return id(new AphrontRedirectResponse()) return id(new AphrontRedirectResponse())
->setURI('/p/'.$matches[1].'/'); ->setURI('/p/'.$matches[1].'/');
case 'paste':
return id(new AphrontRedirectResponse())
->setURI('/P'.$matches[1]);
case 'project': case 'project':
$project = self::findCloselyNamedProject($matches[1]); $project = self::findCloselyNamedProject($matches[1]);
if ($project) { if ($project) {