@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.

Allow users to seach for projects by watcher

Summary:
Ref T10349. This capability didn't make a ton of sense when you had to be a member to watch a project and watch rules were simple, but makes more sense now.

A particular use case might be finding all the stuff you're watching so you can prune it.

Test Plan: Searched for stuff I was watching, got accurate results.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10349

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

+30 -1
+22 -1
src/applications/project/query/PhabricatorProjectQuery.php
··· 6 6 private $ids; 7 7 private $phids; 8 8 private $memberPHIDs; 9 + private $watcherPHIDs; 9 10 private $slugs; 10 11 private $slugNormals; 11 12 private $slugMap; ··· 59 60 60 61 public function withMemberPHIDs(array $member_phids) { 61 62 $this->memberPHIDs = $member_phids; 63 + return $this; 64 + } 65 + 66 + public function withWatcherPHIDs(array $watcher_phids) { 67 + $this->watcherPHIDs = $watcher_phids; 62 68 return $this; 63 69 } 64 70 ··· 436 442 $this->memberPHIDs); 437 443 } 438 444 445 + if ($this->watcherPHIDs !== null) { 446 + $where[] = qsprintf( 447 + $conn, 448 + 'w.dst IN (%Ls)', 449 + $this->watcherPHIDs); 450 + } 451 + 439 452 if ($this->slugs !== null) { 440 453 $where[] = qsprintf( 441 454 $conn, ··· 549 562 } 550 563 551 564 protected function shouldGroupQueryResultRows() { 552 - if ($this->memberPHIDs || $this->nameTokens) { 565 + if ($this->memberPHIDs || $this->watcherPHIDs || $this->nameTokens) { 553 566 return true; 554 567 } 555 568 return parent::shouldGroupQueryResultRows(); ··· 564 577 'JOIN %T e ON e.src = p.phid AND e.type = %d', 565 578 PhabricatorEdgeConfig::TABLE_NAME_EDGE, 566 579 PhabricatorProjectMaterializedMemberEdgeType::EDGECONST); 580 + } 581 + 582 + if ($this->watcherPHIDs !== null) { 583 + $joins[] = qsprintf( 584 + $conn, 585 + 'JOIN %T w ON w.src = p.phid AND w.type = %d', 586 + PhabricatorEdgeConfig::TABLE_NAME_EDGE, 587 + PhabricatorObjectHasWatcherEdgeType::EDGECONST); 567 588 } 568 589 569 590 if ($this->slugs !== null) {
+8
src/applications/project/query/PhabricatorProjectSearchEngine.php
··· 26 26 ->setLabel(pht('Members')) 27 27 ->setKey('memberPHIDs') 28 28 ->setAliases(array('member', 'members')), 29 + id(new PhabricatorUsersSearchField()) 30 + ->setLabel(pht('Watchers')) 31 + ->setKey('watcherPHIDs') 32 + ->setAliases(array('watcher', 'watchers')), 29 33 id(new PhabricatorSearchSelectField()) 30 34 ->setLabel(pht('Status')) 31 35 ->setKey('status') ··· 52 56 53 57 if ($map['memberPHIDs']) { 54 58 $query->withMemberPHIDs($map['memberPHIDs']); 59 + } 60 + 61 + if ($map['watcherPHIDs']) { 62 + $query->withWatcherPHIDs($map['watcherPHIDs']); 55 63 } 56 64 57 65 if ($map['status']) {