Skip to content

Commit 0e666ef

Browse files
authored
fix: show search exhausted message on empty results (#6205)
1 parent 2af4ab7 commit 0e666ef

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

packages/react-storage/src/components/StorageBrowser/displayText/libraries/en/__tests__/__snapshots__/locationDetailView.spec.ts.snap

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ exports[`LocationDetailView display text \`getListResultsMessage\` returns the e
3030
}
3131
`;
3232

33+
exports[`LocationDetailView display text \`getListResultsMessage\` returns the expected values in the search exhausted with no results scenario 1`] = `
34+
{
35+
"content": "No results found in the first 10,000 items.",
36+
"type": "info",
37+
}
38+
`;
39+
3340
exports[`LocationDetailView display text \`getListResultsMessage\` returns the expected values in the search failed scenario 1`] = `
3441
{
3542
"content": "Network got confused",

packages/react-storage/src/components/StorageBrowser/displayText/libraries/en/__tests__/scenarios.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,14 @@ export const LIST_ITEMS_SCENARIOS: [
323323
hasExhaustedSearch: true,
324324
},
325325
],
326+
[
327+
'search exhausted with no results',
328+
{
329+
items: [],
330+
query: 'something to look for',
331+
hasExhaustedSearch: true,
332+
},
333+
],
326334
[
327335
'loading',
328336
{

packages/react-storage/src/components/StorageBrowser/displayText/libraries/en/locationDetailView.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ export const DEFAULT_LOCATION_DETAIL_VIEW_DISPLAY_TEXT: DefaultLocationDetailVie
2626
};
2727
}
2828

29+
if (!items?.length && hasExhaustedSearch) {
30+
return {
31+
type: 'info',
32+
content: `No results found in the first 10,000 items.`,
33+
};
34+
}
35+
2936
if (!items?.length) {
3037
return {
3138
type: 'info',

0 commit comments

Comments
 (0)