@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class DifferentialRevisionGraph
4 extends PhabricatorObjectGraph {
5
6 protected function getEdgeTypes() {
7 return array(
8 DifferentialRevisionDependsOnRevisionEdgeType::EDGECONST,
9 DifferentialRevisionDependedOnByRevisionEdgeType::EDGECONST,
10 );
11 }
12
13 protected function getParentEdgeType() {
14 return DifferentialRevisionDependsOnRevisionEdgeType::EDGECONST;
15 }
16
17 protected function newQuery() {
18 return new DifferentialRevisionQuery();
19 }
20
21 protected function isClosed($object) {
22 return $object->isClosed();
23 }
24
25 protected function newTableRow($phid, $object, $trace) {
26 $viewer = $this->getViewer();
27
28 if ($object) {
29 $status_icon = $object->getStatusIcon();
30 $status_color = $object->getStatusIconColor();
31 $status_name = $object->getStatusDisplayName();
32
33 $status = array(
34 id(new PHUIIconView())
35 ->setIcon($status_icon, $status_color),
36 ' ',
37 $status_name,
38 );
39
40 $author = $viewer->renderHandle($object->getAuthorPHID());
41 $link = phutil_tag(
42 'a',
43 array(
44 'href' => $object->getURI(),
45 ),
46 $object->getTitle());
47
48 $link = array(
49 $object->getMonogram(),
50 ' ',
51 $link,
52 );
53 } else {
54 $status = null;
55 $author = null;
56 $link = $viewer->renderHandle($phid);
57 }
58
59 $link = AphrontTableView::renderSingleDisplayLine($link);
60
61 return array(
62 $trace,
63 $status,
64 $author,
65 $link,
66 );
67 }
68
69 protected function newTable(AphrontTableView $table) {
70 return $table
71 ->setHeaders(
72 array(
73 null,
74 pht('Status'),
75 pht('Author'),
76 pht('Revision'),
77 ))
78 ->setColumnClasses(
79 array(
80 'threads',
81 'graph-status',
82 null,
83 'wide pri object-link',
84 ));
85 }
86
87}