Skip to content

Commit

Permalink
Wrap no data state with a loading overlay wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerry350 committed Jul 13, 2020
1 parent 51a1936 commit ec0152c
Showing 1 changed file with 20 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
PaginationOptions,
LogEntryAnomalies,
} from '../../use_log_entry_anomalies_results';
import { LoadingOverlayWrapper } from '../../../../../components/loading_overlay_wrapper';

export const AnomaliesResults: React.FunctionComponent<{
isLoadingLogRateResults: boolean;
Expand Down Expand Up @@ -96,23 +97,25 @@ export const AnomaliesResults: React.FunctionComponent<{
logEntryRateResults.histogramBuckets &&
!logEntryRateResults.histogramBuckets.length)) &&
(!anomalies || anomalies.length === 0) ? (
<EuiEmptyPrompt
title={
<h2>
{i18n.translate('xpack.infra.logs.analysis.anomalySectionNoDataTitle', {
defaultMessage: 'There is no data to display.',
})}
</h2>
}
titleSize="m"
body={
<p>
{i18n.translate('xpack.infra.logs.analysis.anomalySectionNoDataBody', {
defaultMessage: 'You may want to adjust your time range.',
})}
</p>
}
/>
<LoadingOverlayWrapper isLoading={isLoadingLogRateResults || isLoadingAnomaliesResults}>
<EuiEmptyPrompt
title={
<h2>
{i18n.translate('xpack.infra.logs.analysis.anomalySectionNoDataTitle', {
defaultMessage: 'There is no data to display.',
})}
</h2>
}
titleSize="m"
body={
<p>
{i18n.translate('xpack.infra.logs.analysis.anomalySectionNoDataBody', {
defaultMessage: 'You may want to adjust your time range.',
})}
</p>
}
/>
</LoadingOverlayWrapper>
) : (
<>
<EuiFlexGroup>
Expand Down

0 comments on commit ec0152c

Please sign in to comment.