forked from phacility/phabricator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDifferentialRevisionGraph.php
87 lines (73 loc) · 1.85 KB
/
DifferentialRevisionGraph.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
final class DifferentialRevisionGraph
extends PhabricatorObjectGraph {
protected function getEdgeTypes() {
return array(
DifferentialRevisionDependsOnRevisionEdgeType::EDGECONST,
DifferentialRevisionDependedOnByRevisionEdgeType::EDGECONST,
);
}
protected function getParentEdgeType() {
return DifferentialRevisionDependsOnRevisionEdgeType::EDGECONST;
}
protected function newQuery() {
return new DifferentialRevisionQuery();
}
protected function isClosed($object) {
return $object->isClosed();
}
protected function newTableRow($phid, $object, $trace) {
$viewer = $this->getViewer();
if ($object) {
$status_icon = $object->getStatusIcon();
$status_color = $object->getStatusIconColor();
$status_name = $object->getStatusDisplayName();
$status = array(
id(new PHUIIconView())
->setIcon($status_icon, $status_color),
' ',
$status_name,
);
$author = $viewer->renderHandle($object->getAuthorPHID());
$link = phutil_tag(
'a',
array(
'href' => $object->getURI(),
),
$object->getTitle());
$link = array(
$object->getMonogram(),
' ',
$link,
);
} else {
$status = null;
$author = null;
$link = $viewer->renderHandle($phid);
}
$link = AphrontTableView::renderSingleDisplayLine($link);
return array(
$trace,
$status,
$author,
$link,
);
}
protected function newTable(AphrontTableView $table) {
return $table
->setHeaders(
array(
null,
pht('Status'),
pht('Author'),
pht('Revision'),
))
->setColumnClasses(
array(
'threads',
'graph-status',
null,
'wide pri object-link',
));
}
}