1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Projects - tokenize [ProjectX] so "projectX" is a match

Summary:
Fixes T4656. Helps users with this naming convention, which is probably not super duper rare.

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 a project "[T4656test]". Typed "t4" and project showed up!

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T4656

Differential Revision: https://secure.phabricator.com/D11302
This commit is contained in:
Bob Trahan 2015-01-09 14:09:13 -08:00
parent 1a997fb0df
commit 59770443b6
3 changed files with 8 additions and 8 deletions

View file

@ -8,7 +8,7 @@
return array(
'names' => array(
'core.pkg.css' => '8fc8031a',
'core.pkg.js' => '21041609',
'core.pkg.js' => 'd49bf8b2',
'darkconsole.pkg.js' => '8ab24e01',
'differential.pkg.css' => '8af45893',
'differential.pkg.js' => 'dad3622f',
@ -211,7 +211,7 @@ return array(
'rsrc/externals/javelin/lib/behavior.js' => '61cbc29a',
'rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js' => '9f06389f',
'rsrc/externals/javelin/lib/control/typeahead/Typeahead.js' => 'e614d22b',
'rsrc/externals/javelin/lib/control/typeahead/normalizer/TypeaheadNormalizer.js' => '1c22377d',
'rsrc/externals/javelin/lib/control/typeahead/normalizer/TypeaheadNormalizer.js' => '6f7a9da8',
'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadCompositeSource.js' => '503e17fd',
'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadOnDemandSource.js' => '8b3fd187',
'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadPreloadedSource.js' => '54f314a0',
@ -674,7 +674,7 @@ return array(
'javelin-tokenizer' => '9f06389f',
'javelin-typeahead' => 'e614d22b',
'javelin-typeahead-composite-source' => '503e17fd',
'javelin-typeahead-normalizer' => '1c22377d',
'javelin-typeahead-normalizer' => '6f7a9da8',
'javelin-typeahead-ondemand-source' => '8b3fd187',
'javelin-typeahead-preloaded-source' => '54f314a0',
'javelin-typeahead-source' => 'fcba4ecc',
@ -956,9 +956,6 @@ return array(
'javelin-util',
'phabricator-keyboard-shortcut-manager',
),
'1c22377d' => array(
'javelin-install',
),
'1def2711' => array(
'javelin-install',
'javelin-dom',
@ -1266,6 +1263,9 @@ return array(
'javelin-util',
'javelin-stratcom',
),
'6f7a9da8' => array(
'javelin-install',
),
'724b1247' => array(
'javelin-behavior',
'javelin-typeahead-ondemand-source',

View file

@ -74,7 +74,7 @@ abstract class PhabricatorTypeaheadDatasource extends Phobject {
return array();
}
$tokens = preg_split('/\s+|-/', $string);
$tokens = preg_split('/\s+|[-\[\]]/', $string);
return array_unique($tokens);
}

View file

@ -17,7 +17,7 @@ JX.install('TypeaheadNormalizer', {
return ('' + str)
.toLocaleLowerCase()
.replace(/[\.,\/#!$%\^&\*;:{}=_`~()]/g, '')
.replace(/-/g, ' ')
.replace(/[-\[\]]/g, ' ')
.replace(/ +/g, ' ')
.replace(/^\s*|\s*$/g, '');
}