Maniphest - move subpriority edits to be transaction powered
Summary: ...this was nice to do for boards, since this diff also starts calling this code in the board move case. The big trick is to use the new expandTransactions hook to expand the subpriority transaction into a priority transaction if pertinent. The other stuff is just about hiding these new subpriority extractions. ...also removes the "edit" UI from the default board since we can't actually edit anything and it thus is buggy. Ref T4422. Next step is to move board edits into the editor with their own little transaction. Test Plan: re-orded tasks on a maniphest query, reloaded, and noted re-order stuck. Reviewers: epriestley Reviewed By: epriestley CC: Korvin, epriestley, aran Maniphest Tasks: T4422 Differential Revision: https://secure.phabricator.com/D8358
This commit is contained in:
@@ -72,8 +72,31 @@ final class PhabricatorProjectMoveController
|
||||
$column_phid,
|
||||
$edge_phids);
|
||||
|
||||
// TODO: We also need to deal with priorities, so far this only gets stuff
|
||||
// in the correct column.
|
||||
if ($after_phid) {
|
||||
$after_task = id(new ManiphestTaskQuery())
|
||||
->setViewer($viewer)
|
||||
->withPHIDs(array($after_phid))
|
||||
->requireCapabilities(array(PhabricatorPolicyCapability::CAN_EDIT))
|
||||
->executeOne();
|
||||
if (!$after_task) {
|
||||
return new Aphront404Response();
|
||||
}
|
||||
$after_pri = $after_task->getPriority();
|
||||
$after_sub = $after_task->getSubpriority();
|
||||
|
||||
$xactions = array(id(new ManiphestTransaction())
|
||||
->setTransactionType(ManiphestTransaction::TYPE_SUBPRIORITY)
|
||||
->setNewValue(array(
|
||||
'newPriority' => $after_pri,
|
||||
'newSubpriorityBase' => $after_sub)));
|
||||
$editor = id(new ManiphestTransactionEditor())
|
||||
->setActor($viewer)
|
||||
->setContinueOnMissingFields(true)
|
||||
->setContinueOnNoEffect(true)
|
||||
->setContentSourceFromRequest($request);
|
||||
|
||||
$editor->applyTransactions($object, $xactions);
|
||||
}
|
||||
|
||||
return id(new AphrontAjaxResponse())->setContent(array());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user