-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* [Discover] Deangularize the loading spinner * Eslint changes Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
- Loading branch information
1 parent
53f7f13
commit b095691
Showing
4 changed files
with
78 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/plugins/discover/public/application/components/loading_spinner/loading_spinner.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
import React from 'react'; | ||
import { mountWithIntl } from 'test_utils/enzyme_helpers'; | ||
import { ReactWrapper } from 'enzyme'; | ||
import { LoadingSpinner } from './loading_spinner'; | ||
// @ts-ignore | ||
import { findTestSubject } from '@elastic/eui/lib/test'; | ||
|
||
describe('loading spinner', function () { | ||
let component: ReactWrapper; | ||
|
||
it('LoadingSpinner renders a Searching text and a spinner', () => { | ||
component = mountWithIntl(<LoadingSpinner />); | ||
expect(findTestSubject(component, 'loadingSpinnerText').text()).toBe('Searching'); | ||
expect(findTestSubject(component, 'loadingSpinner').length).toBe(1); | ||
}); | ||
}); |
41 changes: 41 additions & 0 deletions
41
src/plugins/discover/public/application/components/loading_spinner/loading_spinner.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
import React from 'react'; | ||
import { EuiLoadingSpinner, EuiTitle, EuiSpacer } from '@elastic/eui'; | ||
import { FormattedMessage, I18nProvider } from '@kbn/i18n/react'; | ||
|
||
export function LoadingSpinner() { | ||
return ( | ||
<I18nProvider> | ||
<> | ||
<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" /> | ||
</> | ||
</I18nProvider> | ||
); | ||
} | ||
|
||
export function createLoadingSpinnerDirective(reactDirective: any) { | ||
return reactDirective(LoadingSpinner); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters