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
This commit is contained in:
@@ -7,6 +7,7 @@ final class ManiphestSubpriorityController extends ManiphestController {
|
||||
|
||||
public function processRequest() {
|
||||
$request = $this->getRequest();
|
||||
$user = $request->getUser();
|
||||
|
||||
if (!$request->validateCSRF()) {
|
||||
return new Aphront403Response();
|
||||
@@ -50,15 +51,26 @@ final class ManiphestSubpriorityController extends ManiphestController {
|
||||
$task->setSubpriority($new_sub);
|
||||
$task->save();
|
||||
|
||||
$pri_class = ManiphestTaskSummaryView::getPriorityClass(
|
||||
$task->getPriority());
|
||||
$class = 'maniphest-task-handle maniphest-active-handle '.$pri_class;
|
||||
$phids = $task->getProjectPHIDs();
|
||||
if ($task->getOwnerPHID()) {
|
||||
$phids[] = $task->getOwnerPHID();
|
||||
}
|
||||
|
||||
$response = array(
|
||||
'className' => $class,
|
||||
);
|
||||
$handles = id(new PhabricatorObjectHandleData($phids))
|
||||
->setViewer($user)
|
||||
->loadHandles();
|
||||
|
||||
return id(new AphrontAjaxResponse())->setContent($response);
|
||||
$view = id(new ManiphestTaskListView())
|
||||
->setUser($user)
|
||||
->setShowSubpriorityControls(true)
|
||||
->setShowBatchControls(true)
|
||||
->setHandles($handles)
|
||||
->setTasks(array($task));
|
||||
|
||||
return id(new AphrontAjaxResponse())->setContent(
|
||||
array(
|
||||
'tasks' => $view,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user