Render parent and child tasks in Maniphest with a graph trace

Summary: Ref T4788. This seems reasonable locally, but not sure how it will feel on real data. Might need some tweaks, or might just be a terrible idea.

Test Plan: {F1708059}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T4788

Differential Revision: https://secure.phabricator.com/D16214
This commit is contained in:
epriestley
2016-07-01 08:50:16 -07:00
parent cc7ae60aaf
commit 0a132e468f
7 changed files with 135 additions and 15 deletions

View File

@@ -137,12 +137,31 @@ final class PHUIDiffGraphView extends Phobject {
);
}
// If this is the last page in history, replace the "o" with an "x" so we
// do not draw a connecting line downward, and replace "^" with an "X" for
// repositories with exactly one commit.
// If this is the last page in history, replace any "o" characters at the
// bottom of columns with "x" characters so we do not draw a connecting
// line downward, and replace "^" with an "X" for repositories with
// exactly one commit.
if ($this->getIsTail() && $graph) {
$terminated = array();
foreach (array_reverse(array_keys($graph)) as $key) {
$line = $graph[$key]['line'];
$len = strlen($line);
for ($ii = 0; $ii < $len; $ii++) {
if (isset($terminated[$ii])) {
continue;
}
$c = $line[$ii];
if ($c == 'o') {
$terminated[$ii] = true;
$graph[$key]['line'][$ii] = 'x';
} else if ($c != ' ') {
$terminated[$ii] = true;
}
}
}
$last = array_pop($graph);
$last['line'] = str_replace('o', 'x', $last['line']);
$last['line'] = str_replace('^', 'X', $last['line']);
$graph[] = $last;
}