@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.

Use monograms for Herald URIs

Summary: I think `HeraldRule`s are the only objects which have monograms but are not accesible via `/{$monogram}`. This diff changes the `/herald/rule/{$id}` URI to `/{$monogram}`.

Test Plan: Clicked a bunch of links in Herald to ensure there were no dead links.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

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

+13 -13
+1 -1
src/applications/herald/application/PhabricatorHeraldApplication.php
··· 47 47 48 48 public function getRoutes() { 49 49 return array( 50 + '/H(?P<id>[1-9]\d*)' => 'HeraldRuleViewController', 50 51 '/herald/' => array( 51 52 '(?:query/(?P<queryKey>[^/]+)/)?' => 'HeraldRuleListController', 52 53 'new/' => 'HeraldNewController', 53 - 'rule/(?P<id>[1-9]\d*)/' => 'HeraldRuleViewController', 54 54 'edit/(?:(?P<id>[1-9]\d*)/)?' => 'HeraldRuleController', 55 55 'disable/(?P<id>[1-9]\d*)/(?P<action>\w+)/' 56 56 => 'HeraldDisableController',
+1 -1
src/applications/herald/controller/HeraldDisableController.php
··· 25 25 HeraldManageGlobalRulesCapability::CAPABILITY); 26 26 } 27 27 28 - $view_uri = $this->getApplicationURI("rule/{$id}/"); 28 + $view_uri = '/'.$rule->getMonogram(); 29 29 30 30 $is_disable = ($action === 'disable'); 31 31
+2 -2
src/applications/herald/controller/HeraldRuleController.php
··· 22 22 if (!$rule) { 23 23 return new Aphront404Response(); 24 24 } 25 - $cancel_uri = $this->getApplicationURI("rule/{$id}/"); 25 + $cancel_uri = '/'.$rule->getMonogram(); 26 26 } else { 27 27 $new_uri = $this->getApplicationURI('new/'); 28 28 ··· 128 128 list($e_name, $errors) = $this->saveRule($adapter, $rule, $request); 129 129 if (!$errors) { 130 130 $id = $rule->getID(); 131 - $uri = $this->getApplicationURI("rule/{$id}/"); 131 + $uri = '/'.$rule->getMonogram(); 132 132 return id(new AphrontRedirectResponse())->setURI($uri); 133 133 } 134 134 }
+1 -1
src/applications/herald/controller/HeraldRuleViewController.php
··· 67 67 $view = id(new PhabricatorActionListView()) 68 68 ->setUser($viewer) 69 69 ->setObject($rule) 70 - ->setObjectURI($this->getApplicationURI("rule/{$id}/")); 70 + ->setObjectURI('/'.$rule->getMonogram()); 71 71 72 72 $can_edit = PhabricatorPolicyFilter::hasCapability( 73 73 $viewer,
+5 -5
src/applications/herald/phid/HeraldRulePHIDType.php
··· 32 32 foreach ($handles as $phid => $handle) { 33 33 $rule = $objects[$phid]; 34 34 35 - $id = $rule->getID(); 36 - $name = $rule->getName(); 35 + $monogram = $rule->getMonogram(); 36 + $name = $rule->getName(); 37 37 38 - $handle->setName("H{$id}"); 39 - $handle->setFullName("H{$id} {$name}"); 40 - $handle->setURI("/herald/rule/{$id}/"); 38 + $handle->setName($monogram); 39 + $handle->setFullName("{$monogram} {$name}"); 40 + $handle->setURI("/{$monogram}"); 41 41 } 42 42 } 43 43
+3 -3
src/applications/herald/query/HeraldRuleSearchEngine.php
··· 173 173 $list = id(new PHUIObjectItemListView()) 174 174 ->setUser($viewer); 175 175 foreach ($rules as $rule) { 176 - $id = $rule->getID(); 176 + $monogram = $rule->getMonogram(); 177 177 178 178 $item = id(new PHUIObjectItemView()) 179 - ->setObjectName("H{$id}") 179 + ->setObjectName($monogram) 180 180 ->setHeader($rule->getName()) 181 - ->setHref($this->getApplicationURI("rule/{$id}/")); 181 + ->setHref("/{$monogram}"); 182 182 183 183 if ($rule->isPersonalRule()) { 184 184 $item->addIcon('fa-user', pht('Personal Rule'));