Clarify Tasks listed on Project Profiles
Summary: Fixes T6772. Adds additional checks and language. Happy to tweak language. Test Plan: Test a Project with 3, 10, and 11 tasks. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T6772 Differential Revision: https://secure.phabricator.com/D11192
This commit is contained in:
@@ -137,6 +137,7 @@ final class PhabricatorProjectProfileController
|
||||
private function renderTasksPage(PhabricatorProject $project) {
|
||||
|
||||
$user = $this->getRequest()->getUser();
|
||||
$limit = 10;
|
||||
|
||||
$query = id(new ManiphestTaskQuery())
|
||||
->setViewer($user)
|
||||
@@ -144,8 +145,12 @@ final class PhabricatorProjectProfileController
|
||||
->withStatuses(ManiphestTaskStatus::getOpenStatusConstants())
|
||||
->setOrderBy(ManiphestTaskQuery::ORDER_PRIORITY)
|
||||
->needProjectPHIDs(true)
|
||||
->setLimit(10);
|
||||
->setLimit(($limit + 1));
|
||||
$tasks = $query->execute();
|
||||
$count = count($tasks);
|
||||
if ($count == ($limit + 1)) {
|
||||
array_pop($tasks);
|
||||
}
|
||||
|
||||
$phids = mpull($tasks, 'getOwnerPHID');
|
||||
$phids = array_merge(
|
||||
@@ -181,10 +186,15 @@ final class PhabricatorProjectProfileController
|
||||
->setIcon($icon_new);
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader(pht('Open Tasks'))
|
||||
->addActionLink($button_add)
|
||||
->addActionLink($button_view);
|
||||
|
||||
if ($count > $limit) {
|
||||
$header->setHeader(pht('Highest Priority (some)'));
|
||||
} else {
|
||||
$header->setHeader(pht('Highest Priority (all)'));
|
||||
}
|
||||
|
||||
$content = id(new PHUIObjectBoxView())
|
||||
->setHeader($header)
|
||||
->appendChild($task_list);
|
||||
|
||||
Reference in New Issue
Block a user