-
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 'main' into discover_less_field_list_loading_v2
- Loading branch information
Showing
10 changed files
with
66 additions
and
201 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 was deleted.
Oops, something went wrong.
68 changes: 0 additions & 68 deletions
68
src/plugins/share/public/url_service/redirect/components/empty_prompt.tsx
This file was deleted.
Oops, something went wrong.
53 changes: 53 additions & 0 deletions
53
src/plugins/share/public/url_service/redirect/components/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,53 @@ | ||
/* | ||
* 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 * as React from 'react'; | ||
import { | ||
EuiEmptyPrompt, | ||
EuiCallOut, | ||
EuiCodeBlock, | ||
EuiSpacer, | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
EuiText, | ||
} from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
|
||
const defaultTitle = i18n.translate('share.urlService.redirect.components.Error.title', { | ||
defaultMessage: 'Redirection error', | ||
description: | ||
'Title displayed to user in redirect endpoint when redirection cannot be performed successfully.', | ||
}); | ||
|
||
export interface ErrorProps { | ||
title?: string; | ||
error: Error; | ||
} | ||
|
||
export const Error: React.FC<ErrorProps> = ({ title = defaultTitle, error }) => { | ||
return ( | ||
<EuiEmptyPrompt | ||
iconType={'error'} | ||
iconColor={'danger'} | ||
title={<h2>{title}</h2>} | ||
body={ | ||
<EuiCallOut color="danger"> | ||
<EuiFlexGroup justifyContent="spaceAround"> | ||
<EuiFlexItem> | ||
<EuiText color="danger">{error.message}</EuiText> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
<EuiSpacer size={'l'} /> | ||
<EuiCodeBlock language="bash" className="eui-textBreakAll" isCopyable> | ||
{error.stack ? error.stack : ''} | ||
</EuiCodeBlock> | ||
</EuiCallOut> | ||
} | ||
/> | ||
); | ||
}; |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.