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

Minor consistency/order updates for menu items which reference other objects

Summary:
See T11957#208140.

- Let Applications have a custom name, like other object items (for example, so you can call Maniphest "Tasks" if you prefer).
- Put the optional name field after the required typeahead field for these items.
- (I left "Link" in "Name, URI" order since both are required, but there's maybe an argument for swapping them?)

Test Plan:
- Created each type of item, saw "thing, name" order.
- Created an application with a cusotm name, saw custom name.
- Removed custom name, saw original name.

Reviewers: chad

Reviewed By: chad

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

+32 -19
+20 -7
src/applications/search/menuitem/PhabricatorApplicationProfileMenuItem.php
··· 21 21 22 22 public function getDisplayName( 23 23 PhabricatorProfileMenuItemConfiguration $config) { 24 - $app = $this->getApplication($config); 25 - if ($app) { 26 - return $app->getName(); 27 - } else { 28 - return pht('(Uninstalled Application)'); 24 + $application = $this->getApplication($config); 25 + if (!$application) { 26 + return pht('(Restricted/Invalid Application)'); 29 27 } 30 - return $app->getName(); 28 + 29 + $name = $this->getName($config); 30 + if (strlen($name)) { 31 + return $name; 32 + } 33 + 34 + return $application->getName(); 31 35 } 32 36 33 37 public function buildEditEngineFields( ··· 40 44 ->setDatasource(new PhabricatorApplicationDatasource()) 41 45 ->setIsRequired(true) 42 46 ->setSingleValue($config->getMenuItemProperty('application')), 47 + id(new PhabricatorTextEditField()) 48 + ->setKey('name') 49 + ->setLabel(pht('Name')) 50 + ->setValue($this->getName($config)), 43 51 ); 52 + } 53 + 54 + private function getName( 55 + PhabricatorProfileMenuItemConfiguration $config) { 56 + return $config->getMenuItemProperty('name'); 44 57 } 45 58 46 59 private function getApplication( ··· 73 86 74 87 $item = $this->newItem() 75 88 ->setHref($app->getApplicationURI()) 76 - ->setName($app->getName()) 89 + ->setName($this->getDisplayName($config)) 77 90 ->setIcon($app->getIcon()); 78 91 79 92 return array(
+4 -4
src/applications/search/menuitem/PhabricatorDashboardProfileMenuItem.php
··· 72 72 public function buildEditEngineFields( 73 73 PhabricatorProfileMenuItemConfiguration $config) { 74 74 return array( 75 - id(new PhabricatorTextEditField()) 76 - ->setKey('name') 77 - ->setLabel(pht('Name')) 78 - ->setValue($this->getName($config)), 79 75 id(new PhabricatorDatasourceEditField()) 80 76 ->setKey(self::FIELD_DASHBOARD) 81 77 ->setLabel(pht('Dashboard')) 82 78 ->setIsRequired(true) 83 79 ->setDatasource(new PhabricatorDashboardDatasource()) 84 80 ->setSingleValue($config->getMenuItemProperty('dashboardPHID')), 81 + id(new PhabricatorTextEditField()) 82 + ->setKey('name') 83 + ->setLabel(pht('Name')) 84 + ->setValue($this->getName($config)), 85 85 ); 86 86 } 87 87
+4 -4
src/applications/search/menuitem/PhabricatorEditEngineProfileMenuItem.php
··· 81 81 public function buildEditEngineFields( 82 82 PhabricatorProfileMenuItemConfiguration $config) { 83 83 return array( 84 - id(new PhabricatorTextEditField()) 85 - ->setKey('name') 86 - ->setLabel(pht('Name')) 87 - ->setValue($this->getName($config)), 88 84 id(new PhabricatorDatasourceEditField()) 89 85 ->setKey(self::FIELD_FORM) 90 86 ->setLabel(pht('Form')) 91 87 ->setIsRequired(true) 92 88 ->setDatasource(new PhabricatorEditEngineDatasource()) 93 89 ->setSingleValue($config->getMenuItemProperty('formKey')), 90 + id(new PhabricatorTextEditField()) 91 + ->setKey('name') 92 + ->setLabel(pht('Name')) 93 + ->setValue($this->getName($config)), 94 94 ); 95 95 } 96 96
+4 -4
src/applications/search/menuitem/PhabricatorProjectProfileMenuItem.php
··· 72 72 public function buildEditEngineFields( 73 73 PhabricatorProfileMenuItemConfiguration $config) { 74 74 return array( 75 - id(new PhabricatorTextEditField()) 76 - ->setKey('name') 77 - ->setLabel(pht('Name')) 78 - ->setValue($this->getName($config)), 79 75 id(new PhabricatorDatasourceEditField()) 80 76 ->setKey(self::FIELD_PROJECT) 81 77 ->setLabel(pht('Project')) 82 78 ->setIsRequired(true) 83 79 ->setDatasource(new PhabricatorProjectDatasource()) 84 80 ->setSingleValue($config->getMenuItemProperty('project')), 81 + id(new PhabricatorTextEditField()) 82 + ->setKey('name') 83 + ->setLabel(pht('Name')) 84 + ->setValue($this->getName($config)), 85 85 ); 86 86 } 87 87