Skip to content

Commit

Permalink
Add EuiLoadingChart and EuiErrorBoundary
Browse files Browse the repository at this point in the history
  • Loading branch information
sulemanof committed May 15, 2020
1 parent 0cfda13 commit 7763e29
Showing 1 changed file with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import React, { Suspense, lazy } from 'react';
import { render, unmountComponentAtNode } from 'react-dom';
import { i18n } from '@kbn/i18n';
import { EventEmitter } from 'events';
import { EuiLoadingSpinner } from '@elastic/eui';
import { EuiErrorBoundary, EuiLoadingChart } from '@elastic/eui';

import { EditorRenderProps } from 'src/plugins/visualize/public';
import { Vis, VisualizeEmbeddableContract } from 'src/plugins/visualizations/public';
Expand Down Expand Up @@ -80,9 +80,24 @@ class DefaultEditorController {

render(props: EditorRenderProps) {
render(
<Suspense fallback={<EuiLoadingSpinner />}>
<DefaultEditor {...this.state} {...props} />
</Suspense>,
<EuiErrorBoundary>
<Suspense
fallback={
<div
style={{
display: 'flex',
flex: '1 1 auto',
justifyContent: 'center',
alignItems: 'center',
}}
>
<EuiLoadingChart size="xl" />
</div>
}
>
<DefaultEditor {...this.state} {...props} />
</Suspense>
</EuiErrorBoundary>,
this.el
);
}
Expand Down

0 comments on commit 7763e29

Please sign in to comment.