1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 21:40:55 +01:00

Don't render a grip on tasks returned over AJAX to non-draggable UIs

Summary:
Fixes T5140. When you ajax-edit a task and we send back a full-size card, we currently always put a drag grip on it.

If you clicked the "edit" thing from a priority-ordered list, this is appropriate. However, if you clicked it from some other type of list, it is not.

Pass the expected grippableness through the call.

Test Plan:
  - Edited a task from a reorderable (priority-ordered) view, got grip.
  - Edited a task from a nonreorderable (author-ordered) view, got no grip.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T5140

Differential Revision: https://secure.phabricator.com/D10282
This commit is contained in:
epriestley 2014-08-16 11:12:43 -07:00
parent 26f283fe21
commit 98a847a36c
3 changed files with 9 additions and 3 deletions

View file

@ -44,7 +44,8 @@ abstract class ManiphestController extends PhabricatorController {
}
protected function renderSingleTask(ManiphestTask $task) {
$user = $this->getRequest()->getUser();
$request = $this->getRequest();
$user = $request->getUser();
$phids = $task->getProjectPHIDs();
if ($task->getOwnerPHID()) {
@ -58,7 +59,7 @@ abstract class ManiphestController extends PhabricatorController {
$view = id(new ManiphestTaskListView())
->setUser($user)
->setShowSubpriorityControls(true)
->setShowSubpriorityControls(!$request->getStr('ungrippable'))
->setShowBatchControls(true)
->setHandles($handles)
->setTasks(array($task));

View file

@ -547,6 +547,7 @@ final class ManiphestTaskEditController extends ManiphestController {
->addHiddenInput('template', $template_id)
->addHiddenInput('responseType', $response_type)
->addHiddenInput('order', $order)
->addHiddenInput('ungrippable', $request->getStr('ungrippable'))
->addHiddenInput('columnPHID', $request->getStr('columnPHID'));
if ($parent_task) {

View file

@ -90,11 +90,15 @@ final class ManiphestTaskListView extends ManiphestView {
));
if ($this->showBatchControls) {
$href = new PhutilURI('/maniphest/task/edit/'.$task->getID().'/');
if (!$this->showSubpriorityControls) {
$href->setQueryParam('ungrippable', 'true');
}
$item->addAction(
id(new PHUIListItemView())
->setIcon('fa-pencil')
->addSigil('maniphest-edit-task')
->setHref('/maniphest/task/edit/'.$task->getID().'/'));
->setHref($href));
}
$list->addItem($item);