Skip to content

Commit f004b76

Browse files
author
epriestley
committedSep 27, 2019
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
1 parent 7a0090f commit f004b76

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
 

‎src/infrastructure/graph/ManiphestTaskGraph.php

+23
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,18 @@ protected function newTableRow($phid, $object, $trace) {
8484
' ',
8585
$link,
8686
);
87+
88+
$subtype_tag = null;
89+
90+
$subtype = $object->newSubtypeObject();
91+
if ($subtype && $subtype->hasTagView()) {
92+
$subtype_tag = $subtype->newTagView()
93+
->setSlimShady(true);
94+
}
8795
} else {
8896
$status = null;
8997
$assigned = null;
98+
$subtype_tag = null;
9099
$link = $viewer->renderHandle($phid);
91100
}
92101

@@ -115,18 +124,23 @@ protected function newTableRow($phid, $object, $trace) {
115124
$marker,
116125
$trace,
117126
$status,
127+
$subtype_tag,
118128
$assigned,
119129
$link,
120130
);
121131
}
122132

123133
protected function newTable(AphrontTableView $table) {
134+
$subtype_map = id(new ManiphestTask())->newEditEngineSubtypeMap();
135+
$has_subtypes = ($subtype_map->getCount() > 1);
136+
124137
return $table
125138
->setHeaders(
126139
array(
127140
null,
128141
null,
129142
pht('Status'),
143+
pht('Subtype'),
130144
pht('Assigned'),
131145
pht('Task'),
132146
))
@@ -136,12 +150,15 @@ protected function newTable(AphrontTableView $table) {
136150
'threads',
137151
'graph-status',
138152
null,
153+
null,
139154
'wide pri object-link',
140155
))
141156
->setColumnVisibility(
142157
array(
143158
true,
144159
!$this->getRenderOnlyAdjacentNodes(),
160+
true,
161+
$has_subtypes,
145162
))
146163
->setDeviceVisibility(
147164
array(
@@ -150,6 +167,11 @@ protected function newTable(AphrontTableView $table) {
150167
// On mobile, we only show the actual graph drawing if we're on the
151168
// standalone page, since it can take over the screen otherwise.
152169
$this->getIsStandalone(),
170+
true,
171+
172+
// On mobile, don't show subtypes since they're relatively less
173+
// important and we're more pressured for space.
174+
false,
153175
));
154176
}
155177

@@ -180,6 +202,7 @@ protected function newEllipsisRow() {
180202
null,
181203
null,
182204
null,
205+
null,
183206
pht("\xC2\xB7 \xC2\xB7 \xC2\xB7"),
184207
);
185208
}

0 commit comments

Comments
 (0)
Failed to load comments.