From db631b423f417b45386d21323067c3392a75116f Mon Sep 17 00:00:00 2001 From: Chad Little Date: Sun, 14 May 2017 12:13:59 -0400 Subject: [PATCH] Add basic Watching filter to /projects/ Summary: Ref T12707. Adds a simple filter for the viewer if logged in. Test Plan: Watch a project, click on watching list, see project I'm watching. Reviewers: epriestley Reviewed By: epriestley Subscribers: epriestley Maniphest Tasks: T12707 Differential Revision: https://secure.phabricator.com/D17873 --- .../project/query/PhabricatorProjectSearchEngine.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/applications/project/query/PhabricatorProjectSearchEngine.php b/src/applications/project/query/PhabricatorProjectSearchEngine.php index 5c153be5a4..75c2045f50 100644 --- a/src/applications/project/query/PhabricatorProjectSearchEngine.php +++ b/src/applications/project/query/PhabricatorProjectSearchEngine.php @@ -128,6 +128,10 @@ final class PhabricatorProjectSearchEngine $names['joined'] = pht('Joined'); } + if ($this->requireViewer()->isLoggedIn()) { + $names['watching'] = pht('Watching'); + } + $names['active'] = pht('Active'); $names['all'] = pht('All'); @@ -153,6 +157,10 @@ final class PhabricatorProjectSearchEngine return $query ->setParameter('memberPHIDs', array($viewer_phid)) ->setParameter('status', 'active'); + case 'watching': + return $query + ->setParameter('watcherPHIDs', array($viewer_phid)) + ->setParameter('status', 'active'); } return parent::buildSavedQueryFromBuiltin($query_key);