From df91e15777a94445828157bdce5f70368bcd2b8a Mon Sep 17 00:00:00 2001 From: youhonglian Date: Thu, 31 Oct 2024 07:41:06 +0800 Subject: [PATCH] improve loading UI in Discover mobile (#197939) ## Summary Closes https://github.com/elastic/kibana/issues/151503 In this PR, use the EuiEmptyPrompt component to update the loading UI --------- Co-authored-by: Davis McPhee (cherry picked from commit 7d0f15b160fd2c7bc1d80e62f3499827970fccc1) --- .../loading_indicator.test.tsx.snap | 44 ++++++++++++------- .../components/common/loading_indicator.tsx | 10 ++--- 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/src/plugins/discover/public/components/common/__snapshots__/loading_indicator.test.tsx.snap b/src/plugins/discover/public/components/common/__snapshots__/loading_indicator.test.tsx.snap index 9b8907dc9b4e3..cb9676b012225 100644 --- a/src/plugins/discover/public/components/common/__snapshots__/loading_indicator.test.tsx.snap +++ b/src/plugins/discover/public/components/common/__snapshots__/loading_indicator.test.tsx.snap @@ -2,15 +2,22 @@ exports[`Loading indicator default renders correctly 1`] = `
- + +
+
@@ -18,20 +25,27 @@ exports[`Loading indicator default renders correctly 1`] = ` exports[`Loading indicator elastic renders correctly 1`] = `
- - + aria-label="Loading" + class="euiLoadingElastic emotion-euiLoadingElastic" + role="progressbar" + > + + +
+
`; diff --git a/src/plugins/discover/public/components/common/loading_indicator.tsx b/src/plugins/discover/public/components/common/loading_indicator.tsx index f07b22198d4b0..ed6155c6916ab 100644 --- a/src/plugins/discover/public/components/common/loading_indicator.tsx +++ b/src/plugins/discover/public/components/common/loading_indicator.tsx @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner, EuiLoadingElastic } from '@elastic/eui'; +import { EuiEmptyPrompt, EuiLoadingSpinner, EuiLoadingElastic } from '@elastic/eui'; import React from 'react'; interface Props { @@ -16,10 +16,8 @@ interface Props { export const LoadingIndicator = ({ type = 'spinner' }: Props) => { return ( - - - {type === 'spinner' ? : } - - + : } + /> ); };