Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14031465
D14469.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D14469.diff
View Options
diff --git a/src/applications/herald/application/PhabricatorHeraldApplication.php b/src/applications/herald/application/PhabricatorHeraldApplication.php
--- a/src/applications/herald/application/PhabricatorHeraldApplication.php
+++ b/src/applications/herald/application/PhabricatorHeraldApplication.php
@@ -47,10 +47,10 @@
public function getRoutes() {
return array(
+ '/H(?P<id>[1-9]\d*)' => 'HeraldRuleViewController',
'/herald/' => array(
'(?:query/(?P<queryKey>[^/]+)/)?' => 'HeraldRuleListController',
'new/' => 'HeraldNewController',
- 'rule/(?P<id>[1-9]\d*)/' => 'HeraldRuleViewController',
'edit/(?:(?P<id>[1-9]\d*)/)?' => 'HeraldRuleController',
'disable/(?P<id>[1-9]\d*)/(?P<action>\w+)/'
=> 'HeraldDisableController',
diff --git a/src/applications/herald/controller/HeraldDisableController.php b/src/applications/herald/controller/HeraldDisableController.php
--- a/src/applications/herald/controller/HeraldDisableController.php
+++ b/src/applications/herald/controller/HeraldDisableController.php
@@ -25,7 +25,7 @@
HeraldManageGlobalRulesCapability::CAPABILITY);
}
- $view_uri = $this->getApplicationURI("rule/{$id}/");
+ $view_uri = '/'.$rule->getMonogram();
$is_disable = ($action === 'disable');
diff --git a/src/applications/herald/controller/HeraldRuleController.php b/src/applications/herald/controller/HeraldRuleController.php
--- a/src/applications/herald/controller/HeraldRuleController.php
+++ b/src/applications/herald/controller/HeraldRuleController.php
@@ -22,7 +22,7 @@
if (!$rule) {
return new Aphront404Response();
}
- $cancel_uri = $this->getApplicationURI("rule/{$id}/");
+ $cancel_uri = '/'.$rule->getMonogram();
} else {
$new_uri = $this->getApplicationURI('new/');
@@ -128,7 +128,7 @@
list($e_name, $errors) = $this->saveRule($adapter, $rule, $request);
if (!$errors) {
$id = $rule->getID();
- $uri = $this->getApplicationURI("rule/{$id}/");
+ $uri = '/'.$rule->getMonogram();
return id(new AphrontRedirectResponse())->setURI($uri);
}
}
diff --git a/src/applications/herald/controller/HeraldRuleViewController.php b/src/applications/herald/controller/HeraldRuleViewController.php
--- a/src/applications/herald/controller/HeraldRuleViewController.php
+++ b/src/applications/herald/controller/HeraldRuleViewController.php
@@ -67,7 +67,7 @@
$view = id(new PhabricatorActionListView())
->setUser($viewer)
->setObject($rule)
- ->setObjectURI($this->getApplicationURI("rule/{$id}/"));
+ ->setObjectURI('/'.$rule->getMonogram());
$can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer,
diff --git a/src/applications/herald/phid/HeraldRulePHIDType.php b/src/applications/herald/phid/HeraldRulePHIDType.php
--- a/src/applications/herald/phid/HeraldRulePHIDType.php
+++ b/src/applications/herald/phid/HeraldRulePHIDType.php
@@ -32,12 +32,12 @@
foreach ($handles as $phid => $handle) {
$rule = $objects[$phid];
- $id = $rule->getID();
- $name = $rule->getName();
+ $monogram = $rule->getMonogram();
+ $name = $rule->getName();
- $handle->setName("H{$id}");
- $handle->setFullName("H{$id} {$name}");
- $handle->setURI("/herald/rule/{$id}/");
+ $handle->setName($monogram);
+ $handle->setFullName("{$monogram} {$name}");
+ $handle->setURI("/{$monogram}");
}
}
diff --git a/src/applications/herald/query/HeraldRuleSearchEngine.php b/src/applications/herald/query/HeraldRuleSearchEngine.php
--- a/src/applications/herald/query/HeraldRuleSearchEngine.php
+++ b/src/applications/herald/query/HeraldRuleSearchEngine.php
@@ -173,12 +173,12 @@
$list = id(new PHUIObjectItemListView())
->setUser($viewer);
foreach ($rules as $rule) {
- $id = $rule->getID();
+ $monogram = $rule->getMonogram();
$item = id(new PHUIObjectItemView())
- ->setObjectName("H{$id}")
+ ->setObjectName($monogram)
->setHeader($rule->getName())
- ->setHref($this->getApplicationURI("rule/{$id}/"));
+ ->setHref("/{$monogram}");
if ($rule->isPersonalRule()) {
$item->addIcon('fa-user', pht('Personal Rule'));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 10, 10:39 AM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6712460
Default Alt Text
D14469.diff (4 KB)
Attached To
Mode
D14469: Use monograms for Herald URIs
Attached
Detach File
Event Timeline
Log In to Comment