Roughly implement milestone columns on workboards
Summary:
Ref T10010. These aren't perfect but I think (?) they aren't horribly broken.
- When a project is a parent project, destroy (as far as the user can tell) any custom columns.
- When a project has milestones, automatically generate columns on the project's workboard (if it has a workboard).
- When you move tasks between milestones, add the proper milestone tag.
- When you move tasks out of milestones back into the backlog, add the proper parent project tag.
- (Plenty of UI / design stuff to adjust.)
Test Plan:
- Dragged stuff between milestone columns.
- Used a normal workboard.
- Wasn't able to find any egregiously bad cases that did anything terrible.
{F1088224}
Reviewers: chad
Reviewed By: chad
Maniphest Tasks: T10010
Differential Revision: https://secure.phabricator.com/D15171
This commit is contained in:
@@ -139,7 +139,33 @@ final class PhabricatorProjectMoveController
|
||||
->setTransactionType(ManiphestTransaction::TYPE_SUBPRIORITY)
|
||||
->setNewValue($sub);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$proxy = $column->getProxy();
|
||||
if ($proxy) {
|
||||
// We're moving the task into a subproject or milestone column, so add
|
||||
// the subproject or milestone.
|
||||
$add_projects = array($proxy->getPHID());
|
||||
} else if ($project->getHasSubprojects() || $project->getHasMilestones()) {
|
||||
// We're moving the task into the "Backlog" column on the parent project,
|
||||
// so add the parent explicitly. This gets rid of any subproject or
|
||||
// milestone tags.
|
||||
$add_projects = array($project->getPHID());
|
||||
} else {
|
||||
$add_projects = array();
|
||||
}
|
||||
|
||||
if ($add_projects) {
|
||||
$project_type = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST;
|
||||
|
||||
$xactions[] = id(new ManiphestTransaction())
|
||||
->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
|
||||
->setMetadataValue('edge:type', $project_type)
|
||||
->setNewValue(
|
||||
array(
|
||||
'+' => array_fuse($add_projects),
|
||||
));
|
||||
}
|
||||
|
||||
$editor = id(new ManiphestTransactionEditor())
|
||||
->setActor($viewer)
|
||||
@@ -157,6 +183,18 @@ final class PhabricatorProjectMoveController
|
||||
->executeOne();
|
||||
}
|
||||
|
||||
// Reload the object so it reflects edits which have been applied.
|
||||
$object = id(new ManiphestTaskQuery())
|
||||
->setViewer($viewer)
|
||||
->withPHIDs(array($object_phid))
|
||||
->needProjectPHIDs(true)
|
||||
->requireCapabilities(
|
||||
array(
|
||||
PhabricatorPolicyCapability::CAN_VIEW,
|
||||
PhabricatorPolicyCapability::CAN_EDIT,
|
||||
))
|
||||
->executeOne();
|
||||
|
||||
$card = id(new ProjectBoardTaskCard())
|
||||
->setViewer($viewer)
|
||||
->setTask($object)
|
||||
@@ -169,6 +207,6 @@ final class PhabricatorProjectMoveController
|
||||
|
||||
return id(new AphrontAjaxResponse())->setContent(
|
||||
array('task' => $card));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user