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

Show more in Application Detail and List view

Summary:
Update the Application Detail view and List View to show a unified set of Badges (Deprecated, etc.), show PHIDs and Monograms on the Application Detail view, allow Applications to register Monograms.

Example of the page /applications/view/PhabricatorDiffusionApplication/:

{F393393}

T15568

Test Plan:
1. Visit /applications/ and see Deprecated badges etc.
2. Visit various Configure buttons from that list and see Monograms, Badges, PHIDs etc.
3. Enjoy screenshots in the comments of this Diff

Reviewers: O1 Blessed Committers, valerio.bozzolan, avivey, speck

Reviewed By: O1 Blessed Committers, valerio.bozzolan, avivey, speck

Subscribers: avivey, speck, tobiaswiese, valerio.bozzolan, Cigaryno

Differential Revision: https://we.phorge.it/D25362

+189 -6
+15
src/applications/base/PhabricatorApplication.php
··· 61 61 return pht('%s Application', $this->getName()); 62 62 } 63 63 64 + /** 65 + * Extensions are allowed to register multi-character monograms. 66 + * The name "Monogram" is actually a bit of a misnomer, 67 + * but we're keeping it due to the history. 68 + * 69 + * @return array 70 + */ 71 + public function getMonograms() { 72 + return array(); 73 + } 74 + 75 + public function isDeprecated() { 76 + return false; 77 + } 78 + 64 79 final public function isInstalled() { 65 80 if (!$this->canUninstall()) { 66 81 return true;
+4
src/applications/calendar/application/PhabricatorCalendarApplication.php
··· 28 28 return "\xE2\x8C\xA8"; 29 29 } 30 30 31 + public function getMonograms() { 32 + return array('E'); 33 + } 34 + 31 35 public function getApplicationGroup() { 32 36 return self::GROUP_UTILITIES; 33 37 }
+6 -2
src/applications/chatlog/application/PhabricatorChatLogApplication.php
··· 11 11 } 12 12 13 13 public function getShortDescription() { 14 - return pht('(Deprecated)'); 14 + return pht('IRC Logs'); 15 15 } 16 16 17 17 public function getIcon() { ··· 22 22 return true; 23 23 } 24 24 25 + public function isDeprecated() { 26 + return true; 27 + } 28 + 25 29 public function getTitleGlyph() { 26 30 return "\xE0\xBC\x84"; 27 31 } ··· 30 34 return self::GROUP_UTILITIES; 31 35 } 32 36 33 - public function getRoutes() { 37 + public function getRoutes() { 34 38 return array( 35 39 '/chatlog/' => array( 36 40 '' => 'PhabricatorChatLogChannelListController',
+4
src/applications/conpherence/application/PhabricatorConpherenceApplication.php
··· 28 28 ); 29 29 } 30 30 31 + public function getMonograms() { 32 + return array('Z'); 33 + } 34 + 31 35 public function getRoutes() { 32 36 return array( 33 37 '/Z(?P<id>[1-9]\d*)'
+4
src/applications/countdown/application/PhabricatorCountdownApplication.php
··· 36 36 ); 37 37 } 38 38 39 + public function getMonograms() { 40 + return array('C'); 41 + } 42 + 39 43 public function getRoutes() { 40 44 return array( 41 45 '/C(?P<id>[1-9]\d*)' => 'PhabricatorCountdownViewController',
+4
src/applications/dashboard/application/PhabricatorDashboardApplication.php
··· 30 30 return 0.160; 31 31 } 32 32 33 + public function getMonograms() { 34 + return array('W'); 35 + } 36 + 33 37 public function getRoutes() { 34 38 $menu_rules = $this->getProfileMenuRouting( 35 39 'PhabricatorDashboardPortalViewController');
+4
src/applications/differential/application/PhabricatorDifferentialApplication.php
··· 42 42 'engineers to review, discuss and approve changes to software.'); 43 43 } 44 44 45 + public function getMonograms() { 46 + return array('D'); 47 + } 48 + 45 49 public function getRoutes() { 46 50 return array( 47 51 '/D(?P<id>[1-9]\d*)' => array(
+5
src/applications/diffusion/application/PhabricatorDiffusionApplication.php
··· 44 44 ); 45 45 } 46 46 47 + public function getMonograms() { 48 + // This is a special case, as r and R mean different things. 49 + return array('r', 'R'); 50 + } 51 + 47 52 public function getRoutes() { 48 53 $repository_routes = array( 49 54 '/' => array(
+4
src/applications/files/application/PhabricatorFilesApplication.php
··· 67 67 ); 68 68 } 69 69 70 + public function getMonograms() { 71 + return array('F'); 72 + } 73 + 70 74 public function getRoutes() { 71 75 return array( 72 76 '/F(?P<id>[1-9]\d*)(?:\$(?P<lines>\d+(?:-\d+)?))?'
+4
src/applications/fund/application/PhabricatorFundApplication.php
··· 36 36 ); 37 37 } 38 38 39 + public function getMonograms() { 40 + return array('I'); 41 + } 42 + 39 43 public function getRoutes() { 40 44 return array( 41 45 '/I(?P<id>[1-9]\d*)' => 'FundInitiativeViewController',
+4
src/applications/harbormaster/application/PhabricatorHarbormasterApplication.php
··· 51 51 ); 52 52 } 53 53 54 + public function getMonograms() { 55 + return array('B'); 56 + } 57 + 54 58 public function getRoutes() { 55 59 return array( 56 60 '/B(?P<id>[1-9]\d*)' => 'HarbormasterBuildableViewController',
+4
src/applications/herald/application/PhabricatorHeraldApplication.php
··· 49 49 ); 50 50 } 51 51 52 + public function getMonograms() { 53 + return array('H'); 54 + } 55 + 52 56 public function getRoutes() { 53 57 return array( 54 58 '/H(?P<id>[1-9]\d*)' => 'HeraldRuleViewController',
+4
src/applications/legalpad/application/PhabricatorLegalpadApplication.php
··· 48 48 'open source projects keep track of Contributor License Agreements.'); 49 49 } 50 50 51 + public function getMonograms() { 52 + return array('L'); 53 + } 54 + 51 55 public function getRoutes() { 52 56 return array( 53 57 '/L(?P<id>\d+)' => 'LegalpadDocumentSignController',
+4
src/applications/maniphest/application/PhabricatorManiphestApplication.php
··· 42 42 ); 43 43 } 44 44 45 + public function getMonograms() { 46 + return array('T'); 47 + } 48 + 45 49 public function getRoutes() { 46 50 return array( 47 51 '/T(?P<id>[1-9]\d*)' => 'ManiphestTaskDetailController',
+45
src/applications/meta/controller/PhabricatorApplicationDetailViewController.php
··· 38 38 $header->setStatus('fa-ban', 'dark', pht('Uninstalled')); 39 39 } 40 40 41 + if (!$selected->isFirstParty()) { 42 + $header->addTag(id(new PHUITagView()) 43 + ->setName('Extension') 44 + ->setIcon('fa-plug') 45 + ->setColor(PHUITagView::COLOR_INDIGO) 46 + ->setType(PHUITagView::TYPE_SHADE)); 47 + } 48 + 49 + if ($selected->isPrototype()) { 50 + $header->addTag(id(new PHUITagView()) 51 + ->setName('Prototype') 52 + ->setIcon('fa-exclamation-circle') 53 + ->setColor(PHUITagView::COLOR_ORANGE) 54 + ->setType(PHUITagView::TYPE_SHADE)); 55 + } 56 + 57 + if ($selected->isDeprecated()) { 58 + $header->addTag(id(new PHUITagView()) 59 + ->setName('Deprecated') 60 + ->setIcon('fa-exclamation-triangle') 61 + ->setColor(PHUITagView::COLOR_RED) 62 + ->setType(PHUITagView::TYPE_SHADE)); 63 + } 64 + 41 65 $timeline = $this->buildTransactionTimeline( 42 66 $selected, 43 67 new PhabricatorApplicationApplicationTransactionQuery()); ··· 93 117 $properties->addProperty( 94 118 null, 95 119 phutil_tag('em', array(), $application->getFlavorText())); 120 + } 121 + 122 + $phids = PhabricatorPHIDType::getAllTypesForApplication( 123 + get_class($application)); 124 + 125 + $user_friendly_phids = array(); 126 + foreach ($phids as $phid => $type) { 127 + $user_friendly_phids[] = "PHID-{$phid} ({$type->getTypeName()})"; 128 + } 129 + 130 + if ($user_friendly_phids) { 131 + $properties->addProperty( 132 + 'PHIDs', 133 + phutil_implode_html(phutil_tag('br'), $user_friendly_phids)); 134 + } 135 + 136 + $monograms = $application->getMonograms(); 137 + if ($monograms) { 138 + $properties->addProperty( 139 + 'Monograms', 140 + phutil_implode_html(', ', $monograms)); 96 141 } 97 142 98 143 if ($application->isPrototype()) {
+14 -4
src/applications/meta/query/PhabricatorAppSearchEngine.php
··· 231 231 ->setSideColumn($configure); 232 232 233 233 if (!$application->isFirstParty()) { 234 - $tag = id(new PHUITagView()) 234 + $extension_tag = id(new PHUITagView()) 235 235 ->setName(pht('Extension')) 236 - ->setIcon('fa-puzzle-piece') 237 - ->setColor(PHUITagView::COLOR_BLUE) 236 + ->setIcon('fa-plug') 237 + ->setColor(PHUITagView::COLOR_INDIGO) 238 238 ->setType(PHUITagView::TYPE_SHADE) 239 239 ->setSlimShady(true); 240 - $item->addAttribute($tag); 240 + $item->addAttribute($extension_tag); 241 241 } 242 242 243 243 if ($application->isPrototype()) { ··· 248 248 ->setType(PHUITagView::TYPE_SHADE) 249 249 ->setSlimShady(true); 250 250 $item->addAttribute($prototype_tag); 251 + } 252 + 253 + if ($application->isDeprecated()) { 254 + $deprecated_tag = id(new PHUITagView()) 255 + ->setName(pht('Deprecated')) 256 + ->setIcon('fa-exclamation-triangle') 257 + ->setColor(PHUITagView::COLOR_RED) 258 + ->setType(PHUITagView::TYPE_SHADE) 259 + ->setSlimShady(true); 260 + $item->addAttribute($deprecated_tag); 251 261 } 252 262 253 263 $item->addAttribute($description);
+4
src/applications/owners/application/PhabricatorOwnersApplication.php
··· 45 45 ); 46 46 } 47 47 48 + public function getMonograms() { 49 + return array('O'); 50 + } 51 + 48 52 public function getRoutes() { 49 53 return array( 50 54 '/owners/' => array(
+4
src/applications/passphrase/application/PhabricatorPassphraseApplication.php
··· 34 34 return false; 35 35 } 36 36 37 + public function getMonograms() { 38 + return array('K'); 39 + } 40 + 37 41 public function getRoutes() { 38 42 return array( 39 43 '/K(?P<id>\d+)' => 'PassphraseCredentialViewController',
+4
src/applications/paste/application/PhabricatorPasteApplication.php
··· 32 32 ); 33 33 } 34 34 35 + public function getMonograms() { 36 + return array('P'); 37 + } 38 + 35 39 public function getRoutes() { 36 40 return array( 37 41 '/P(?P<id>[1-9]\d*)(?:\$(?P<lines>\d+(?:-\d+)?))?'
+4
src/applications/phame/application/PhabricatorPhameApplication.php
··· 31 31 ); 32 32 } 33 33 34 + public function getMonograms() { 35 + return array('J'); 36 + } 37 + 34 38 public function getRoutes() { 35 39 return array( 36 40 '/J(?P<id>[1-9]\d*)' => 'PhamePostViewController',
+24
src/applications/phid/type/PhabricatorPHIDType.php
··· 205 205 return $installed_types; 206 206 } 207 207 208 + 209 + /** 210 + * Get all PHID types of applications installed for a given viewer. 211 + * 212 + * @param PhabricatorUser Viewing user. 213 + * @return dict<string, PhabricatorPHIDType> Map of constants to installed 214 + * types. 215 + */ 216 + public static function getAllTypesForApplication( 217 + string $application) { 218 + $all_types = self::getAllTypes(); 219 + 220 + $application_types = array(); 221 + 222 + foreach ($all_types as $key => $type) { 223 + if ($type->getPHIDTypeApplicationClass() != $application) { 224 + continue; 225 + } 226 + 227 + $application_types[$key] = $type; 228 + } 229 + 230 + return $application_types; 231 + } 208 232 }
+4
src/applications/pholio/application/PhabricatorPholioApplication.php
··· 32 32 ); 33 33 } 34 34 35 + public function getMonograms() { 36 + return array('M'); 37 + } 38 + 35 39 public function getRoutes() { 36 40 return array( 37 41 '/M(?P<id>[1-9]\d*)(?:/(?P<imageID>\d+)/)?' => 'PholioMockViewController',
+4
src/applications/phurl/application/PhabricatorPhurlApplication.php
··· 37 37 ); 38 38 } 39 39 40 + public function getMonograms() { 41 + return array('U'); 42 + } 43 + 40 44 public function getRoutes() { 41 45 return array( 42 46 '/U(?P<id>[1-9]\d*)/?' => 'PhabricatorPhurlURLViewController',
+4
src/applications/ponder/application/PhabricatorPonderApplication.php
··· 47 47 pht('Learn More'))); 48 48 } 49 49 50 + public function getMonograms() { 51 + return array('Q'); 52 + } 53 + 50 54 public function getRoutes() { 51 55 return array( 52 56 '/Q(?P<id>[1-9]\d*)'
+4
src/applications/slowvote/application/PhabricatorSlowvoteApplication.php
··· 45 45 ); 46 46 } 47 47 48 + public function getMonograms() { 49 + return array('V'); 50 + } 51 + 48 52 public function getRoutes() { 49 53 return array( 50 54 '/V(?P<id>[1-9]\d*)' => 'PhabricatorSlowvotePollController',
+4
src/applications/spaces/application/PhabricatorSpacesApplication.php
··· 49 49 ); 50 50 } 51 51 52 + public function getMonograms() { 53 + return array('S'); 54 + } 55 + 52 56 public function getRoutes() { 53 57 return array( 54 58 '/S(?P<id>[1-9]\d*)' => 'PhabricatorSpacesViewController',