1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 21:02:41 +01:00

Fix dead column link and provide more milestone UI context

Summary:
Fixes T10287. Ref T10286.

  - Link stuff properly.
  - Generally, show "Parent (Milestone)" instead of "Milestone".
  - This probably doesn't get 100% of `getName()` -> `getDisplayName()` swaps, but we can get those as we catch them.

Test Plan: See T10286. Also clicked stuff.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10286, T10287

Differential Revision: https://secure.phabricator.com/D15189
This commit is contained in:
epriestley 2016-02-05 12:17:35 -08:00
parent 8e7e999cc3
commit 5092bcf533
8 changed files with 33 additions and 9 deletions

View file

@ -149,8 +149,8 @@ final class PhabricatorProjectBoardViewController
return $this->newPage()
->setTitle(
array(
$project->getDisplayName(),
pht('Workboard'),
$project->getName(),
))
->setNavigation($nav)
->setCrumbs($crumbs)
@ -371,7 +371,11 @@ final class PhabricatorProjectBoardViewController
$crumbs->addAction($manage_menu);
return $this->newPage()
->setTitle(pht('%s Board', $project->getName()))
->setTitle(
array(
$project->getDisplayName(),
pht('Workboard'),
))
->setPageObjectPHIDs(array($project->getPHID()))
->setShowFooter(false)
->setNavigation($nav)

View file

@ -51,7 +51,11 @@ final class PhabricatorProjectManageController
return $this->newPage()
->setNavigation($nav)
->setCrumbs($crumbs)
->setTitle($project->getName())
->setTitle(
array(
$project->getDisplayName(),
pht('Manage'),
))
->appendChild(
array(
$object_box,

View file

@ -48,7 +48,7 @@ final class PhabricatorProjectMembersViewController
return $this->newPage()
->setNavigation($nav)
->setCrumbs($crumbs)
->setTitle(array($project->getName(), $title))
->setTitle(array($project->getDisplayName(), $title))
->appendChild(
array(
$object_box,

View file

@ -115,7 +115,7 @@ final class PhabricatorProjectProfileController
return $this->newPage()
->setNavigation($nav)
->setCrumbs($crumbs)
->setTitle($project->getName())
->setTitle($project->getDisplayName())
->setPageObjectPHIDs(array($project->getPHID()))
->appendChild(
array(

View file

@ -67,11 +67,13 @@ final class PhabricatorProjectUIEventListener
$annotation = array();
foreach ($columns as $column) {
$project_id = $column->getProject()->getID();
$column_name = pht('(%s)', $column->getDisplayName());
$column_link = phutil_tag(
'a',
array(
'href' => $handle->getURI().'board/',
'href' => "/project/board/{$project_id}/",
'class' => 'maniphest-board-link',
),
$column_name);

View file

@ -37,7 +37,7 @@ final class PhabricatorProjectProjectPHIDType extends PhabricatorPHIDType {
foreach ($handles as $phid => $handle) {
$project = $objects[$phid];
$name = $project->getName();
$name = $project->getDisplayName();
$id = $project->getID();
$slug = $project->getPrimarySlug();

View file

@ -490,6 +490,20 @@ final class PhabricatorProject extends PhabricatorProjectDAO
return $number;
}
public function getDisplayName() {
$name = $this->getName();
// If this is a milestone, show it as "Parent > Sprint 99".
if ($this->isMilestone()) {
$name = pht(
'%s (%s)',
$this->getParentProject()->getName(),
$name);
}
return $name;
}
public function getDisplayIconKey() {
if ($this->isMilestone()) {
$key = PhabricatorProjectIconSet::getMilestoneIconKey();

View file

@ -64,12 +64,12 @@ final class PhabricatorProjectDatasource
}
$all_strings = mpull($proj->getSlugs(), 'getSlug');
$all_strings[] = $proj->getName();
$all_strings[] = $proj->getDisplayName();
$all_strings = implode(' ', $all_strings);
$proj_result = id(new PhabricatorTypeaheadResult())
->setName($all_strings)
->setDisplayName($proj->getName())
->setDisplayName($proj->getDisplayName())
->setDisplayType(pht('Project'))
->setURI($proj->getURI())
->setPHID($proj->getPHID())