1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 19:40:55 +01:00

Provide a link to parent/child tasks as a search result from task graphs

Summary:
Ref T4788. Add links to jump to search results with a task's parents or subtasks. This allows relationships to remain useful if there are a zillion of them, and you can sort/filter stuff more easily.

Language might need some tweaking at some point, feeling a little un-brainy today with wordstuff.

Test Plan:
{F1740855}

{F1740856}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T4788

Differential Revision: https://secure.phabricator.com/D16343
This commit is contained in:
epriestley 2016-07-28 13:26:36 -07:00
parent cebf4bbec6
commit ef5cb0630f

View file

@ -106,7 +106,51 @@ final class ManiphestTaskDetailController extends ManiphestController {
$graph_table = $task_graph->newGraphTable();
}
$view->addPropertySection(pht('Task Graph'), $graph_table);
$parent_type = ManiphestTaskDependedOnByTaskEdgeType::EDGECONST;
$subtask_type = ManiphestTaskDependsOnTaskEdgeType::EDGECONST;
$parent_map = $task_graph->getEdges($parent_type);
$subtask_map = $task_graph->getEdges($subtask_type);
$has_parents = (bool)idx($parent_map, $task->getPHID());
$has_subtasks = (bool)idx($subtask_map, $task->getPHID());
$parents_uri = urisprintf(
'/?subtaskIDs=%d#R',
$task->getID());
$parents_uri = $this->getApplicationURI($parents_uri);
$subtasks_uri = urisprintf(
'/?parentIDs=%d#R',
$task->getID());
$subtasks_uri = $this->getApplicationURI($subtasks_uri);
$dropdown_menu = id(new PhabricatorActionListView())
->setViewer($viewer)
->addAction(
id(new PhabricatorActionView())
->setHref($parents_uri)
->setName(pht('Search Parent Tasks'))
->setDisabled(!$has_parents)
->setIcon('fa-chevron-circle-up'))
->addAction(
id(new PhabricatorActionView())
->setHref($subtasks_uri)
->setName(pht('Search Subtasks'))
->setDisabled(!$has_subtasks)
->setIcon('fa-chevron-circle-down'));
$graph_menu = id(new PHUIButtonView())
->setTag('a')
->setIcon('fa-search')
->setText(pht('Search...'))
->setDropdownMenu($dropdown_menu);
$graph_header = id(new PHUIHeaderView())
->setHeader(pht('Task Graph'))
->addActionLink($graph_menu);
$view->addPropertySection($graph_header, $graph_table);
}
return $this->newPage()