1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 16:22:43 +01:00

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
This commit is contained in:
epriestley 2019-09-27 10:51:13 -07:00
parent 7a0090f4d0
commit f004b76465

View file

@ -84,9 +84,18 @@ final class ManiphestTaskGraph
' ', ' ',
$link, $link,
); );
$subtype_tag = null;
$subtype = $object->newSubtypeObject();
if ($subtype && $subtype->hasTagView()) {
$subtype_tag = $subtype->newTagView()
->setSlimShady(true);
}
} else { } else {
$status = null; $status = null;
$assigned = null; $assigned = null;
$subtype_tag = null;
$link = $viewer->renderHandle($phid); $link = $viewer->renderHandle($phid);
} }
@ -115,18 +124,23 @@ final class ManiphestTaskGraph
$marker, $marker,
$trace, $trace,
$status, $status,
$subtype_tag,
$assigned, $assigned,
$link, $link,
); );
} }
protected function newTable(AphrontTableView $table) { protected function newTable(AphrontTableView $table) {
$subtype_map = id(new ManiphestTask())->newEditEngineSubtypeMap();
$has_subtypes = ($subtype_map->getCount() > 1);
return $table return $table
->setHeaders( ->setHeaders(
array( array(
null, null,
null, null,
pht('Status'), pht('Status'),
pht('Subtype'),
pht('Assigned'), pht('Assigned'),
pht('Task'), pht('Task'),
)) ))
@ -136,12 +150,15 @@ final class ManiphestTaskGraph
'threads', 'threads',
'graph-status', 'graph-status',
null, null,
null,
'wide pri object-link', 'wide pri object-link',
)) ))
->setColumnVisibility( ->setColumnVisibility(
array( array(
true, true,
!$this->getRenderOnlyAdjacentNodes(), !$this->getRenderOnlyAdjacentNodes(),
true,
$has_subtypes,
)) ))
->setDeviceVisibility( ->setDeviceVisibility(
array( array(
@ -150,6 +167,11 @@ final class ManiphestTaskGraph
// On mobile, we only show the actual graph drawing if we're on the // On mobile, we only show the actual graph drawing if we're on the
// standalone page, since it can take over the screen otherwise. // standalone page, since it can take over the screen otherwise.
$this->getIsStandalone(), $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,
null, null,
null,
pht("\xC2\xB7 \xC2\xB7 \xC2\xB7"), pht("\xC2\xB7 \xC2\xB7 \xC2\xB7"),
); );
} }