add 'tag' as search suggestion

This commit is contained in:
Sean Yesmunt 2019-07-10 12:48:50 -04:00
parent 0ff6364a40
commit 6ba6ba26f3
3 changed files with 13 additions and 1 deletions

8
dist/bundle.es.js vendored
View file

@ -629,7 +629,8 @@ var transaction_types = /*#__PURE__*/Object.freeze({
const SEARCH_TYPES = { const SEARCH_TYPES = {
FILE: 'file', FILE: 'file',
CHANNEL: 'channel', CHANNEL: 'channel',
SEARCH: 'search' SEARCH: 'search',
TAG: 'tag'
}; };
const SEARCH_OPTIONS = { const SEARCH_OPTIONS = {
@ -1138,6 +1139,11 @@ const selectSearchSuggestions = reselect.createSelector(selectSearchValue, selec
}); });
} }
searchSuggestions.push({
value: query,
type: SEARCH_TYPES.TAG
});
const apiSuggestions = suggestions[query] || []; const apiSuggestions = suggestions[query] || [];
if (apiSuggestions.length) { if (apiSuggestions.length) {
searchSuggestions = searchSuggestions.concat(apiSuggestions.filter(suggestion => suggestion !== query).map(suggestion => { searchSuggestions = searchSuggestions.concat(apiSuggestions.filter(suggestion => suggestion !== query).map(suggestion => {

View file

@ -2,6 +2,7 @@ export const SEARCH_TYPES = {
FILE: 'file', FILE: 'file',
CHANNEL: 'channel', CHANNEL: 'channel',
SEARCH: 'search', SEARCH: 'search',
TAG: 'tag',
}; };
export const SEARCH_OPTIONS = { export const SEARCH_OPTIONS = {

View file

@ -96,6 +96,11 @@ export const selectSearchSuggestions: Array<SearchSuggestion> = createSelector(
}); });
} }
searchSuggestions.push({
value: query,
type: SEARCH_TYPES.TAG,
});
const apiSuggestions = suggestions[query] || []; const apiSuggestions = suggestions[query] || [];
if (apiSuggestions.length) { if (apiSuggestions.length) {
searchSuggestions = searchSuggestions.concat( searchSuggestions = searchSuggestions.concat(