1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 04:20:55 +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() return $this->newPage()
->setTitle( ->setTitle(
array( array(
$project->getDisplayName(),
pht('Workboard'), pht('Workboard'),
$project->getName(),
)) ))
->setNavigation($nav) ->setNavigation($nav)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
@ -371,7 +371,11 @@ final class PhabricatorProjectBoardViewController
$crumbs->addAction($manage_menu); $crumbs->addAction($manage_menu);
return $this->newPage() return $this->newPage()
->setTitle(pht('%s Board', $project->getName())) ->setTitle(
array(
$project->getDisplayName(),
pht('Workboard'),
))
->setPageObjectPHIDs(array($project->getPHID())) ->setPageObjectPHIDs(array($project->getPHID()))
->setShowFooter(false) ->setShowFooter(false)
->setNavigation($nav) ->setNavigation($nav)

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -490,6 +490,20 @@ final class PhabricatorProject extends PhabricatorProjectDAO
return $number; 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() { public function getDisplayIconKey() {
if ($this->isMilestone()) { if ($this->isMilestone()) {
$key = PhabricatorProjectIconSet::getMilestoneIconKey(); $key = PhabricatorProjectIconSet::getMilestoneIconKey();

View file

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