Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15535211
D16214.id39003.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Referenced Files
None
Subscribers
None
D16214.id39003.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -1430,6 +1430,7 @@
'ManiphestTaskEditBulkJobType' => 'applications/maniphest/bulk/ManiphestTaskEditBulkJobType.php',
'ManiphestTaskEditController' => 'applications/maniphest/controller/ManiphestTaskEditController.php',
'ManiphestTaskFulltextEngine' => 'applications/maniphest/search/ManiphestTaskFulltextEngine.php',
+ 'ManiphestTaskGraph' => 'infrastructure/graph/ManiphestTaskGraph.php',
'ManiphestTaskHasCommitEdgeType' => 'applications/maniphest/edge/ManiphestTaskHasCommitEdgeType.php',
'ManiphestTaskHasCommitRelationship' => 'applications/maniphest/relationship/ManiphestTaskHasCommitRelationship.php',
'ManiphestTaskHasDuplicateTaskEdgeType' => 'applications/maniphest/edge/ManiphestTaskHasDuplicateTaskEdgeType.php',
@@ -5947,6 +5948,7 @@
'ManiphestTaskEditBulkJobType' => 'PhabricatorWorkerBulkJobType',
'ManiphestTaskEditController' => 'ManiphestController',
'ManiphestTaskFulltextEngine' => 'PhabricatorFulltextEngine',
+ 'ManiphestTaskGraph' => 'PhabricatorObjectGraph',
'ManiphestTaskHasCommitEdgeType' => 'PhabricatorEdgeType',
'ManiphestTaskHasCommitRelationship' => 'ManiphestTaskRelationship',
'ManiphestTaskHasDuplicateTaskEdgeType' => 'PhabricatorEdgeType',
diff --git a/src/applications/maniphest/controller/ManiphestTaskDetailController.php b/src/applications/maniphest/controller/ManiphestTaskDetailController.php
--- a/src/applications/maniphest/controller/ManiphestTaskDetailController.php
+++ b/src/applications/maniphest/controller/ManiphestTaskDetailController.php
@@ -31,8 +31,6 @@
->setTargetObject($task);
$e_commit = ManiphestTaskHasCommitEdgeType::EDGECONST;
- $e_dep_on = ManiphestTaskDependsOnTaskEdgeType::EDGECONST;
- $e_dep_by = ManiphestTaskDependedOnByTaskEdgeType::EDGECONST;
$e_rev = ManiphestTaskHasRevisionEdgeType::EDGECONST;
$e_mock = ManiphestTaskHasMockEdgeType::EDGECONST;
@@ -43,8 +41,6 @@
->withEdgeTypes(
array(
$e_commit,
- $e_dep_on,
- $e_dep_by,
$e_rev,
$e_mock,
));
@@ -91,6 +87,15 @@
->addPropertySection(pht('Description'), $description)
->addPropertySection(pht('Details'), $details);
+ $task_graph = id(new ManiphestTaskGraph())
+ ->setViewer($viewer)
+ ->setSeedPHID($task->getPHID())
+ ->loadGraph();
+ if (!$task_graph->isEmpty()) {
+ $graph_table = $task_graph->newGraphTable();
+ $view->addPropertySection(pht('Task Graph'), $graph_table);
+ }
+
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
@@ -186,9 +191,7 @@
$edit_uri = $this->getApplicationURI($edit_uri);
}
- $task_submenu = array();
-
- $task_submenu[] = id(new PhabricatorActionView())
+ $subtask_item = id(new PhabricatorActionView())
->setName(pht('Create Subtask'))
->setHref($edit_uri)
->setIcon('fa-level-down')
@@ -200,6 +203,7 @@
$task);
$submenu_actions = array(
+ $subtask_item,
ManiphestTaskHasParentRelationship::RELATIONSHIPKEY,
ManiphestTaskHasSubtaskRelationship::RELATIONSHIPKEY,
ManiphestTaskMergeInRelationship::RELATIONSHIPKEY,
@@ -280,10 +284,6 @@
}
$edge_types = array(
- ManiphestTaskDependedOnByTaskEdgeType::EDGECONST
- => pht('Parent Tasks'),
- ManiphestTaskDependsOnTaskEdgeType::EDGECONST
- => pht('Subtasks'),
ManiphestTaskHasRevisionEdgeType::EDGECONST
=> pht('Differential Revisions'),
ManiphestTaskHasMockEdgeType::EDGECONST
diff --git a/src/applications/maniphest/storage/ManiphestTask.php b/src/applications/maniphest/storage/ManiphestTask.php
--- a/src/applications/maniphest/storage/ManiphestTask.php
+++ b/src/applications/maniphest/storage/ManiphestTask.php
@@ -179,6 +179,10 @@
return 'T'.$this->getID();
}
+ public function getURI() {
+ return '/'.$this->getMonogram();
+ }
+
public function attachGroupByProjectPHID($phid) {
$this->groupByProjectPHID = $phid;
return $this;
diff --git a/src/applications/search/relationship/PhabricatorObjectRelationshipList.php b/src/applications/search/relationship/PhabricatorObjectRelationshipList.php
--- a/src/applications/search/relationship/PhabricatorObjectRelationshipList.php
+++ b/src/applications/search/relationship/PhabricatorObjectRelationshipList.php
@@ -52,6 +52,12 @@
$actions = array();
foreach ($keys as $key) {
+ // If we're passed a menu item, just include it verbatim.
+ if ($key instanceof PhabricatorActionView) {
+ $actions[] = $key;
+ continue;
+ }
+
$relationship = $this->getRelationship($key);
if (!$relationship) {
throw new Exception(
diff --git a/src/infrastructure/graph/ManiphestTaskGraph.php b/src/infrastructure/graph/ManiphestTaskGraph.php
new file mode 100644
--- /dev/null
+++ b/src/infrastructure/graph/ManiphestTaskGraph.php
@@ -0,0 +1,87 @@
+<?php
+
+final class ManiphestTaskGraph
+ extends PhabricatorObjectGraph {
+
+ protected function getEdgeTypes() {
+ return array(
+ ManiphestTaskDependedOnByTaskEdgeType::EDGECONST,
+ ManiphestTaskDependsOnTaskEdgeType::EDGECONST,
+ );
+ }
+
+ protected function getParentEdgeType() {
+ return ManiphestTaskDependedOnByTaskEdgeType::EDGECONST;
+ }
+
+ protected function newQuery() {
+ return new ManiphestTaskQuery();
+ }
+
+ protected function newTableRow($phid, $object, $trace) {
+ $viewer = $this->getViewer();
+
+ if ($object) {
+ $status = $object->getStatus();
+ $priority = $object->getPriority();
+ $status_icon = ManiphestTaskStatus::getStatusIcon($status);
+ $status_name = ManiphestTaskStatus::getTaskStatusName($status);
+ $priority_color = ManiphestTaskPriority::getTaskPriorityColor($priority);
+
+
+ $status = array(
+ id(new PHUIIconView())->setIcon($status_icon, $priority_color),
+ ' ',
+ $status_name,
+ );
+
+ $owner_phid = $object->getOwnerPHID();
+ if ($owner_phid) {
+ $assigned = $viewer->renderHandle($owner_phid);
+ } else {
+ $assigned = phutil_tag('em', array(), pht('None'));
+ }
+
+ $link = phutil_tag(
+ 'a',
+ array(
+ 'href' => $object->getURI(),
+ ),
+ array(
+ $object->getMonogram(),
+ ' ',
+ $object->getTitle(),
+ ));
+ } else {
+ $status = null;
+ $assigned = null;
+ $link = $viewer->renderHandle($phid);
+ }
+
+ return array(
+ $trace,
+ $status,
+ $assigned,
+ $link,
+ );
+ }
+
+ protected function newTable(AphrontTableView $table) {
+ return $table
+ ->setHeaders(
+ array(
+ null,
+ pht('Status'),
+ pht('Assigned'),
+ pht('Task'),
+ ))
+ ->setColumnClasses(
+ array(
+ 'threads',
+ null,
+ null,
+ 'wide',
+ ));
+ }
+
+}
diff --git a/src/infrastructure/graph/PhabricatorObjectGraph.php b/src/infrastructure/graph/PhabricatorObjectGraph.php
--- a/src/infrastructure/graph/PhabricatorObjectGraph.php
+++ b/src/infrastructure/graph/PhabricatorObjectGraph.php
@@ -55,6 +55,8 @@
$map = array();
foreach ($nodes as $node) {
+ $map[$node] = array();
+
foreach ($edge_types as $edge_type) {
$dst_phids = $query->getDestinationPHIDs(
array($node),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 25, 4:03 AM (13 h, 56 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7826022
Default Alt Text
D16214.id39003.diff (7 KB)
Attached To
Mode
D16214: Render parent and child tasks in Maniphest with a graph trace
Attached
Detach File
Event Timeline
Log In to Comment