1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-23 07:12:41 +01:00

Don't draw the task graph line image on devices by default

Summary:
See downstream <https://phabricator.wikimedia.org/T210482>.

On mobile, the task graph can take up most of the screen. Hide it on devices. Keep it on the standalone view if you're really dedicated and willing to rotate your phone or whatever to see the lines.

Test Plan: Dragged window real narrow, saw graph hide.

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D20313
This commit is contained in:
epriestley 2019-03-22 09:57:12 -07:00
parent b825570734
commit f047b90d93
2 changed files with 19 additions and 0 deletions

View file

@ -30,6 +30,7 @@ final class ManiphestTaskGraphController
->setViewer($viewer) ->setViewer($viewer)
->setSeedPHID($task->getPHID()) ->setSeedPHID($task->getPHID())
->setLimit($graph_limit) ->setLimit($graph_limit)
->setIsStandalone(true)
->loadGraph(); ->loadGraph();
if (!$task_graph->isEmpty()) { if (!$task_graph->isEmpty()) {
$parent_type = ManiphestTaskDependedOnByTaskEdgeType::EDGECONST; $parent_type = ManiphestTaskDependedOnByTaskEdgeType::EDGECONST;

View file

@ -4,6 +4,7 @@ final class ManiphestTaskGraph
extends PhabricatorObjectGraph { extends PhabricatorObjectGraph {
private $seedMaps = array(); private $seedMaps = array();
private $isStandalone;
protected function getEdgeTypes() { protected function getEdgeTypes() {
return array( return array(
@ -24,6 +25,15 @@ final class ManiphestTaskGraph
return $object->isClosed(); return $object->isClosed();
} }
public function setIsStandalone($is_standalone) {
$this->isStandalone = $is_standalone;
return $this;
}
public function getIsStandalone() {
return $this->isStandalone;
}
protected function newTableRow($phid, $object, $trace) { protected function newTableRow($phid, $object, $trace) {
$viewer = $this->getViewer(); $viewer = $this->getViewer();
@ -132,6 +142,14 @@ final class ManiphestTaskGraph
array( array(
true, true,
!$this->getRenderOnlyAdjacentNodes(), !$this->getRenderOnlyAdjacentNodes(),
))
->setDeviceVisibility(
array(
true,
// 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(),
)); ));
} }