From 96e3c73159e602493c100ecf1bce14561c21c9c4 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 30 Jul 2018 15:59:39 -0700 Subject: [PATCH] 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 --- ...habricatorProjectSubprojectsController.php | 63 +++++++++---------- 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/src/applications/project/controller/PhabricatorProjectSubprojectsController.php b/src/applications/project/controller/PhabricatorProjectSubprojectsController.php index 269e80a080..36736c78ba 100644 --- a/src/applications/project/controller/PhabricatorProjectSubprojectsController.php +++ b/src/applications/project/controller/PhabricatorProjectSubprojectsController.php @@ -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; }