Skip to content

Commit

Permalink
hide not searchable results when no term (elastic#102401)
Browse files Browse the repository at this point in the history
  • Loading branch information
semd authored and Maja Grubic committed Jun 18, 2021
1 parent b735aa2 commit fc99665
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ describe('getAppResults', () => {
],
keywords: [],
}),
createApp({
id: 'AppNotSearchable',
title: 'App 1 not searchable',
searchable: false,
}),
];

expect(getAppResults('', apps).length).toBe(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export const getAppResults = (
.flatMap((app) =>
term.length > 0
? flattenDeepLinks(app)
: [
: app.searchable
? [
{
id: app.id,
app,
Expand All @@ -40,6 +41,7 @@ export const getAppResults = (
keywords: app.keywords ?? [],
},
]
: []
)
.map((appLink) => ({
appLink,
Expand Down

0 comments on commit fc99665

Please sign in to comment.