mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Add "User Projects" Filter to Maniphest
Summary: - Adds "User Projects" filter to Maniphest. - The filter expands the user(s) specified into a set of projects and issues a query on that project set. - "View All Triage" button in Tactical Command's Needs Triage panel now points to User Projects-Need Triage filter. Test Plan: - User Projects filter correctly displays only the tasks in projects the specified users are involved in. Reviewers: epriestley Reviewed By: epriestley CC: keebuhm, ddfisher, allenjohnashton, epriestley, aran Differential Revision: https://secure.phabricator.com/D1901
This commit is contained in:
parent
1464c0f2eb
commit
14c936dcfa
4 changed files with 31 additions and 8 deletions
|
@ -228,7 +228,7 @@ final class PhabricatorDirectoryMainController
|
|||
array(
|
||||
// TODO: This should filter to just your projects' need-triage
|
||||
// tasks?
|
||||
'href' => '/maniphest/view/alltriage/',
|
||||
'href' => '/maniphest/view/projecttriage/',
|
||||
'class' => 'grey button',
|
||||
),
|
||||
"View All Triage \xC2\xBB"));
|
||||
|
|
|
@ -44,6 +44,10 @@ abstract class ManiphestController extends PhabricatorController {
|
|||
$nav->addFilter('subscribed', 'Subscribed');
|
||||
$nav->addFilter('triage', 'Need Triage');
|
||||
$nav->addSpacer();
|
||||
$nav->addLabel('User Projects');
|
||||
$nav->addFilter('projecttriage','Need Triage');
|
||||
$nav->addFilter('projectall', 'All Tasks');
|
||||
$nav->addSpacer();
|
||||
$nav->addLabel('All Tasks');
|
||||
$nav->addFilter('alltriage', 'Need Triage');
|
||||
$nav->addFilter('all', 'All Tasks');
|
||||
|
|
|
@ -66,6 +66,8 @@ final class ManiphestTaskListController extends ManiphestController {
|
|||
'created' => true,
|
||||
'subscribed' => true,
|
||||
'triage' => true,
|
||||
'projecttriage' => true,
|
||||
'projectall' => true,
|
||||
);
|
||||
|
||||
list($status_map, $status_control) = $this->renderStatusLinks();
|
||||
|
@ -75,7 +77,14 @@ final class ManiphestTaskListController extends ManiphestController {
|
|||
$user_phids = $request->getStrList(
|
||||
'users',
|
||||
array($user->getPHID()));
|
||||
$project_phids = $request->getStrList('projects');
|
||||
if ($this->view == 'projecttriage' || $this->view == 'projectall') {
|
||||
$project_query = new PhabricatorProjectQuery();
|
||||
$project_query->setMembers($user_phids);
|
||||
$projects = $project_query->execute();
|
||||
$project_phids = mpull($projects, 'getPHID');
|
||||
} else {
|
||||
$project_phids = $request->getStrList('projects');
|
||||
}
|
||||
$exclude_project_phids = $request->getStrList('xprojects');
|
||||
$task_ids = $request->getStrList('tasks');
|
||||
$owner_phids = $request->getStrList('owners');
|
||||
|
@ -160,12 +169,14 @@ final class ManiphestTaskListController extends ManiphestController {
|
|||
foreach ($project_phids as $phid) {
|
||||
$tokens[$phid] = $handles[$phid]->getFullName();
|
||||
}
|
||||
$form->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/searchproject/')
|
||||
->setName('set_projects')
|
||||
->setLabel('Projects')
|
||||
->setValue($tokens));
|
||||
if ($this->view != 'projectall' && $this->view != 'projecttriage') {
|
||||
$form->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/searchproject/')
|
||||
->setName('set_projects')
|
||||
->setLabel('Projects')
|
||||
->setValue($tokens));
|
||||
}
|
||||
|
||||
if ($this->view == 'custom') {
|
||||
$tokens = array();
|
||||
|
@ -344,6 +355,13 @@ final class ManiphestTaskListController extends ManiphestController {
|
|||
break;
|
||||
case 'all':
|
||||
break;
|
||||
case 'projecttriage':
|
||||
$query->withPriority(ManiphestTaskPriority::PRIORITY_TRIAGE);
|
||||
$query->withAnyProject(true);
|
||||
break;
|
||||
case 'projectall':
|
||||
$query->withAnyProject(true);
|
||||
break;
|
||||
}
|
||||
|
||||
$order_map = array(
|
||||
|
|
|
@ -14,6 +14,7 @@ phutil_require_module('phabricator', 'applications/maniphest/controller/base');
|
|||
phutil_require_module('phabricator', 'applications/maniphest/query');
|
||||
phutil_require_module('phabricator', 'applications/maniphest/view/tasklist');
|
||||
phutil_require_module('phabricator', 'applications/phid/handle/data');
|
||||
phutil_require_module('phabricator', 'applications/project/query/project');
|
||||
phutil_require_module('phabricator', 'applications/search/storage/query');
|
||||
phutil_require_module('phabricator', 'infrastructure/celerity/api');
|
||||
phutil_require_module('phabricator', 'infrastructure/javelin/api');
|
||||
|
|
Loading…
Reference in a new issue