-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(aggregations): show the search warning in all three places COMPAS…
…S-7317 (#6364) * show the search warning in all three places * No preview documents rather than No results found for consistency * set content, don't early return * tests * make it clear that this is for search-related stages only * test them all * and inverse test
- Loading branch information
Showing
8 changed files
with
124 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
packages/compass-aggregations/src/components/search-no-results.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import React from 'react'; | ||
|
||
import { | ||
css, | ||
palette, | ||
spacing, | ||
Body, | ||
useDarkMode, | ||
Subtitle, | ||
} from '@mongodb-js/compass-components'; | ||
|
||
const centeredContent = css({ | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
height: '100%', | ||
padding: spacing[3], | ||
flexDirection: 'column', | ||
textAlign: 'center', | ||
}); | ||
|
||
const missingAtlasIndexLightStyles = css({ | ||
color: palette.green.dark2, | ||
}); | ||
|
||
const missingAtlasIndexDarkStyles = css({ | ||
color: palette.green.base, | ||
}); | ||
|
||
export default function SearchNoResults() { | ||
const darkMode = useDarkMode(); | ||
|
||
return ( | ||
<div className={centeredContent}> | ||
<Subtitle | ||
className={css( | ||
darkMode ? missingAtlasIndexDarkStyles : missingAtlasIndexLightStyles | ||
)} | ||
> | ||
No preview documents | ||
</Subtitle> | ||
<Body> | ||
This may be because your search has no results or your search index does | ||
not exist. | ||
</Body> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters