@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

When creating or editing a card on a sorted/grouped workboard, adjust headers appropriately

Summary:
Depends on D20270. Ref T10333. If you create a task with a new owner, or edit a task and change the priority/owner, we want to move it (and possibly create a new header) when the response comes back.

Make sure the response includes the appropriate details about the object's header and position.

Test Plan:
- Grouped by Owner.
- Created a new task with a new owner, saw the header appear.
- Edited a task and changed it to give it a new owner, saw the header appear.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T10333

Differential Revision: https://secure.phabricator.com/D20271

+22 -45
-23
src/applications/maniphest/controller/ManiphestController.php
··· 37 37 return $crumbs; 38 38 } 39 39 40 - public function renderSingleTask(ManiphestTask $task) { 41 - $request = $this->getRequest(); 42 - $user = $request->getUser(); 43 - 44 - $phids = $task->getProjectPHIDs(); 45 - if ($task->getOwnerPHID()) { 46 - $phids[] = $task->getOwnerPHID(); 47 - } 48 - 49 - $handles = id(new PhabricatorHandleQuery()) 50 - ->setViewer($user) 51 - ->withPHIDs($phids) 52 - ->execute(); 53 - 54 - $view = id(new ManiphestTaskListView()) 55 - ->setUser($user) 56 - ->setShowBatchControls(true) 57 - ->setHandles($handles) 58 - ->setTasks(array($task)); 59 - 60 - return $view; 61 - } 62 - 63 40 final protected function newTaskGraphDropdownMenu( 64 41 ManiphestTask $task, 65 42 $has_parents,
+22 -22
src/applications/maniphest/editor/ManiphestEditEngine.php
··· 379 379 $object, 380 380 array $xactions) { 381 381 382 - if ($request->isAjax()) { 382 + $response_type = $request->getStr('responseType'); 383 + $is_card = ($response_type === 'card'); 384 + 385 + if ($is_card) { 383 386 // Reload the task to make sure we pick up the final task state. 384 387 $viewer = $this->getViewer(); 385 388 $task = id(new ManiphestTaskQuery()) ··· 389 392 ->needProjectPHIDs(true) 390 393 ->executeOne(); 391 394 392 - switch ($request->getStr('responseType')) { 393 - case 'card': 394 - return $this->buildCardResponse($task); 395 - default: 396 - return $this->buildListResponse($task); 397 - } 398 - 395 + return $this->buildCardResponse($task); 399 396 } 400 397 401 398 return parent::newEditResponse($request, $object, $xactions); 402 399 } 403 400 404 - private function buildListResponse(ManiphestTask $task) { 405 - $controller = $this->getController(); 406 - 407 - $payload = array( 408 - 'tasks' => $controller->renderSingleTask($task), 409 - 'data' => array(), 410 - ); 411 - 412 - return id(new AphrontAjaxResponse())->setContent($payload); 413 - } 414 - 415 401 private function buildCardResponse(ManiphestTask $task) { 416 402 $controller = $this->getController(); 417 403 $request = $controller->getRequest(); ··· 435 421 $board_phid = $column->getProjectPHID(); 436 422 $object_phid = $task->getPHID(); 437 423 438 - return id(new PhabricatorBoardResponseEngine()) 424 + $order = $request->getStr('order'); 425 + if ($order) { 426 + $ordering = PhabricatorProjectColumnOrder::getOrderByKey($order); 427 + $ordering = id(clone $ordering) 428 + ->setViewer($viewer); 429 + } else { 430 + $ordering = null; 431 + } 432 + 433 + $engine = id(new PhabricatorBoardResponseEngine()) 439 434 ->setViewer($viewer) 440 435 ->setBoardPHID($board_phid) 441 436 ->setObjectPHID($object_phid) 442 - ->setVisiblePHIDs($visible_phids) 443 - ->buildResponse(); 437 + ->setVisiblePHIDs($visible_phids); 438 + 439 + if ($ordering) { 440 + $engine->setOrdering($ordering); 441 + } 442 + 443 + return $engine->buildResponse(); 444 444 } 445 445 446 446 private function getColumnMap(ManiphestTask $task) {