mirror of
https://github.com/zulip/zulip.git
synced 2025-11-12 18:06:44 +00:00
integrations: Use phrase_match instead of fuzzysearch.
Fixes #9822. fuzzysearch matched query if the query letters appeared in sequence. Here we use the extracted phrase_match to match query with the prefixes of words.
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
import fuzzysearch from 'fuzzysearch';
|
|
||||||
import blueslip from './../blueslip';
|
import blueslip from './../blueslip';
|
||||||
|
|
||||||
import { path_parts } from './landing-page';
|
import { path_parts } from './landing-page';
|
||||||
@@ -117,8 +116,9 @@ var update_integrations = _.debounce(function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$integration.hasClass('integration-create-your-own')) {
|
if (!$integration.hasClass('integration-create-your-own')) {
|
||||||
|
var display_name = INTEGRATIONS[$integration.data('name')];
|
||||||
var display =
|
var display =
|
||||||
fuzzysearch(state.query, $integration.data('name').toLowerCase()) &&
|
common.phrase_match(state.query, display_name) &&
|
||||||
($integration.data('categories').indexOf(CATEGORIES[state.category]) !== -1 ||
|
($integration.data('categories').indexOf(CATEGORIES[state.category]) !== -1 ||
|
||||||
state.category === 'all');
|
state.category === 'all');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user