mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 03:50:54 +01:00
When a user is a member of no projects, show them no triage tasks, not all
triage tasks Summary: The "with projects ... " query boils down to "all triage tasks" when you don't belong to any projects. Just render the "no needs triage in projects you are a member of" element unconditionally in this case. Test Plan: Looked at homepage as a user with no project memberships but some triage-requiring tasks before and after this change. Prior to this change, all triage tasks show; afterwards, none. Reviewers: fratrik, btrahan Reviewed By: fratrik CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D1620
This commit is contained in:
parent
0b9d0c9d08
commit
eb4256b97d
1 changed files with 12 additions and 8 deletions
|
@ -102,15 +102,19 @@ class PhabricatorDirectoryMainController
|
|||
$user = $this->getRequest()->getUser();
|
||||
$user_phid = $user->getPHID();
|
||||
|
||||
$task_query = new ManiphestTaskQuery();
|
||||
$task_query->withStatus(ManiphestTaskQuery::STATUS_OPEN);
|
||||
$task_query->withPriority(ManiphestTaskPriority::PRIORITY_TRIAGE);
|
||||
$task_query->withProjects(mpull($projects, 'getPHID'));
|
||||
$task_query->withAnyProject(true);
|
||||
$task_query->setCalculateRows(true);
|
||||
$task_query->setLimit(10);
|
||||
if ($projects) {
|
||||
$task_query = new ManiphestTaskQuery();
|
||||
$task_query->withStatus(ManiphestTaskQuery::STATUS_OPEN);
|
||||
$task_query->withPriority(ManiphestTaskPriority::PRIORITY_TRIAGE);
|
||||
$task_query->withProjects(mpull($projects, 'getPHID'));
|
||||
$task_query->withAnyProject(true);
|
||||
$task_query->setCalculateRows(true);
|
||||
$task_query->setLimit(10);
|
||||
$tasks = $task_query->execute();
|
||||
} else {
|
||||
$tasks = array();
|
||||
}
|
||||
|
||||
$tasks = $task_query->execute();
|
||||
if ($tasks) {
|
||||
$panel = new AphrontPanelView();
|
||||
$panel->setHeader('Needs Triage');
|
||||
|
|
Loading…
Reference in a new issue