Skip to content

Commit 018de5d

Browse files
author
epriestley
committed
Use ObjectItemListView for Maniphest
Summary: This isn't quite complete, but everything else is technical cleanup. Broadly: - Removed checkboxes. Selected state is now indicated with CSS, and toggled with shift-click. When nothing is selected, the text reads "Shift-Click Tasks to Select" to let users discover this feature. - Updated drag-to-reorder code to work with ObjectItemListView. - Closed/resolved is now shown with a grey footer icon. - Assigned is now shown with a user profile image handle icon, with a hover state. This could probably use some more tweaks, but overall I think it looks pretty reasonable? Test Plan: {F35897} Reviewers: chad Reviewed By: chad CC: aran Differential Revision: https://secure.phabricator.com/D5340
1 parent 5e53fc7 commit 018de5d

File tree

12 files changed

+358
-530
lines changed

12 files changed

+358
-530
lines changed

src/__celerity_resource_map__.php

Lines changed: 56 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,13 +1638,14 @@
16381638
),
16391639
'javelin-behavior-maniphest-batch-selector' =>
16401640
array(
1641-
'uri' => '/res/398cf8d7/rsrc/js/application/maniphest/behavior-batch-selector.js',
1641+
'uri' => '/res/f8cf3b84/rsrc/js/application/maniphest/behavior-batch-selector.js',
16421642
'type' => 'js',
16431643
'requires' =>
16441644
array(
16451645
0 => 'javelin-behavior',
16461646
1 => 'javelin-dom',
16471647
2 => 'javelin-stratcom',
1648+
3 => 'javelin-util',
16481649
),
16491650
'disk' => '/rsrc/js/application/maniphest/behavior-batch-selector.js',
16501651
),
@@ -1663,7 +1664,7 @@
16631664
),
16641665
'javelin-behavior-maniphest-subpriority-editor' =>
16651666
array(
1666-
'uri' => '/res/5e02f19a/rsrc/js/application/maniphest/behavior-subpriorityeditor.js',
1667+
'uri' => '/res/21b73c2a/rsrc/js/application/maniphest/behavior-subpriorityeditor.js',
16671668
'type' => 'js',
16681669
'requires' =>
16691670
array(
@@ -2632,7 +2633,7 @@
26322633
),
26332634
'maniphest-task-summary-css' =>
26342635
array(
2635-
'uri' => '/res/b3930263/rsrc/css/application/maniphest/task-summary.css',
2636+
'uri' => '/res/7aa9e2eb/rsrc/css/application/maniphest/task-summary.css',
26362637
'type' => 'css',
26372638
'requires' =>
26382639
array(
@@ -2995,7 +2996,7 @@
29952996
),
29962997
'phabricator-object-item-list-view-css' =>
29972998
array(
2998-
'uri' => '/res/aa09c531/rsrc/css/layout/phabricator-object-item-list-view.css',
2999+
'uri' => '/res/7d35d590/rsrc/css/layout/phabricator-object-item-list-view.css',
29993000
'type' => 'css',
30003001
'requires' =>
30013002
array(
@@ -3693,7 +3694,7 @@
36933694
), array(
36943695
'packages' =>
36953696
array(
3696-
'6c294512' =>
3697+
'a56848af' =>
36973698
array(
36983699
'name' => 'core.pkg.css',
36993700
'symbols' =>
@@ -3735,7 +3736,7 @@
37353736
34 => 'phabricator-object-item-list-view-css',
37363737
35 => 'global-drag-and-drop-css',
37373738
),
3738-
'uri' => '/res/pkg/6c294512/core.pkg.css',
3739+
'uri' => '/res/pkg/a56848af/core.pkg.css',
37393740
'type' => 'css',
37403741
),
37413742
'95ceba95' =>
@@ -3895,7 +3896,7 @@
38953896
'uri' => '/res/pkg/fe22443b/javelin.pkg.js',
38963897
'type' => 'js',
38973898
),
3898-
'c41b4907' =>
3899+
'6b1fccc6' =>
38993900
array(
39003901
'name' => 'maniphest.pkg.css',
39013902
'symbols' =>
@@ -3905,10 +3906,10 @@
39053906
2 => 'aphront-attached-file-view-css',
39063907
3 => 'phabricator-project-tag-css',
39073908
),
3908-
'uri' => '/res/pkg/c41b4907/maniphest.pkg.css',
3909+
'uri' => '/res/pkg/6b1fccc6/maniphest.pkg.css',
39093910
'type' => 'css',
39103911
),
3911-
'7707de41' =>
3912+
'f85eb6d8' =>
39123913
array(
39133914
'name' => 'maniphest.pkg.js',
39143915
'symbols' =>
@@ -3919,23 +3920,23 @@
39193920
3 => 'javelin-behavior-maniphest-transaction-expand',
39203921
4 => 'javelin-behavior-maniphest-subpriority-editor',
39213922
),
3922-
'uri' => '/res/pkg/7707de41/maniphest.pkg.js',
3923+
'uri' => '/res/pkg/f85eb6d8/maniphest.pkg.js',
39233924
'type' => 'js',
39243925
),
39253926
),
39263927
'reverse' =>
39273928
array(
3928-
'aphront-attached-file-view-css' => 'c41b4907',
3929-
'aphront-dialog-view-css' => '6c294512',
3930-
'aphront-error-view-css' => '6c294512',
3931-
'aphront-form-view-css' => '6c294512',
3932-
'aphront-list-filter-view-css' => '6c294512',
3933-
'aphront-pager-view-css' => '6c294512',
3934-
'aphront-panel-view-css' => '6c294512',
3935-
'aphront-table-view-css' => '6c294512',
3936-
'aphront-tokenizer-control-css' => '6c294512',
3937-
'aphront-tooltip-css' => '6c294512',
3938-
'aphront-typeahead-control-css' => '6c294512',
3929+
'aphront-attached-file-view-css' => '6b1fccc6',
3930+
'aphront-dialog-view-css' => 'a56848af',
3931+
'aphront-error-view-css' => 'a56848af',
3932+
'aphront-form-view-css' => 'a56848af',
3933+
'aphront-list-filter-view-css' => 'a56848af',
3934+
'aphront-pager-view-css' => 'a56848af',
3935+
'aphront-panel-view-css' => 'a56848af',
3936+
'aphront-table-view-css' => 'a56848af',
3937+
'aphront-tokenizer-control-css' => 'a56848af',
3938+
'aphront-tooltip-css' => 'a56848af',
3939+
'aphront-typeahead-control-css' => 'a56848af',
39393940
'differential-changeset-view-css' => '8aaacd1b',
39403941
'differential-core-view-css' => '8aaacd1b',
39413942
'differential-inline-comment-editor' => '322728f3',
@@ -3949,7 +3950,7 @@
39493950
'differential-table-of-contents-css' => '8aaacd1b',
39503951
'diffusion-commit-view-css' => 'c8ce2d88',
39513952
'diffusion-icons-css' => 'c8ce2d88',
3952-
'global-drag-and-drop-css' => '6c294512',
3953+
'global-drag-and-drop-css' => 'a56848af',
39533954
'inline-comment-summary-css' => '8aaacd1b',
39543955
'javelin-aphlict' => '95ceba95',
39553956
'javelin-behavior' => 'fe22443b',
@@ -3982,11 +3983,11 @@
39823983
'javelin-behavior-konami' => '95ceba95',
39833984
'javelin-behavior-lightbox-attachments' => '95ceba95',
39843985
'javelin-behavior-load-blame' => '322728f3',
3985-
'javelin-behavior-maniphest-batch-selector' => '7707de41',
3986-
'javelin-behavior-maniphest-subpriority-editor' => '7707de41',
3987-
'javelin-behavior-maniphest-transaction-controls' => '7707de41',
3988-
'javelin-behavior-maniphest-transaction-expand' => '7707de41',
3989-
'javelin-behavior-maniphest-transaction-preview' => '7707de41',
3986+
'javelin-behavior-maniphest-batch-selector' => 'f85eb6d8',
3987+
'javelin-behavior-maniphest-subpriority-editor' => 'f85eb6d8',
3988+
'javelin-behavior-maniphest-transaction-controls' => 'f85eb6d8',
3989+
'javelin-behavior-maniphest-transaction-expand' => 'f85eb6d8',
3990+
'javelin-behavior-maniphest-transaction-preview' => 'f85eb6d8',
39903991
'javelin-behavior-phabricator-active-nav' => '95ceba95',
39913992
'javelin-behavior-phabricator-autofocus' => '95ceba95',
39923993
'javelin-behavior-phabricator-gesture' => '95ceba95',
@@ -4021,48 +4022,48 @@
40214022
'javelin-util' => 'fe22443b',
40224023
'javelin-vector' => 'fe22443b',
40234024
'javelin-workflow' => 'fe22443b',
4024-
'lightbox-attachment-css' => '6c294512',
4025-
'maniphest-task-summary-css' => 'c41b4907',
4026-
'maniphest-transaction-detail-css' => 'c41b4907',
4025+
'lightbox-attachment-css' => 'a56848af',
4026+
'maniphest-task-summary-css' => '6b1fccc6',
4027+
'maniphest-transaction-detail-css' => '6b1fccc6',
40274028
'phabricator-busy' => '95ceba95',
40284029
'phabricator-content-source-view-css' => '8aaacd1b',
4029-
'phabricator-core-buttons-css' => '6c294512',
4030-
'phabricator-core-css' => '6c294512',
4031-
'phabricator-crumbs-view-css' => '6c294512',
4032-
'phabricator-directory-css' => '6c294512',
4030+
'phabricator-core-buttons-css' => 'a56848af',
4031+
'phabricator-core-css' => 'a56848af',
4032+
'phabricator-crumbs-view-css' => 'a56848af',
4033+
'phabricator-directory-css' => 'a56848af',
40334034
'phabricator-drag-and-drop-file-upload' => '322728f3',
40344035
'phabricator-dropdown-menu' => '95ceba95',
40354036
'phabricator-file-upload' => '95ceba95',
4036-
'phabricator-filetree-view-css' => '6c294512',
4037-
'phabricator-flag-css' => '6c294512',
4038-
'phabricator-form-view-css' => '6c294512',
4039-
'phabricator-header-view-css' => '6c294512',
4040-
'phabricator-jump-nav' => '6c294512',
4037+
'phabricator-filetree-view-css' => 'a56848af',
4038+
'phabricator-flag-css' => 'a56848af',
4039+
'phabricator-form-view-css' => 'a56848af',
4040+
'phabricator-header-view-css' => 'a56848af',
4041+
'phabricator-jump-nav' => 'a56848af',
40414042
'phabricator-keyboard-shortcut' => '95ceba95',
40424043
'phabricator-keyboard-shortcut-manager' => '95ceba95',
4043-
'phabricator-main-menu-view' => '6c294512',
4044+
'phabricator-main-menu-view' => 'a56848af',
40444045
'phabricator-menu-item' => '95ceba95',
4045-
'phabricator-nav-view-css' => '6c294512',
4046+
'phabricator-nav-view-css' => 'a56848af',
40464047
'phabricator-notification' => '95ceba95',
4047-
'phabricator-notification-css' => '6c294512',
4048-
'phabricator-notification-menu-css' => '6c294512',
4049-
'phabricator-object-item-list-view-css' => '6c294512',
4048+
'phabricator-notification-css' => 'a56848af',
4049+
'phabricator-notification-menu-css' => 'a56848af',
4050+
'phabricator-object-item-list-view-css' => 'a56848af',
40504051
'phabricator-object-selector-css' => '8aaacd1b',
40514052
'phabricator-paste-file-upload' => '95ceba95',
40524053
'phabricator-prefab' => '95ceba95',
4053-
'phabricator-project-tag-css' => 'c41b4907',
4054-
'phabricator-remarkup-css' => '6c294512',
4054+
'phabricator-project-tag-css' => '6b1fccc6',
4055+
'phabricator-remarkup-css' => 'a56848af',
40554056
'phabricator-shaped-request' => '322728f3',
4056-
'phabricator-side-menu-view-css' => '6c294512',
4057-
'phabricator-standard-page-view' => '6c294512',
4057+
'phabricator-side-menu-view-css' => 'a56848af',
4058+
'phabricator-standard-page-view' => 'a56848af',
40584059
'phabricator-textareautils' => '95ceba95',
40594060
'phabricator-tooltip' => '95ceba95',
4060-
'phabricator-transaction-view-css' => '6c294512',
4061-
'phabricator-zindex-css' => '6c294512',
4062-
'sprite-apps-large-css' => '6c294512',
4063-
'sprite-gradient-css' => '6c294512',
4064-
'sprite-icon-css' => '6c294512',
4065-
'sprite-menu-css' => '6c294512',
4066-
'syntax-highlighting-css' => '6c294512',
4061+
'phabricator-transaction-view-css' => 'a56848af',
4062+
'phabricator-zindex-css' => 'a56848af',
4063+
'sprite-apps-large-css' => 'a56848af',
4064+
'sprite-gradient-css' => 'a56848af',
4065+
'sprite-icon-css' => 'a56848af',
4066+
'sprite-menu-css' => 'a56848af',
4067+
'syntax-highlighting-css' => 'a56848af',
40674068
),
40684069
));

