Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discover] Loading spinner cleanup #79819

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,7 @@ export function DiscoverLegacy({
/>
)}
{resultState === 'uninitialized' && <DiscoverUninitialized onRefresh={fetch} />}
{/* @TODO: Solved in the Angular way to satisfy functional test - should be improved*/}
<span style={{ display: resultState !== 'loading' ? 'none' : '' }}>
<div className="dscOverlay">
<LoadingSpinner />
</div>
</span>
{resultState === 'loading' && <LoadingSpinner />}
{resultState === 'ready' && (
<div className="dscWrapper__content">
<SkipBottomButton onClick={onSkipBottomButtonClick} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import { FormattedMessage } from '@kbn/i18n/react';

export function LoadingSpinner() {
return (
<>
<div className="dscOverlay">
<EuiTitle size="s" data-test-subj="loadingSpinnerText">
<h2>
<FormattedMessage id="discover.searchingTitle" defaultMessage="Searching" />
</h2>
</EuiTitle>
<EuiSpacer size="m" />
<EuiLoadingSpinner size="l" data-test-subj="loadingSpinner" />
</>
</div>
);
}
8 changes: 4 additions & 4 deletions test/functional/page_objects/discover_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider
const { header } = getPageObjects(['header']);
const browser = getService('browser');
const globalNav = getService('globalNav');
const config = getService('config');
const defaultFindTimeout = config.get('timeouts.find');
const elasticChart = getService('elasticChart');
const docTable = getService('docTable');

Expand Down Expand Up @@ -84,8 +82,10 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider
}

public async waitUntilSearchingHasFinished() {
const spinner = await testSubjects.find('loadingSpinner');
await find.waitForElementHidden(spinner, defaultFindTimeout * 10);
await retry.waitFor('loading spinner doesnt exist', async () => {
kertal marked this conversation as resolved.
Show resolved Hide resolved
const spinner = await testSubjects.exists('loadingSpinner');
return !spinner;
});
}

public async getColumnHeaders() {
Expand Down