Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15398440
D17236.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
D17236.diff
View Options
diff --git a/src/applications/search/menuitem/PhabricatorApplicationProfileMenuItem.php b/src/applications/search/menuitem/PhabricatorApplicationProfileMenuItem.php
--- a/src/applications/search/menuitem/PhabricatorApplicationProfileMenuItem.php
+++ b/src/applications/search/menuitem/PhabricatorApplicationProfileMenuItem.php
@@ -21,13 +21,17 @@
public function getDisplayName(
PhabricatorProfileMenuItemConfiguration $config) {
- $app = $this->getApplication($config);
- if ($app) {
- return $app->getName();
- } else {
- return pht('(Uninstalled Application)');
+ $application = $this->getApplication($config);
+ if (!$application) {
+ return pht('(Restricted/Invalid Application)');
+ }
+
+ $name = $this->getName($config);
+ if (strlen($name)) {
+ return $name;
}
- return $app->getName();
+
+ return $application->getName();
}
public function buildEditEngineFields(
@@ -40,9 +44,18 @@
->setDatasource(new PhabricatorApplicationDatasource())
->setIsRequired(true)
->setSingleValue($config->getMenuItemProperty('application')),
+ id(new PhabricatorTextEditField())
+ ->setKey('name')
+ ->setLabel(pht('Name'))
+ ->setValue($this->getName($config)),
);
}
+ private function getName(
+ PhabricatorProfileMenuItemConfiguration $config) {
+ return $config->getMenuItemProperty('name');
+ }
+
private function getApplication(
PhabricatorProfileMenuItemConfiguration $config) {
$viewer = $this->getViewer();
@@ -73,7 +86,7 @@
$item = $this->newItem()
->setHref($app->getApplicationURI())
- ->setName($app->getName())
+ ->setName($this->getDisplayName($config))
->setIcon($app->getIcon());
return array(
diff --git a/src/applications/search/menuitem/PhabricatorDashboardProfileMenuItem.php b/src/applications/search/menuitem/PhabricatorDashboardProfileMenuItem.php
--- a/src/applications/search/menuitem/PhabricatorDashboardProfileMenuItem.php
+++ b/src/applications/search/menuitem/PhabricatorDashboardProfileMenuItem.php
@@ -72,16 +72,16 @@
public function buildEditEngineFields(
PhabricatorProfileMenuItemConfiguration $config) {
return array(
- id(new PhabricatorTextEditField())
- ->setKey('name')
- ->setLabel(pht('Name'))
- ->setValue($this->getName($config)),
id(new PhabricatorDatasourceEditField())
->setKey(self::FIELD_DASHBOARD)
->setLabel(pht('Dashboard'))
->setIsRequired(true)
->setDatasource(new PhabricatorDashboardDatasource())
->setSingleValue($config->getMenuItemProperty('dashboardPHID')),
+ id(new PhabricatorTextEditField())
+ ->setKey('name')
+ ->setLabel(pht('Name'))
+ ->setValue($this->getName($config)),
);
}
diff --git a/src/applications/search/menuitem/PhabricatorEditEngineProfileMenuItem.php b/src/applications/search/menuitem/PhabricatorEditEngineProfileMenuItem.php
--- a/src/applications/search/menuitem/PhabricatorEditEngineProfileMenuItem.php
+++ b/src/applications/search/menuitem/PhabricatorEditEngineProfileMenuItem.php
@@ -81,16 +81,16 @@
public function buildEditEngineFields(
PhabricatorProfileMenuItemConfiguration $config) {
return array(
- id(new PhabricatorTextEditField())
- ->setKey('name')
- ->setLabel(pht('Name'))
- ->setValue($this->getName($config)),
id(new PhabricatorDatasourceEditField())
->setKey(self::FIELD_FORM)
->setLabel(pht('Form'))
->setIsRequired(true)
->setDatasource(new PhabricatorEditEngineDatasource())
->setSingleValue($config->getMenuItemProperty('formKey')),
+ id(new PhabricatorTextEditField())
+ ->setKey('name')
+ ->setLabel(pht('Name'))
+ ->setValue($this->getName($config)),
);
}
diff --git a/src/applications/search/menuitem/PhabricatorProjectProfileMenuItem.php b/src/applications/search/menuitem/PhabricatorProjectProfileMenuItem.php
--- a/src/applications/search/menuitem/PhabricatorProjectProfileMenuItem.php
+++ b/src/applications/search/menuitem/PhabricatorProjectProfileMenuItem.php
@@ -72,16 +72,16 @@
public function buildEditEngineFields(
PhabricatorProfileMenuItemConfiguration $config) {
return array(
- id(new PhabricatorTextEditField())
- ->setKey('name')
- ->setLabel(pht('Name'))
- ->setValue($this->getName($config)),
id(new PhabricatorDatasourceEditField())
->setKey(self::FIELD_PROJECT)
->setLabel(pht('Project'))
->setIsRequired(true)
->setDatasource(new PhabricatorProjectDatasource())
->setSingleValue($config->getMenuItemProperty('project')),
+ id(new PhabricatorTextEditField())
+ ->setKey('name')
+ ->setLabel(pht('Name'))
+ ->setValue($this->getName($config)),
);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 18, 12:06 AM (4 d, 2 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7709100
Default Alt Text
D17236.diff (4 KB)
Attached To
Mode
D17236: Minor consistency/order updates for menu items which reference other objects
Attached
Detach File
Event Timeline
Log In to Comment