1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 05:50:55 +01:00

Put "Subprojects" on top of "Milestones" in the Project UI

Summary:
Depends on D19550. Ref T13164. See T12144#226172, mostly. We get some requests to make milestones reorderable, but in most cases users probably wanted subprojects, not milestones.

One reason to end up here is that we put "Milestones" on top. Instead, put "Subprojects" on top, since they're the less specialized option and we aren't terribly consistent about it anyway.

Test Plan: Viewed project subprojects page, saw "Subprojects" above "Milestones".

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13164

Differential Revision: https://secure.phabricator.com/D19551
This commit is contained in:
epriestley 2018-07-30 15:59:39 -07:00
parent 45babe82f3
commit 96e3c73159

View file

@ -106,8 +106,8 @@ final class PhabricatorProjectSubprojectsController
->addClass('project-view-people-home')
->setMainColumn(array(
$info_view,
$milestone_list,
$subproject_list,
$milestone_list,
));
return $this->newPage()
@ -132,28 +132,11 @@ final class PhabricatorProjectSubprojectsController
$project,
PhabricatorPolicyCapability::CAN_EDIT);
$allows_milestones = $project->supportsMilestones();
$allows_subprojects = $project->supportsSubprojects();
$allows_milestones = $project->supportsMilestones();
$curtain = $this->newCurtainView();
if ($allows_milestones && $milestones) {
$milestone_text = pht('Create Next Milestone');
} else {
$milestone_text = pht('Create Milestone');
}
$can_milestone = ($can_create && $can_edit && $allows_milestones);
$milestone_href = "/project/edit/?milestone={$id}";
$curtain->addAction(
id(new PhabricatorActionView())
->setName($milestone_text)
->setIcon('fa-plus')
->setHref($milestone_href)
->setDisabled(!$can_milestone)
->setWorkflow(!$can_milestone));
$can_subproject = ($can_create && $can_edit && $allows_subprojects);
// If we're offering to create the first subproject, we're going to warn
@ -176,22 +159,22 @@ final class PhabricatorProjectSubprojectsController
->setDisabled($subproject_disabled)
->setWorkflow($subproject_workflow));
if (!$project->supportsMilestones()) {
$note = pht(
'This project is already a milestone, and milestones may not '.
'have their own milestones.');
if ($allows_milestones && $milestones) {
$milestone_text = pht('Create Next Milestone');
} else {
if (!$milestones) {
$note = pht('Milestones can be created for this project.');
} else {
$note = pht('This project has milestones.');
}
$milestone_text = pht('Create Milestone');
}
$curtain->newPanel()
->setHeaderText(pht('Milestones'))
->appendChild($note);
$can_milestone = ($can_create && $can_edit && $allows_milestones);
$milestone_href = "/project/edit/?milestone={$id}";
$curtain->addAction(
id(new PhabricatorActionView())
->setName($milestone_text)
->setIcon('fa-plus')
->setHref($milestone_href)
->setDisabled(!$can_milestone)
->setWorkflow(!$can_milestone));
if (!$project->supportsSubprojects()) {
$note = pht(
@ -209,6 +192,22 @@ final class PhabricatorProjectSubprojectsController
->setHeaderText(pht('Subprojects'))
->appendChild($note);
if (!$project->supportsSubprojects()) {
$note = pht(
'This project is already a milestone, and milestones may not '.
'have their own milestones.');
} else {
if (!$milestones) {
$note = pht('Milestones can be created for this project.');
} else {
$note = pht('This project has milestones.');
}
}
$curtain->newPanel()
->setHeaderText(pht('Milestones'))
->appendChild($note);
return $curtain;
}