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

Projects - tokenize projects more aggressively with respect to '-'

Summary:
Fixes T5727. Updates the regexes to split on '-'. Also changes the editor such that tokens are updated by the larger search process. (Note this means we update this data more often then we need to - for every project transaction.)

Users will need to make an edit to a project -or- run `bin/search index "#project-tag"` to make this actually work.

Test Plan: Made "Frontend-Engineering", "Engineering", and "Backend-Enginering". They all showed up in the typeahead!

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5727

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

+10 -12
+6 -6
resources/celerity/map.php
··· 8 8 return array( 9 9 'names' => array( 10 10 'core.pkg.css' => 'f8054294', 11 - 'core.pkg.js' => '14887b3d', 11 + 'core.pkg.js' => '7c8455ef', 12 12 'darkconsole.pkg.js' => 'df001cab', 13 13 'differential.pkg.css' => '4a93db37', 14 14 'differential.pkg.js' => 'eb182ccd', ··· 212 212 'rsrc/externals/javelin/lib/behavior.js' => '61cbc29a', 213 213 'rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js' => 'a5b67173', 214 214 'rsrc/externals/javelin/lib/control/typeahead/Typeahead.js' => 'e614d22b', 215 - 'rsrc/externals/javelin/lib/control/typeahead/normalizer/TypeaheadNormalizer.js' => 'aa93c7b0', 215 + 'rsrc/externals/javelin/lib/control/typeahead/normalizer/TypeaheadNormalizer.js' => '1c22377d', 216 216 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadCompositeSource.js' => '503e17fd', 217 217 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadOnDemandSource.js' => '8b3fd187', 218 218 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadPreloadedSource.js' => '54f314a0', ··· 681 681 'javelin-tokenizer' => 'a5b67173', 682 682 'javelin-typeahead' => 'e614d22b', 683 683 'javelin-typeahead-composite-source' => '503e17fd', 684 - 'javelin-typeahead-normalizer' => 'aa93c7b0', 684 + 'javelin-typeahead-normalizer' => '1c22377d', 685 685 'javelin-typeahead-ondemand-source' => '8b3fd187', 686 686 'javelin-typeahead-preloaded-source' => '54f314a0', 687 687 'javelin-typeahead-source' => 'fcba4ecc', ··· 967 967 'javelin-util', 968 968 'phabricator-keyboard-shortcut-manager', 969 969 ), 970 + '1c22377d' => array( 971 + 'javelin-install', 972 + ), 970 973 '1def2711' => array( 971 974 'javelin-install', 972 975 'javelin-dom', ··· 1514 1517 'javelin-dom', 1515 1518 'javelin-util', 1516 1519 'phabricator-prefab', 1517 - ), 1518 - 'aa93c7b0' => array( 1519 - 'javelin-install', 1520 1520 ), 1521 1521 'ab836011' => array( 1522 1522 'javelin-behavior',
-4
src/applications/project/editor/PhabricatorProjectTransactionEditor.php
··· 133 133 ->setProjectPHID($object->getPHID()) 134 134 ->save(); 135 135 136 - $object->updateDatasourceTokens(); 137 - 138 136 // TODO -- delete all of the below once we sever automagical project 139 137 // to phriction stuff 140 138 if ($xaction->getOldValue() === null) { ··· 192 190 $rem_slug->delete(); 193 191 } 194 192 } 195 - 196 - $object->updateDatasourceTokens(); 197 193 198 194 return; 199 195 case PhabricatorTransactions::TYPE_VIEW_POLICY:
+1
src/applications/project/search/PhabricatorProjectSearchIndexer.php
··· 9 9 10 10 protected function buildAbstractDocumentByPHID($phid) { 11 11 $project = $this->loadDocumentByPHID($phid); 12 + $project->updateDatasourceTokens(); 12 13 13 14 $doc = new PhabricatorSearchAbstractDocument(); 14 15 $doc->setPHID($project->getPHID());
+1 -1
src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php
··· 74 74 return array(); 75 75 } 76 76 77 - $tokens = preg_split('/\s+/', $string); 77 + $tokens = preg_split('/\s+|-/', $string); 78 78 return array_unique($tokens); 79 79 } 80 80
+2 -1
webroot/rsrc/externals/javelin/lib/control/typeahead/normalizer/TypeaheadNormalizer.js
··· 16 16 normalize : function(str) { 17 17 return ('' + str) 18 18 .toLocaleLowerCase() 19 - .replace(/[\.,-\/#!$%\^&\*;:{}=\-_`~()]/g, '') 19 + .replace(/[\.,\/#!$%\^&\*;:{}=_`~()]/g, '') 20 + .replace(/-/g, ' ') 20 21 .replace(/ +/g, ' ') 21 22 .replace(/^\s*|\s*$/g, ''); 22 23 }