@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Search repos by Project

Summary:
Ref T3102

In diffusion, add "In Any Project" to search options.

Test Plan: use it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Maniphest Tasks: T3102

Differential Revision: https://secure.phabricator.com/D8113

authored by

Aviv Eyal and committed by
epriestley
5d1489a3 73924dfa

+41
+19
src/applications/repository/query/PhabricatorRepositoryQuery.php
··· 10 10 private $uuids; 11 11 private $nameContains; 12 12 private $remoteURIs; 13 + private $anyProjectPHIDs; 13 14 14 15 const STATUS_OPEN = 'status-open'; 15 16 const STATUS_CLOSED = 'status-closed'; ··· 73 74 74 75 public function withRemoteURIs(array $uris) { 75 76 $this->remoteURIs = $uris; 77 + return $this; 78 + } 79 + 80 + public function withAnyProjects(array $projects) { 81 + $this->anyProjectPHIDs = $projects; 76 82 return $this; 77 83 } 78 84 ··· 350 356 PhabricatorRepository::TABLE_SUMMARY); 351 357 } 352 358 359 + if ($this->anyProjectPHIDs) { 360 + $joins[] = qsprintf( 361 + $conn_r, 362 + 'JOIN edge e ON e.src = r.phid'); 363 + } 364 + 353 365 return implode(' ', $joins); 354 366 } 355 367 ··· 396 408 $conn_r, 397 409 'name LIKE %~', 398 410 $this->nameContains); 411 + } 412 + 413 + if ($this->anyProjectPHIDs) { 414 + $where[] = qsprintf( 415 + $conn_r, 416 + 'e.dst IN (%Ls)', 417 + $this->anyProjectPHIDs); 399 418 } 400 419 401 420 $where[] = $this->buildPagingClause($conn_r);
+22
src/applications/repository/query/PhabricatorRepositorySearchEngine.php
··· 12 12 $saved->setParameter('hosted', $request->getStr('hosted')); 13 13 $saved->setParameter('types', $request->getArr('types')); 14 14 $saved->setParameter('name', $request->getStr('name')); 15 + $saved->setParameter('anyProjectPHIDs', $request->getArr('anyProjects')); 15 16 16 17 return $saved; 17 18 } ··· 57 58 $query->withNameContains($name); 58 59 } 59 60 61 + $any_project_phids = $saved->getParameter('anyProjectPHIDs'); 62 + if ($any_project_phids) { 63 + $query->withAnyProjects($any_project_phids); 64 + } 65 + 60 66 return $query; 61 67 } 62 68 ··· 68 74 $types = $saved_query->getParameter('types', array()); 69 75 $types = array_fuse($types); 70 76 $name = $saved_query->getParameter('name'); 77 + $any_project_phids = $saved_query->getParameter('anyProjectPHIDs', array()); 78 + 79 + if ($any_project_phids) { 80 + $any_project_handles = id(new PhabricatorHandleQuery()) 81 + ->setViewer($this->requireViewer()) 82 + ->withPHIDs($any_project_phids) 83 + ->execute(); 84 + } else { 85 + $any_project_handles = array(); 86 + } 71 87 72 88 $form 73 89 ->appendChild( ··· 80 96 ->setName('name') 81 97 ->setLabel(pht('Name Contains')) 82 98 ->setValue($name)) 99 + ->appendChild( 100 + id(new AphrontFormTokenizerControl()) 101 + ->setDatasource('/typeahead/common/projects/') 102 + ->setName('anyProjects') 103 + ->setLabel(pht('In Any Project')) 104 + ->setValue($any_project_handles)) 83 105 ->appendChild( 84 106 id(new AphrontFormSelectControl()) 85 107 ->setName('status')