From f004b76465fe7b0ecf3e8076dbd90ed71bc22c87 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 27 Sep 2019 10:51:13 -0700 Subject: [PATCH] Add a "Subtype" tag to the task graph view in Maniphest Summary: See PHI1466. When an install defines task subtypes, show them on the task graph. Test Plan: - On desktop with subtypes defined, column is visible. - On desktop with subtypes not defined, column is hidden. - On mobile, column is hidden. {F6896845} Differential Revision: https://secure.phabricator.com/D20842 --- .../graph/ManiphestTaskGraph.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/infrastructure/graph/ManiphestTaskGraph.php b/src/infrastructure/graph/ManiphestTaskGraph.php index 74a1fe8701..5aef7b102a 100644 --- a/src/infrastructure/graph/ManiphestTaskGraph.php +++ b/src/infrastructure/graph/ManiphestTaskGraph.php @@ -84,9 +84,18 @@ final class ManiphestTaskGraph ' ', $link, ); + + $subtype_tag = null; + + $subtype = $object->newSubtypeObject(); + if ($subtype && $subtype->hasTagView()) { + $subtype_tag = $subtype->newTagView() + ->setSlimShady(true); + } } else { $status = null; $assigned = null; + $subtype_tag = null; $link = $viewer->renderHandle($phid); } @@ -115,18 +124,23 @@ final class ManiphestTaskGraph $marker, $trace, $status, + $subtype_tag, $assigned, $link, ); } protected function newTable(AphrontTableView $table) { + $subtype_map = id(new ManiphestTask())->newEditEngineSubtypeMap(); + $has_subtypes = ($subtype_map->getCount() > 1); + return $table ->setHeaders( array( null, null, pht('Status'), + pht('Subtype'), pht('Assigned'), pht('Task'), )) @@ -136,12 +150,15 @@ final class ManiphestTaskGraph 'threads', 'graph-status', null, + null, 'wide pri object-link', )) ->setColumnVisibility( array( true, !$this->getRenderOnlyAdjacentNodes(), + true, + $has_subtypes, )) ->setDeviceVisibility( array( @@ -150,6 +167,11 @@ final class ManiphestTaskGraph // On mobile, we only show the actual graph drawing if we're on the // standalone page, since it can take over the screen otherwise. $this->getIsStandalone(), + true, + + // On mobile, don't show subtypes since they're relatively less + // important and we're more pressured for space. + false, )); } @@ -180,6 +202,7 @@ final class ManiphestTaskGraph null, null, null, + null, pht("\xC2\xB7 \xC2\xB7 \xC2\xB7"), ); }