EmptyState: Rename "search" variant to "not-found" (#85062)

* rename "search" variant to "not-found"

* run i18n:extract
pull/85006/head
Ashley Harrison 1 year ago committed by GitHub
parent fc205db466
commit 36ee1571b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      packages/grafana-ui/src/components/EmptyState/EmptyState.mdx
  2. 1
      packages/grafana-ui/src/components/EmptyState/EmptyState.story.tsx
  3. 4
      packages/grafana-ui/src/components/EmptyState/EmptyState.tsx
  4. 2
      public/locales/en-US/grafana.json
  5. 2
      public/locales/pseudo-LOCALE/grafana.json

@ -5,7 +5,7 @@ import { EmptyState } from './EmptyState';
Use an empty state to communicate to the user that there is no data to display, or that a search query returned no results.
## variant="search"
## variant="not-found"
### When to use
@ -16,7 +16,7 @@ There are sensible defaults for the image and message, so in most cases you can
```jsx
import { EmptyState } from '@grafana/ui';
<EmptyState variant="search" />;
<EmptyState variant="not-found" />;
```
### Providing custom overrides
@ -30,6 +30,7 @@ import { Button, EmptyState } from '@grafana/ui';
button={<Button variant="secondary" onClick={clearSearchQuery} />}
image={<AnyReactNode />}
message="No playlists found"
variant="not-found"
>
Optionally provide some additional information here. Maybe even a link to{' '}
<TextLink href="<externalDocsLink>" external>

@ -28,6 +28,7 @@ export const Basic: StoryFn<typeof EmptyState> = (args) => {
Basic.args = {
children: 'Use this space to add any additional information',
variant: 'not-found',
};
export default meta;

@ -24,14 +24,14 @@ interface Props {
/**
* Empty state variant. Possible values are 'search'.
*/
variant: 'search';
variant: 'not-found';
}
export const EmptyState = ({
button,
children,
image = <GrotNotFound width={300} />,
message = t('grafana-ui.empty-state.search-message', 'No results found'),
message = t('grafana-ui.empty-state.not-found-message', 'No results found'),
hideImage = false,
}: React.PropsWithChildren<Props>) => {
return (

@ -564,7 +564,7 @@
"close": "Close"
},
"empty-state": {
"search-message": "No results found"
"not-found-message": "No results found"
},
"modal": {
"close-tooltip": "Close"

@ -564,7 +564,7 @@
"close": "Cľőşę"
},
"empty-state": {
"search-message": "Ńő řęşūľŧş ƒőūʼnđ"
"not-found-message": "Ńő řęşūľŧş ƒőūʼnđ"
},
"modal": {
"close-tooltip": "Cľőşę"

Loading…
Cancel
Save