@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

On workboards, link ancestor project breadcrumbs to their workboards

Summary:
Ref T13269. Currently, if you're on a milestone workboard like this:

> Projects > Parent > Milestone > Workboard

The "Parent" link goes to the parent profile. More often, I want it to go to the parent workboard. Try doing that? This is kind of one-off but I suspect it's a better rule.

Also, consolidate one billion manual constructions of "/board/" URIs.

Test Plan: Viewed a milestone workboard, clicked the parent link, ended up on the parent workboard.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13269

Differential Revision: https://secure.phabricator.com/D20331

+47 -25
+1 -2
src/applications/maniphest/editor/ManiphestTransactionEditor.php
··· 243 243 foreach ($projects as $project) { 244 244 $body->addLinkSection( 245 245 pht('WORKBOARD'), 246 - PhabricatorEnv::getProductionURI( 247 - '/project/board/'.$project->getID().'/')); 246 + PhabricatorEnv::getProductionURI($project->getWorkboardURI())); 248 247 } 249 248 } 250 249
+1 -1
src/applications/project/controller/PhabricatorProjectBoardBackgroundController.php
··· 55 55 $nav = $this->getProfileMenu(); 56 56 57 57 $crumbs = id($this->buildApplicationCrumbs()) 58 - ->addTextCrumb(pht('Workboard'), "/project/board/{$board_id}/") 58 + ->addTextCrumb(pht('Workboard'), $board->getWorkboardURI()) 59 59 ->addTextCrumb(pht('Manage'), $manage_uri) 60 60 ->addTextCrumb(pht('Background Color')); 61 61
+1 -1
src/applications/project/controller/PhabricatorProjectBoardManageController.php
··· 34 34 $curtain = $this->buildCurtainView($board); 35 35 36 36 $crumbs = $this->buildApplicationCrumbs(); 37 - $crumbs->addTextCrumb(pht('Workboard'), "/project/board/{$board_id}/"); 37 + $crumbs->addTextCrumb(pht('Workboard'), $board->getWorkboardURI()); 38 38 $crumbs->addTextCrumb(pht('Manage')); 39 39 $crumbs->setBorder(true); 40 40
+1 -1
src/applications/project/controller/PhabricatorProjectBoardViewController.php
··· 726 726 ->setType(PHUIListItemView::TYPE_DIVIDER); 727 727 $fullscreen = $this->buildFullscreenMenu(); 728 728 729 - $crumbs = $this->buildApplicationCrumbs(); 729 + $crumbs = $this->newWorkboardCrumbs(); 730 730 $crumbs->addTextCrumb(pht('Workboard')); 731 731 $crumbs->setBorder(true); 732 732
+1 -1
src/applications/project/controller/PhabricatorProjectColumnDetailController.php
··· 47 47 $properties = $this->buildPropertyView($column); 48 48 49 49 $crumbs = $this->buildApplicationCrumbs(); 50 - $crumbs->addTextCrumb(pht('Workboard'), "/project/board/{$project_id}/"); 50 + $crumbs->addTextCrumb(pht('Workboard'), $project->getWorkboardURI()); 51 51 $crumbs->addTextCrumb(pht('Column: %s', $title)); 52 52 $crumbs->setBorder(true); 53 53
+1 -2
src/applications/project/controller/PhabricatorProjectColumnEditController.php
··· 50 50 $v_name = $column->getName(); 51 51 52 52 $validation_exception = null; 53 - $base_uri = '/board/'.$project_id.'/'; 54 - $view_uri = $this->getApplicationURI($base_uri); 53 + $view_uri = $project->getWorkboardURI(); 55 54 56 55 if ($request->isFormPost()) { 57 56 $v_name = $request->getStr('name');
+1 -1
src/applications/project/controller/PhabricatorProjectColumnHideController.php
··· 38 38 39 39 $column_phid = $column->getPHID(); 40 40 41 - $view_uri = $this->getApplicationURI('/board/'.$project_id.'/'); 41 + $view_uri = $project->getWorkboardURI(); 42 42 $view_uri = new PhutilURI($view_uri); 43 43 foreach ($request->getPassthroughRequestData() as $key => $value) { 44 44 $view_uri->replaceQueryParam($key, $value);
+1 -1
src/applications/project/controller/PhabricatorProjectColumnRemoveTriggerController.php
··· 20 20 return new Aphront404Response(); 21 21 } 22 22 23 - $done_uri = $column->getBoardURI(); 23 + $done_uri = $column->getWorkboardURI(); 24 24 25 25 if (!$column->getTriggerPHID()) { 26 26 return $this->newDialog()
+26 -4
src/applications/project/controller/PhabricatorProjectController.php
··· 109 109 } 110 110 111 111 protected function buildApplicationCrumbs() { 112 + return $this->newApplicationCrumbs('profile'); 113 + } 114 + 115 + protected function newWorkboardCrumbs() { 116 + return $this->newApplicationCrumbs('workboard'); 117 + } 118 + 119 + private function newApplicationCrumbs($mode) { 112 120 $crumbs = parent::buildApplicationCrumbs(); 113 121 114 122 $project = $this->getProject(); ··· 117 125 $ancestors = array_reverse($ancestors); 118 126 $ancestors[] = $project; 119 127 foreach ($ancestors as $ancestor) { 120 - $crumbs->addTextCrumb( 121 - $ancestor->getName(), 122 - $ancestor->getProfileURI() 123 - ); 128 + if ($ancestor->getPHID() === $project->getPHID()) { 129 + // Link the current project's crumb to its profile no matter what, 130 + // since we're already on the right context page for it and linking 131 + // to the current page isn't helpful. 132 + $crumb_uri = $ancestor->getProfileURI(); 133 + } else { 134 + switch ($mode) { 135 + case 'workboard': 136 + $crumb_uri = $ancestor->getWorkboardURI(); 137 + break; 138 + case 'profile': 139 + default: 140 + $crumb_uri = $ancestor->getProfileURI(); 141 + break; 142 + } 143 + } 144 + 145 + $crumbs->addTextCrumb($ancestor->getName(), $crumb_uri); 124 146 } 125 147 } 126 148
+2 -2
src/applications/project/controller/trigger/PhabricatorProjectTriggerEditController.php
··· 39 39 if (!$column) { 40 40 return new Aphront404Response(); 41 41 } 42 - $board_uri = $column->getBoardURI(); 42 + $board_uri = $column->getWorkboardURI(); 43 43 } else { 44 44 $column = null; 45 45 $board_uri = null; ··· 122 122 123 123 $column_editor->applyTransactions($column, $column_xactions); 124 124 125 - $next_uri = $column->getBoardURI(); 125 + $next_uri = $column->getWorkboardURI(); 126 126 } 127 127 128 128 return id(new AphrontRedirectResponse())->setURI($next_uri);
+1 -1
src/applications/project/controller/trigger/PhabricatorProjectTriggerViewController.php
··· 111 111 $column_name = phutil_tag( 112 112 'a', 113 113 array( 114 - 'href' => $column->getBoardURI(), 114 + 'href' => $column->getWorkboardURI(), 115 115 ), 116 116 $column->getDisplayName()); 117 117 } else {
+1 -1
src/applications/project/engineextension/PhabricatorProjectsCurtainExtension.php
··· 55 55 $column_link = phutil_tag( 56 56 'a', 57 57 array( 58 - 'href' => "/project/board/{$project_id}/", 58 + 'href' => $column->getWorkboardURI(), 59 59 'class' => 'maniphest-board-link', 60 60 ), 61 61 $column_name);
+1 -1
src/applications/project/events/PhabricatorProjectUIEventListener.php
··· 81 81 $column_link = phutil_tag( 82 82 'a', 83 83 array( 84 - 'href' => "/project/board/{$project_id}/", 84 + 'href' => $column->getWorkboardURI(), 85 85 'class' => 'maniphest-board-link', 86 86 ), 87 87 $column_name);
+1 -1
src/applications/project/menuitem/PhabricatorProjectWorkboardProfileMenuItem.php
··· 57 57 $project = $config->getProfileObject(); 58 58 59 59 $id = $project->getID(); 60 - $href = "/project/board/{$id}/"; 60 + $href = $project->getWorkboardURI(); 61 61 $name = $this->getDisplayName($config); 62 62 63 63 $item = $this->newItem()
+1 -1
src/applications/project/phid/PhabricatorProjectColumnPHIDType.php
··· 37 37 $column = $objects[$phid]; 38 38 39 39 $handle->setName($column->getDisplayName()); 40 - $handle->setURI('/project/board/'.$column->getProject()->getID().'/'); 40 + $handle->setURI($column->getWorkboardURI()); 41 41 42 42 if ($column->isHidden()) { 43 43 $handle->setStatus(PhabricatorObjectHandle::STATUS_CLOSED);
+4
src/applications/project/storage/PhabricatorProject.php
··· 392 392 return "/project/profile/{$id}/"; 393 393 } 394 394 395 + public function getWorkboardURI() { 396 + return urisprintf('/project/board/%d/', $this->getID()); 397 + } 398 + 395 399 public function save() { 396 400 if (!$this->getMailKey()) { 397 401 $this->setMailKey(Filesystem::readRandomCharacters(20));
+2 -4
src/applications/project/storage/PhabricatorProjectColumn.php
··· 212 212 return true; 213 213 } 214 214 215 - public function getBoardURI() { 216 - return urisprintf( 217 - '/project/board/%d/', 218 - $this->getProject()->getID()); 215 + public function getWorkboardURI() { 216 + return $this->getProject()->getWorkboardURI(); 219 217 } 220 218 221 219 public function getDropEffects() {