mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 22:10:55 +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:
parent
760ab135eb
commit
ed2c050bd5
2 changed files with 6 additions and 0 deletions
|
@ -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();
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue