Skip to content

Commit

Permalink
[Discover] Loading spinner cleanup (#79819) (#80673)
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal authored Oct 15, 2020
1 parent a849d73 commit d31c227
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
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>
);
}
7 changes: 3 additions & 4 deletions test/functional/page_objects/discover_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ 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');
const config = getService('config');
const defaultFindTimeout = config.get('timeouts.find');

class DiscoverPage {
public async getChartTimespan() {
Expand Down Expand Up @@ -84,8 +84,7 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider
}

public async waitUntilSearchingHasFinished() {
const spinner = await testSubjects.find('loadingSpinner');
await find.waitForElementHidden(spinner, defaultFindTimeout * 10);
await testSubjects.missingOrFail('loadingSpinner', { timeout: defaultFindTimeout * 10 });
}

public async getColumnHeaders() {
Expand Down

0 comments on commit d31c227

Please sign in to comment.