-
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.
Migrate ui/notify/fatal_error to new platform (#20752)
Fixes #20695 Extracts the "fatal error" handling logic from the `ui/notify` module and reimplements it in the new platform, using EUI for the fatal error page and continuing to support the `fatalError()` and `addFatalErrorCallback()` methods exported by the `ui/notify` module. ![image](https://user-images.githubusercontent.com/1329312/43032175-d37fbafc-8c65-11e8-8f1f-da71f0dac014.png)
- Loading branch information
Spencer
authored
Jul 30, 2018
1 parent
3b74158
commit 1532c5e
Showing
34 changed files
with
1,293 additions
and
223 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export default function(selector: string): string; |
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,6 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"include": [ | ||
"index.d.ts" | ||
], | ||
} |
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
94 changes: 94 additions & 0 deletions
94
src/core/public/fatal_errors/__snapshots__/fatal_errors_screen.test.tsx.snap
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,94 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`rendering render matches snapshot 1`] = ` | ||
<EuiPage | ||
restrictWidth={false} | ||
style={ | ||
Object { | ||
"minHeight": "100vh", | ||
} | ||
} | ||
> | ||
<EuiPageBody | ||
restrictWidth={false} | ||
> | ||
<EuiPageContent | ||
horizontalPosition="center" | ||
panelPaddingSize="l" | ||
verticalPosition="center" | ||
> | ||
<EuiEmptyPrompt | ||
actions={ | ||
Array [ | ||
<EuiButton | ||
color="primary" | ||
data-test-subj="clearSession" | ||
fill={true} | ||
iconSide="left" | ||
onClick={[Function]} | ||
type="button" | ||
> | ||
Clear your session | ||
</EuiButton>, | ||
<EuiButtonEmpty | ||
color="primary" | ||
data-test-subj="goBack" | ||
iconSide="left" | ||
onClick={[Function]} | ||
type="button" | ||
> | ||
Go back | ||
</EuiButtonEmpty>, | ||
] | ||
} | ||
body={ | ||
<p> | ||
Try refreshing the page. If that doesn't work, go back to the previous page or clear your session data. | ||
</p> | ||
} | ||
iconColor="danger" | ||
iconType="alert" | ||
title={ | ||
<h2> | ||
Something went wrong | ||
</h2> | ||
} | ||
/> | ||
<EuiCallOut | ||
color="danger" | ||
iconType="alert" | ||
key="0" | ||
size="m" | ||
title="foo" | ||
> | ||
<EuiCodeBlock | ||
className="eui-textBreakAll" | ||
language="bash" | ||
> | ||
Version: bar | ||
Build: 123 | ||
Error: foo | ||
stack...foo.js:1:1 | ||
</EuiCodeBlock> | ||
</EuiCallOut> | ||
<EuiCallOut | ||
color="danger" | ||
iconType="alert" | ||
key="1" | ||
size="m" | ||
title="bar" | ||
> | ||
<EuiCodeBlock | ||
className="eui-textBreakAll" | ||
language="bash" | ||
> | ||
Version: bar | ||
Build: 123 | ||
Error: bar | ||
stack...bar.js:1:1 | ||
</EuiCodeBlock> | ||
</EuiCallOut> | ||
</EuiPageContent> | ||
</EuiPageBody> | ||
</EuiPage> | ||
`; |
20 changes: 20 additions & 0 deletions
20
src/core/public/fatal_errors/__snapshots__/fatal_errors_service.test.ts.snap
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,20 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`#add() deletes all children of rootDomElement and renders <FatalErrorScreen /> into it: fatal error screen component 1`] = ` | ||
Array [ | ||
Array [ | ||
<FatalErrorsScreen | ||
buildNumber="kibanaBuildNumber" | ||
errorInfo$={Rx.Observable} | ||
kibanaVersion="kibanaVersion" | ||
/>, | ||
<div />, | ||
], | ||
] | ||
`; | ||
|
||
exports[`#add() deletes all children of rootDomElement and renders <FatalErrorScreen /> into it: fatal error screen container 1`] = ` | ||
<div> | ||
<div /> | ||
</div> | ||
`; |
Oops, something went wrong.