1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-02 02:40:58 +01:00

Add "Subscribers" to Maniphest application search

Summary: Fixes T3883. This is already supported in the query, expose it in the UI.

Test Plan: Ran some queries with and without subscribers.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3883

Differential Revision: https://secure.phabricator.com/D7161
This commit is contained in:
epriestley 2013-09-27 16:02:08 -07:00
parent 9c432545e4
commit b4cc990647

View file

@ -20,6 +20,10 @@ final class ManiphestTaskSearchEngine
'authorPHIDs', 'authorPHIDs',
$this->readUsersFromRequest($request, 'authors')); $this->readUsersFromRequest($request, 'authors'));
$saved->setParameter(
'subscriberPHIDs',
$this->readUsersFromRequest($request, 'subscribers'));
$saved->setParameter('statuses', $request->getArr('statuses')); $saved->setParameter('statuses', $request->getArr('statuses'));
$saved->setParameter('priorities', $request->getArr('priorities')); $saved->setParameter('priorities', $request->getArr('priorities'));
$saved->setParameter('group', $request->getStr('group')); $saved->setParameter('group', $request->getStr('group'));
@ -79,6 +83,11 @@ final class ManiphestTaskSearchEngine
$query->withAuthors($author_phids); $query->withAuthors($author_phids);
} }
$subscriber_phids = $saved->getParameter('subscriberPHIDs');
if ($subscriber_phids) {
$query->withSubscribers($subscriber_phids);
}
$with_unassigned = $saved->getParameter('withUnassigned'); $with_unassigned = $saved->getParameter('withUnassigned');
if ($with_unassigned) { if ($with_unassigned) {
$query->withOwners(array(null)); $query->withOwners(array(null));
@ -184,6 +193,7 @@ final class ManiphestTaskSearchEngine
$user_project_phids = $saved->getParameter( $user_project_phids = $saved->getParameter(
'userProjectPHIDs', 'userProjectPHIDs',
array()); array());
$subscriber_phids = $saved->getParameter('subscriberPHIDs', array());
$all_phids = array_merge( $all_phids = array_merge(
$assigned_phids, $assigned_phids,
@ -191,7 +201,8 @@ final class ManiphestTaskSearchEngine
$all_project_phids, $all_project_phids,
$any_project_phids, $any_project_phids,
$exclude_project_phids, $exclude_project_phids,
$user_project_phids); $user_project_phids,
$subscriber_phids);
if ($all_phids) { if ($all_phids) {
$handles = id(new PhabricatorHandleQuery()) $handles = id(new PhabricatorHandleQuery())
@ -210,6 +221,7 @@ final class ManiphestTaskSearchEngine
$handles, $handles,
$exclude_project_phids); $exclude_project_phids);
$user_project_handles = array_select_keys($handles, $user_project_phids); $user_project_handles = array_select_keys($handles, $user_project_phids);
$subscriber_handles = array_select_keys($handles, $subscriber_phids);
$with_unassigned = $saved->getParameter('withUnassigned'); $with_unassigned = $saved->getParameter('withUnassigned');
$with_no_projects = $saved->getParameter('withNoProject'); $with_no_projects = $saved->getParameter('withNoProject');
@ -291,6 +303,12 @@ final class ManiphestTaskSearchEngine
->setName('authors') ->setName('authors')
->setLabel(pht('Authors')) ->setLabel(pht('Authors'))
->setValue($author_handles)) ->setValue($author_handles))
->appendChild(
id(new AphrontFormTokenizerControl())
->setDatasource('/typeahead/common/accounts/')
->setName('subscribers')
->setLabel(pht('Subscribers'))
->setValue($subscriber_handles))
->appendChild($status_control) ->appendChild($status_control)
->appendChild($priority_control) ->appendChild($priority_control)
->appendChild( ->appendChild(