src/applications/maniphest/controller/ManiphestSubpriorityController.php

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ final class ManiphestSubpriorityController extends ManiphestController {
77

88
public function processRequest() {
99
$request = $this->getRequest();
10+
$user = $request->getUser();
1011

1112
if (!$request->validateCSRF()) {
1213
return new Aphront403Response();
@@ -50,15 +51,26 @@ public function processRequest() {
5051
$task->setSubpriority($new_sub);
5152
$task->save();
5253

53-
$pri_class = ManiphestTaskSummaryView::getPriorityClass(
54-
$task->getPriority());
55-
$class = 'maniphest-task-handle maniphest-active-handle '.$pri_class;
54+
$phids = $task->getProjectPHIDs();
55+
if ($task->getOwnerPHID()) {
56+
$phids[] = $task->getOwnerPHID();
57+
}
58+
59+
$handles = id(new PhabricatorObjectHandleData($phids))
60+
->setViewer($user)
61+
->loadHandles();
5662

57-
$response = array(
58-
'className' => $class,
59-
);
63+
$view = id(new ManiphestTaskListView())
64+
->setUser($user)
65+
->setShowSubpriorityControls(true)
66+
->setShowBatchControls(true)
67+
->setHandles($handles)
68+
->setTasks(array($task));
6069

61-
return id(new AphrontAjaxResponse())->setContent($response);
70+
return id(new AphrontAjaxResponse())->setContent(
71+
array(
72+
'tasks' => $view,
73+
));
6274
}
6375

6476
}

src/applications/maniphest/controller/ManiphestTaskListController.php

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -378,23 +378,12 @@ public function processRequest() {
378378
$selector->appendChild($lists);
379379
$selector->appendChild($this->renderBatchEditor($query));
380380

381-
$form_id = celerity_generate_unique_node_id();
382-
$selector = phabricator_form(
383-
$user,
384-
array(
385-
'method' => 'POST',
386-
'action' => '/maniphest/batch/',
387-
'id' => $form_id,
388-
),
389-
$selector->render());
390-
391381
$list_container->appendChild($selector);
392382
$list_container->appendChild($pager);
393383

394384
Javelin::initBehavior(
395385
'maniphest-subpriority-editor',
396386
array(
397-
'root' => $form_id,
398387
'uri' => '/maniphest/subpriority/',
399388
));
400389
}
@@ -644,13 +633,17 @@ public static function loadTasks(
644633
}
645634

646635
private function renderBatchEditor(PhabricatorSearchQuery $search_query) {
636+
$user = $this->getRequest()->getUser();
637+
647638
Javelin::initBehavior(
648639
'maniphest-batch-selector',
649640
array(
650641
'selectAll' => 'batch-select-all',
651642
'selectNone' => 'batch-select-none',
652643
'submit' => 'batch-select-submit',
653644
'status' => 'batch-select-status-cell',
645+
'idContainer' => 'batch-select-id-container',
646+
'formID' => 'batch-select-form',
654647
));
655648

656649
$select_all = javelin_tag(
@@ -690,24 +683,43 @@ private function renderBatchEditor(PhabricatorSearchQuery $search_query) {
690683
),
691684
pht('Export to Excel'));
692685

693-
return hsprintf(
686+
$hidden = phutil_tag(
687+
'div',
688+
array(
689+
'id' => 'batch-select-id-container',
690+
),
691+
'');
692+
693+
$editor = hsprintf(
694694
'<div class="maniphest-batch-editor">'.
695695
'<div class="batch-editor-header">%s</div>'.
696696
'<table class="maniphest-batch-editor-layout">'.
697697
'<tr>'.
698698
'<td>%s%s</td>'.
699699
'<td>%s</td>'.
700700
'<td id="batch-select-status-cell">%s</td>'.
701-
'<td class="batch-select-submit-cell">%s</td>'.
701+
'<td class="batch-select-submit-cell">%s%s</td>'.
702702
'</tr>'.
703703
'</table>'.
704-
'</table>',
704+
'</div>',
705705
pht('Batch Task Editor'),
706706
$select_all,
707707
$select_none,
708708
$export,
709-
pht('0 Selected'),
710-
$submit);
709+
'',
710+
$submit,
711+
$hidden);
712+
713+
$editor = phabricator_form(
714+
$user,
715+
array(
716+
'method' => 'POST',
717+
'action' => '/maniphest/batch/',
718+
'id' => 'batch-select-form',
719+
),
720+
$editor);
721+
722+
return $editor;
711723
}
712724

713725
private function buildQueryFromRequest() {

0 commit comments

Comments
 (0)