Skip to content

Commit 90788a9

Browse files
authored
[Metrics] Always display loading indicator when new data is loading (#48038) (#48176)
* [Metrics] Always display loading indicator when new data is loading * Add loading data sources indicator to Metrics Explorer tab
1 parent 2e08f41 commit 90788a9

File tree

2 files changed

+3
-3
lines changed
  • x-pack/legacy/plugins/infra/public

2 files changed

+3
-3
lines changed

x-pack/legacy/plugins/infra/public/components/metrics_explorer/charts.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,12 @@ export const MetricsExplorerCharts = ({
3838
options,
3939
chartOptions,
4040
onRefetch,
41-
4241
onFilter,
4342
source,
4443
timeRange,
4544
onTimeChange,
4645
}: Props) => {
47-
if (!data && loading) {
46+
if (loading) {
4847
return (
4948
<InfraLoadingPanel
5049
height={800}

x-pack/legacy/plugins/infra/public/pages/infrastructure/metrics_explorer/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { StaticIndexPattern } from 'ui/index_patterns';
1111
import { DocumentTitle } from '../../../components/document_title';
1212
import { MetricsExplorerCharts } from '../../../components/metrics_explorer/charts';
1313
import { MetricsExplorerToolbar } from '../../../components/metrics_explorer/toolbar';
14+
import { SourceLoadingPage } from '../../../components/source_loading_page';
1415
import { SourceQuery } from '../../../../common/graphql/types';
1516
import { NoData } from '../../../components/empty_states';
1617
import { useMetricsExplorerState } from './use_metric_explorer_state';
@@ -23,7 +24,7 @@ interface MetricsExplorerPageProps {
2324

2425
export const MetricsExplorerPage = ({ source, derivedIndexPattern }: MetricsExplorerPageProps) => {
2526
if (!source) {
26-
return null;
27+
return <SourceLoadingPage />;
2728
}
2829

2930
const {

0 commit comments

Comments
 (0)