-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RAC] Add loading and empty states to the alerts table - Take II (#11…
…0504) Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
641cef7
commit 4e9e7a8
Showing
8 changed files
with
195 additions
and
144 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
1 change: 1 addition & 0 deletions
1
...ns/timelines/public/assets/illustration_product_no_results_magnifying_glass.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
90 changes: 90 additions & 0 deletions
90
x-pack/plugins/timelines/public/components/t_grid/shared/index.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,90 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { | ||
EuiPanel, | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
EuiLoadingSpinner, | ||
EuiImage, | ||
EuiText, | ||
EuiTitle, | ||
} from '@elastic/eui'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; | ||
import type { CoreStart } from '../../../../../../../src/core/public'; | ||
|
||
const heights = { | ||
tall: 490, | ||
short: 250, | ||
}; | ||
|
||
export const TGridLoading: React.FC<{ height?: keyof typeof heights }> = ({ height = 'tall' }) => { | ||
return ( | ||
<EuiPanel color="subdued"> | ||
<EuiFlexGroup | ||
style={{ height: heights[height] }} | ||
alignItems="center" | ||
justifyContent="center" | ||
data-test-subj="loading-alerts-panel" | ||
> | ||
<EuiFlexItem grow={false}> | ||
<EuiLoadingSpinner size="xl" /> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
</EuiPanel> | ||
); | ||
}; | ||
|
||
const panelStyle = { | ||
maxWidth: 500, | ||
}; | ||
|
||
export const TGridEmpty: React.FC<{ height?: keyof typeof heights }> = ({ height = 'tall' }) => { | ||
const { http } = useKibana<CoreStart>().services; | ||
|
||
return ( | ||
<EuiPanel color="subdued"> | ||
<EuiFlexGroup style={{ height: heights[height] }} alignItems="center" justifyContent="center"> | ||
<EuiFlexItem grow={false}> | ||
<EuiPanel hasBorder={true} style={panelStyle}> | ||
<EuiFlexGroup> | ||
<EuiFlexItem> | ||
<EuiText size="s"> | ||
<EuiTitle> | ||
<h3> | ||
<FormattedMessage | ||
id="xpack.timelines.tgrid.empty.title" | ||
defaultMessage="No results match your search criteria" | ||
/> | ||
</h3> | ||
</EuiTitle> | ||
<p> | ||
<FormattedMessage | ||
id="xpack.timelines.tgrid.empty.description" | ||
defaultMessage="Try searching over a longer period of time or modifying your search" | ||
/> | ||
</p> | ||
</EuiText> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<EuiImage | ||
size="200" | ||
alt="" | ||
url={http.basePath.prepend( | ||
'/plugins/timelines/assets/illustration_product_no_results_magnifying_glass.svg' | ||
)} | ||
/> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
</EuiPanel> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
</EuiPanel> | ||
); | ||
}; |
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
Oops, something went wrong.