Skip to content

Commit 46f6c26

Browse files
author
Chad Little
committed
[Redesign] New PHUIObjectItemListView
Summary: New, cleaner, ObjectItemLists. Lots of minor style tweaks, basic overview: - Remove FootIcons - Remove Stackable - Remove Plain List - Add StatusIcon - Add setting ObjectList to an ObjectBox - Minor retouches to Headers Mostly, this should give us an idea of life with the new Object Lists. I'll take another application by application pass down the road. This mostly looks at implementation in Maniphest, Differential, Audit, Workboards. Checked a few other areas and dialogs while testing, and everything looks square. Test Plan: Maniphest, Differential, Homepage, Audit, People, and other applications. Drag reorder, etc. Reviewers: btrahan, epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Differential Revision: https://secure.phabricator.com/D12865
1 parent b1b97dd commit 46f6c26

25 files changed

+281
-316
lines changed

resources/celerity/map.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
*/
88
return array(
99
'names' => array(
10-
'core.pkg.css' => '50250d4f',
10+
'core.pkg.css' => '178ec7e2',
1111
'core.pkg.js' => 'f3e08b38',
1212
'darkconsole.pkg.js' => 'e7393ebb',
1313
'differential.pkg.css' => 'bb338e4b',
1414
'differential.pkg.js' => '895b8d62',
1515
'diffusion.pkg.css' => '591664fa',
1616
'diffusion.pkg.js' => '0115b37c',
17-
'maniphest.pkg.css' => '68d4dd3d',
17+
'maniphest.pkg.css' => 'ddf93c68',
1818
'maniphest.pkg.js' => 'df4aa49f',
1919
'rsrc/css/aphront/aphront-bars.css' => '231ac33c',
2020
'rsrc/css/aphront/dark-console.css' => '6378ef3d',
@@ -74,10 +74,10 @@
7474
'rsrc/css/application/harbormaster/harbormaster.css' => '49d64eb4',
7575
'rsrc/css/application/herald/herald-test.css' => '778b008e',
7676
'rsrc/css/application/herald/herald.css' => '826075fa',
77-
'rsrc/css/application/maniphest/batch-editor.css' => '8f380ebc',
77+
'rsrc/css/application/maniphest/batch-editor.css' => '9a5ed9c1',
7878
'rsrc/css/application/maniphest/report.css' => 'f6931fdf',
7979
'rsrc/css/application/maniphest/task-edit.css' => '8e23031b',
80-
'rsrc/css/application/maniphest/task-summary.css' => 'ab2fc691',
80+
'rsrc/css/application/maniphest/task-summary.css' => '307c88e9',
8181
'rsrc/css/application/objectselector/object-selector.css' => '029a133d',
8282
'rsrc/css/application/owners/owners-path-editor.css' => '2f00933b',
8383
'rsrc/css/application/paste/paste.css' => 'eb997ddd',
@@ -134,14 +134,14 @@
134134
'rsrc/css/phui/phui-fontkit.css' => '1e71371a',
135135
'rsrc/css/phui/phui-form-view.css' => 'e1abbe8e',
136136
'rsrc/css/phui/phui-form.css' => 'f535f938',
137-
'rsrc/css/phui/phui-header-view.css' => '5c0c1c39',
137+
'rsrc/css/phui/phui-header-view.css' => 'c2855306',
138138
'rsrc/css/phui/phui-icon.css' => 'bc766998',
139139
'rsrc/css/phui/phui-image-mask.css' => '5a8b09c8',
140140
'rsrc/css/phui/phui-info-panel.css' => '27ea50a1',
141141
'rsrc/css/phui/phui-info-view.css' => '33595731',
142142
'rsrc/css/phui/phui-list.css' => '2e25ebfb',
143143
'rsrc/css/phui/phui-object-box.css' => '3a601bc5',
144-
'rsrc/css/phui/phui-object-item-list-view.css' => 'c259c94f',
144+
'rsrc/css/phui/phui-object-item-list-view.css' => 'e052f697',
145145
'rsrc/css/phui/phui-pinboard-view.css' => 'eaab2b1b',
146146
'rsrc/css/phui/phui-property-list-view.css' => 'd2d143ea',
147147
'rsrc/css/phui/phui-remarkup-preview.css' => '19ad512b',
@@ -685,10 +685,10 @@
685685
'javelin-websocket' => 'e292eaf4',
686686
'javelin-workflow' => '5b2e3e2b',
687687
'lightbox-attachment-css' => '7acac05d',
688-
'maniphest-batch-editor' => '8f380ebc',
688+
'maniphest-batch-editor' => '9a5ed9c1',
689689
'maniphest-report-css' => 'f6931fdf',
690690
'maniphest-task-edit-css' => '8e23031b',
691-
'maniphest-task-summary-css' => 'ab2fc691',
691+
'maniphest-task-summary-css' => '307c88e9',
692692
'multirow-row-manager' => 'b5d57730',
693693
'owners-path-editor' => 'aa1733d0',
694694
'owners-path-editor-css' => '2f00933b',
@@ -769,15 +769,15 @@
769769
'phui-fontkit-css' => '1e71371a',
770770
'phui-form-css' => 'f535f938',
771771
'phui-form-view-css' => 'e1abbe8e',
772-
'phui-header-view-css' => '5c0c1c39',
772+
'phui-header-view-css' => 'c2855306',
773773
'phui-icon-view-css' => 'bc766998',
774774
'phui-image-mask-css' => '5a8b09c8',
775775
'phui-info-panel-css' => '27ea50a1',
776776
'phui-info-view-css' => '33595731',
777777
'phui-inline-comment-view-css' => '2174771a',
778778
'phui-list-view-css' => '2e25ebfb',
779779
'phui-object-box-css' => '3a601bc5',
780-
'phui-object-item-list-view-css' => 'c259c94f',
780+
'phui-object-item-list-view-css' => 'e052f697',
781781
'phui-pinboard-view-css' => 'eaab2b1b',
782782
'phui-property-list-view-css' => 'd2d143ea',
783783
'phui-remarkup-preview-css' => '19ad512b',

src/applications/almanac/controller/AlmanacConsoleController.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ public function handleRequest(AphrontRequest $request) {
1010
$viewer = $request->getViewer();
1111

1212
$menu = id(new PHUIObjectItemListView())
13-
->setUser($viewer)
14-
->setStackable(true);
13+
->setUser($viewer);
1514

1615
$menu->addItem(
1716
id(new PHUIObjectItemView())
@@ -45,7 +44,7 @@ public function handleRequest(AphrontRequest $request) {
4544

4645
$box = id(new PHUIObjectBoxView())
4746
->setHeaderText('Console')
48-
->appendChild($menu);
47+
->setObjectList($menu);
4948

5049
return $this->buildApplicationPage(
5150
array(

src/applications/audit/view/PhabricatorAuditListView.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ public function buildList() {
148148
->setObjectName($commit_name)
149149
->setHeader($commit_desc)
150150
->setHref($commit_link)
151-
->setBarColor($status_color)
152151
->addAttribute($status_text)
153152
->addAttribute($reasons)
154153
->addIcon('none', $committed)
@@ -158,6 +157,10 @@ public function buildList() {
158157
$item->addByLine(pht('Auditors: %s', $auditors));
159158
}
160159

160+
if ($status_color) {
161+
$item->setStatusIcon('fa-exclamation-triangle '.$status_color);
162+
}
163+
161164
$list->addItem($item);
162165
}
163166

src/applications/config/controller/PhabricatorConfigGroupController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function processRequest() {
2424

2525
$box = id(new PHUIObjectBoxView())
2626
->setHeaderText($title)
27-
->appendChild($list);
27+
->setObjectList($list);
2828

2929
$crumbs = $this
3030
->buildApplicationCrumbs()
@@ -63,7 +63,6 @@ private function buildOptionList(array $options) {
6363
$engine->process();
6464

6565
$list = new PHUIObjectItemListView();
66-
$list->setStackable(true);
6766
foreach ($options as $option) {
6867
$summary = $engine->getOutput($option, 'summary');
6968

src/applications/config/controller/PhabricatorConfigIssueListController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ public function processRequest() {
7676
private function buildIssueList(array $issues, $group) {
7777
assert_instances_of($issues, 'PhabricatorSetupIssue');
7878
$list = new PHUIObjectItemListView();
79-
$list->setStackable(true);
8079
$ignored_items = array();
8180
$items = 0;
8281

src/applications/config/controller/PhabricatorConfigListController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function processRequest() {
2222

2323
$apps = id(new PHUIObjectBoxView())
2424
->setHeaderText(pht('Applications Configuration'))
25-
->appendChild($apps_list);
25+
->setObjectList($apps_list);
2626

2727
$nav->appendChild(
2828
array(
@@ -47,7 +47,6 @@ private function buildConfigOptionsList(array $groups, $type) {
4747
assert_instances_of($groups, 'PhabricatorApplicationConfigOptions');
4848

4949
$list = new PHUIObjectItemListView();
50-
$list->setStackable(true);
5150
$groups = msort($groups, 'getName');
5251
foreach ($groups as $group) {
5352
if ($group->getGroup() == $type) {

src/applications/differential/view/DifferentialRevisionListView.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,19 +165,24 @@ public function render() {
165165

166166
switch ($status) {
167167
case ArcanistDifferentialRevisionStatus::NEEDS_REVIEW:
168+
$item->setStatusIcon('fa-square-o black', pht('Needs Review'));
168169
break;
169170
case ArcanistDifferentialRevisionStatus::NEEDS_REVISION:
171+
$item->setStatusIcon('fa-refresh red', pht('Needs Revision'));
172+
break;
170173
case ArcanistDifferentialRevisionStatus::CHANGES_PLANNED:
171-
$item->setBarColor('red');
174+
$item->setStatusIcon('fa-headphones red', pht('Changes Planned'));
172175
break;
173176
case ArcanistDifferentialRevisionStatus::ACCEPTED:
174-
$item->setBarColor('green');
177+
$item->setStatusIcon('fa-check green', pht('Accepted'));
175178
break;
176179
case ArcanistDifferentialRevisionStatus::CLOSED:
177180
$item->setDisabled(true);
181+
$item->setStatusIcon('fa-check-square-o black', pht('Closed'));
178182
break;
179183
case ArcanistDifferentialRevisionStatus::ABANDONED:
180-
$item->setBarColor('black');
184+
$item->setDisabled(true);
185+
$item->setStatusIcon('fa-plane black', pht('Abandoned'));
181186
break;
182187
}
183188

src/applications/home/controller/PhabricatorHomeMainController.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ private function buildUnbreakNowPanel() {
152152
$title = pht('Unbreak Now!');
153153
$panel = new PHUIObjectBoxView();
154154
$panel->setHeader($this->renderSectionHeader($title, $href));
155-
$panel->appendChild($this->buildTaskListView($tasks));
155+
$panel->setObjectList($this->buildTaskListView($tasks));
156156

157157
return $panel;
158158
}
@@ -202,7 +202,7 @@ private function buildNeedsTriagePanel(array $projects) {
202202
$user->getPHID());
203203
$panel = new PHUIObjectBoxView();
204204
$panel->setHeader($this->renderSectionHeader($title, $href));
205-
$panel->appendChild($this->buildTaskListView($tasks));
205+
$panel->setObjectList($this->buildTaskListView($tasks));
206206

207207
return $panel;
208208
}
@@ -248,9 +248,8 @@ private function buildRevisionPanel() {
248248
$revision_view->setHandles($handles);
249249

250250
$list_view = $revision_view->render();
251-
$list_view->setFlush(true);
252251

253-
$panel->appendChild($list_view);
252+
$panel->setObjectList($list_view);
254253

255254
return $panel;
256255
}
@@ -290,7 +289,7 @@ private function buildTasksPanel() {
290289
$href = '/maniphest/query/assigned/';
291290
$panel = new PHUIObjectBoxView();
292291
$panel->setHeader($this->renderSectionHeader($title, $href));
293-
$panel->appendChild($this->buildTaskListView($tasks));
292+
$panel->setObjectList($this->buildTaskListView($tasks));
294293

295294
return $panel;
296295
}
@@ -375,7 +374,7 @@ public function buildAuditPanel() {
375374
$href = '/audit/';
376375
$panel = new PHUIObjectBoxView();
377376
$panel->setHeader($this->renderSectionHeader($title, $href));
378-
$panel->appendChild($view);
377+
$panel->setObjectList($view);
379378

380379
return $panel;
381380
}
@@ -414,7 +413,7 @@ public function buildCommitPanel() {
414413
$href = '/audit/';
415414
$panel = new PHUIObjectBoxView();
416415
$panel->setHeader($this->renderSectionHeader($title, $href));
417-
$panel->appendChild($view);
416+
$panel->setObjectList($view);
418417

419418
return $panel;
420419
}

src/applications/maniphest/view/ManiphestTaskListView.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ public function render() {
4141
require_celerity_resource('maniphest-task-summary-css');
4242

4343
$list = new PHUIObjectItemListView();
44-
$list->setFlush(true);
4544

4645
if ($this->noDataString) {
4746
$list->setNoDataString($this->noDataString);
@@ -68,11 +67,14 @@ public function render() {
6867
}
6968

7069
$status = $task->getStatus();
70+
// TODO: redesign-2015 move icon map to maniphest.statuses
71+
$icon = 'fa-exclamation-circle ';
72+
$icon .= idx($color_map, $task->getPriority(), 'grey');
7173
if ($task->isClosed()) {
7274
$item->setDisabled(true);
75+
$icon = 'fa-check-square-o grey';
7376
}
74-
75-
$item->setBarColor(idx($color_map, $task->getPriority(), 'grey'));
77+
$item->setStatusIcon($icon, idx($status_map, $task->getStatus()));
7678

7779
$item->addIcon(
7880
'none',

src/applications/maniphest/view/ManiphestTaskResultListView.php

Lines changed: 20 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -79,26 +79,16 @@ public function render() {
7979
$task_list->setTasks($list);
8080
$task_list->setHandles($handles);
8181

82-
$header = javelin_tag(
83-
'h1',
84-
array(
85-
'class' => 'maniphest-task-group-header',
86-
'sigil' => 'task-group',
87-
'meta' => array(
88-
'priority' => head($list)->getPriority(),
89-
),
90-
),
91-
pht('%s (%s)', $group, new PhutilNumber(count($list))));
92-
93-
$lists[] = phutil_tag(
94-
'div',
95-
array(
96-
'class' => 'maniphest-task-group',
97-
),
98-
array(
99-
$header,
100-
$task_list,
101-
));
82+
$header = id(new PHUIHeaderView())
83+
->addClass('maniphest-task-group-header')
84+
->addSigil('task-group')
85+
->setMetadata(array('priority' => head($list)->getPriority()))
86+
->setHeader(pht('%s (%s)', $group, new PhutilNumber(count($list))));
87+
88+
$lists[] = id(new PHUIObjectBoxView())
89+
->setHeader($header)
90+
->appendChild($task_list);
91+
10292
}
10393

10494
if ($can_drag) {
@@ -109,15 +99,10 @@ public function render() {
10999
));
110100
}
111101

112-
return phutil_tag(
113-
'div',
114-
array(
115-
'class' => 'maniphest-list-container',
116-
),
117-
array(
118-
$lists,
119-
$this->showBatchControls ? $this->renderBatchEditor($query) : null,
120-
));
102+
return array(
103+
$lists,
104+
$this->showBatchControls ? $this->renderBatchEditor($query) : null,
105+
);
121106
}
122107

123108

@@ -251,18 +236,14 @@ private function renderBatchEditor(PhabricatorSavedQuery $saved_query) {
251236
'');
252237

253238
$editor = hsprintf(
254-
'<div class="maniphest-batch-editor">'.
255-
'<div class="batch-editor-header">%s</div>'.
256239
'<table class="maniphest-batch-editor-layout">'.
257240
'<tr>'.
258241
'<td>%s%s</td>'.
259242
'<td>%s</td>'.
260243
'<td id="batch-select-status-cell">%s</td>'.
261244
'<td class="batch-select-submit-cell">%s%s</td>'.
262245
'</tr>'.
263-
'</table>'.
264-
'</div>',
265-
pht('Batch Task Editor'),
246+
'</table>',
266247
$select_all,
267248
$select_none,
268249
$export,
@@ -279,6 +260,10 @@ private function renderBatchEditor(PhabricatorSavedQuery $saved_query) {
279260
),
280261
$editor);
281262

282-
return $editor;
263+
$box = id(new PHUIObjectBoxView())
264+
->setHeaderText(pht('Batch Task Editor'))
265+
->appendChild($editor);
266+
267+
return $box;
283268
}
284269
}

0 commit comments

Comments
 (0)