mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-23 15:22:41 +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(
|
array(
|
||||||
// TODO: This should filter to just your projects' need-triage
|
// TODO: This should filter to just your projects' need-triage
|
||||||
// tasks?
|
// tasks?
|
||||||
'href' => '/maniphest/view/alltriage/',
|
'href' => '/maniphest/view/projecttriage/',
|
||||||
'class' => 'grey button',
|
'class' => 'grey button',
|
||||||
),
|
),
|
||||||
"View All Triage \xC2\xBB"));
|
"View All Triage \xC2\xBB"));
|
||||||
|
|
|
@ -44,6 +44,10 @@ abstract class ManiphestController extends PhabricatorController {
|
||||||
$nav->addFilter('subscribed', 'Subscribed');
|
$nav->addFilter('subscribed', 'Subscribed');
|
||||||
$nav->addFilter('triage', 'Need Triage');
|
$nav->addFilter('triage', 'Need Triage');
|
||||||
$nav->addSpacer();
|
$nav->addSpacer();
|
||||||
|
$nav->addLabel('User Projects');
|
||||||
|
$nav->addFilter('projecttriage','Need Triage');
|
||||||
|
$nav->addFilter('projectall', 'All Tasks');
|
||||||
|
$nav->addSpacer();
|
||||||
$nav->addLabel('All Tasks');
|
$nav->addLabel('All Tasks');
|
||||||
$nav->addFilter('alltriage', 'Need Triage');
|
$nav->addFilter('alltriage', 'Need Triage');
|
||||||
$nav->addFilter('all', 'All Tasks');
|
$nav->addFilter('all', 'All Tasks');
|
||||||
|
|
|
@ -66,6 +66,8 @@ final class ManiphestTaskListController extends ManiphestController {
|
||||||
'created' => true,
|
'created' => true,
|
||||||
'subscribed' => true,
|
'subscribed' => true,
|
||||||
'triage' => true,
|
'triage' => true,
|
||||||
|
'projecttriage' => true,
|
||||||
|
'projectall' => true,
|
||||||
);
|
);
|
||||||
|
|
||||||
list($status_map, $status_control) = $this->renderStatusLinks();
|
list($status_map, $status_control) = $this->renderStatusLinks();
|
||||||
|
@ -75,7 +77,14 @@ final class ManiphestTaskListController extends ManiphestController {
|
||||||
$user_phids = $request->getStrList(
|
$user_phids = $request->getStrList(
|
||||||
'users',
|
'users',
|
||||||
array($user->getPHID()));
|
array($user->getPHID()));
|
||||||
|
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');
|
$project_phids = $request->getStrList('projects');
|
||||||
|
}
|
||||||
$exclude_project_phids = $request->getStrList('xprojects');
|
$exclude_project_phids = $request->getStrList('xprojects');
|
||||||
$task_ids = $request->getStrList('tasks');
|
$task_ids = $request->getStrList('tasks');
|
||||||
$owner_phids = $request->getStrList('owners');
|
$owner_phids = $request->getStrList('owners');
|
||||||
|
@ -160,12 +169,14 @@ final class ManiphestTaskListController extends ManiphestController {
|
||||||
foreach ($project_phids as $phid) {
|
foreach ($project_phids as $phid) {
|
||||||
$tokens[$phid] = $handles[$phid]->getFullName();
|
$tokens[$phid] = $handles[$phid]->getFullName();
|
||||||
}
|
}
|
||||||
|
if ($this->view != 'projectall' && $this->view != 'projecttriage') {
|
||||||
$form->appendChild(
|
$form->appendChild(
|
||||||
id(new AphrontFormTokenizerControl())
|
id(new AphrontFormTokenizerControl())
|
||||||
->setDatasource('/typeahead/common/searchproject/')
|
->setDatasource('/typeahead/common/searchproject/')
|
||||||
->setName('set_projects')
|
->setName('set_projects')
|
||||||
->setLabel('Projects')
|
->setLabel('Projects')
|
||||||
->setValue($tokens));
|
->setValue($tokens));
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->view == 'custom') {
|
if ($this->view == 'custom') {
|
||||||
$tokens = array();
|
$tokens = array();
|
||||||
|
@ -344,6 +355,13 @@ final class ManiphestTaskListController extends ManiphestController {
|
||||||
break;
|
break;
|
||||||
case 'all':
|
case 'all':
|
||||||
break;
|
break;
|
||||||
|
case 'projecttriage':
|
||||||
|
$query->withPriority(ManiphestTaskPriority::PRIORITY_TRIAGE);
|
||||||
|
$query->withAnyProject(true);
|
||||||
|
break;
|
||||||
|
case 'projectall':
|
||||||
|
$query->withAnyProject(true);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$order_map = array(
|
$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/query');
|
||||||
phutil_require_module('phabricator', 'applications/maniphest/view/tasklist');
|
phutil_require_module('phabricator', 'applications/maniphest/view/tasklist');
|
||||||
phutil_require_module('phabricator', 'applications/phid/handle/data');
|
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', 'applications/search/storage/query');
|
||||||
phutil_require_module('phabricator', 'infrastructure/celerity/api');
|
phutil_require_module('phabricator', 'infrastructure/celerity/api');
|
||||||
phutil_require_module('phabricator', 'infrastructure/javelin/api');
|
phutil_require_module('phabricator', 'infrastructure/javelin/api');
|
||||||
|
|
Loading…
Reference in a new issue