-
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.
Merge branch 'master' into bugfix/ingest_circle_processor
- Loading branch information
Showing
53 changed files
with
970 additions
and
1,032 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
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
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
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
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
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
72 changes: 72 additions & 0 deletions
72
src/plugins/es_ui_shared/__packages_do_not_import__/authorization/components/page_error.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,72 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { EuiSpacer, EuiEmptyPrompt, EuiPageContent } from '@elastic/eui'; | ||
import React from 'react'; | ||
import { APP_WRAPPER_CLASS } from '../../../../../../src/core/public'; | ||
import { Error } from '../types'; | ||
|
||
interface Props { | ||
title: React.ReactNode; | ||
error: Error; | ||
actions?: JSX.Element; | ||
isCentered?: boolean; | ||
} | ||
|
||
/* | ||
* A reusable component to handle full page errors. | ||
* This is based on Kibana design guidelines related | ||
* to the new management navigation structure. | ||
* In some scenarios, it replaces the usage of <SectionError />. | ||
*/ | ||
|
||
export const PageError: React.FunctionComponent<Props> = ({ | ||
title, | ||
error, | ||
actions, | ||
isCentered, | ||
...rest | ||
}) => { | ||
const { | ||
error: errorString, | ||
cause, // wrapEsError() on the server adds a "cause" array | ||
message, | ||
} = error; | ||
|
||
const errorContent = ( | ||
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="danger"> | ||
<EuiEmptyPrompt | ||
title={<h2>{title}</h2>} | ||
body={ | ||
<> | ||
{cause ? message || errorString : <p>{message || errorString}</p>} | ||
{cause && ( | ||
<> | ||
<EuiSpacer size="s" /> | ||
<ul> | ||
{cause.map((causeMsg, i) => ( | ||
<li key={i}>{causeMsg}</li> | ||
))} | ||
</ul> | ||
</> | ||
)} | ||
</> | ||
} | ||
iconType="alert" | ||
actions={actions} | ||
{...rest} | ||
/> | ||
</EuiPageContent> | ||
); | ||
|
||
if (isCentered) { | ||
return <div className={APP_WRAPPER_CLASS}>{errorContent}</div>; | ||
} | ||
|
||
return errorContent; | ||
}; |
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
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
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
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
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
Oops, something went wrong.