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

Added application name to the typeahead results for doc type search

Summary: Ref T10951. This adds the application name as an attribute below the document type in the UI for doc type search.

Test Plan: Verify that the application name appears as an attribute on the document type results.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T10951

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

Josh Cox d135b3f2 7f7c3acf

+12 -4
+12 -4
src/applications/search/typeahead/PhabricatorSearchDocumentTypeDatasource.php
··· 30 30 PhabricatorSearchApplicationSearchEngine::getIndexableDocumentTypes( 31 31 $viewer); 32 32 33 - $icons = mpull( 34 - PhabricatorPHIDType::getAllTypes(), 35 - 'getTypeIcon', 33 + $phid_types = mpull(PhabricatorPHIDType::getAllTypes(), 34 + null, 36 35 'getTypeConstant'); 37 36 38 37 $results = array(); 39 38 foreach ($types as $type => $name) { 39 + $type_object = idx($phid_types, $type); 40 + if (!$type_object) { 41 + continue; 42 + } 43 + $application_class = $type_object->getPHIDTypeApplicationClass(); 44 + $application = PhabricatorApplication::getByClass($application_class); 45 + $application_name = $application->getName(); 46 + 40 47 $results[$type] = id(new PhabricatorTypeaheadResult()) 41 48 ->setPHID($type) 42 49 ->setName($name) 43 - ->setIcon(idx($icons, $type)); 50 + ->addAttribute($application_name) 51 + ->setIcon($type_object->getTypeIcon()); 44 52 } 45 53 46 54 return $results;