From 1df2f9bfd0176aef8dff251314a6e2ac27ade809 Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Wed, 20 Dec 2017 20:56:23 -0800 Subject: [PATCH 1/3] Support newlines in EuiErrorBoundary. --- src-docs/src/views/error_boundary/error_boundary.js | 2 +- .../__snapshots__/error_boundary.test.js.snap | 8 +++++--- src/components/error_boundary/error_boundary.js | 8 +++++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src-docs/src/views/error_boundary/error_boundary.js b/src-docs/src/views/error_boundary/error_boundary.js index ec35c034ad6..b501a5889ed 100644 --- a/src-docs/src/views/error_boundary/error_boundary.js +++ b/src-docs/src/views/error_boundary/error_boundary.js @@ -5,7 +5,7 @@ import { } from '../../../../src/components'; const BadComponent = () => { - throw new Error('There was a terrible error!'); + throw new Error('I\'m here to kick butt and chew bubblegum.\n\n\And I\'m all out of gum.'); }; export default () => ( diff --git a/src/components/error_boundary/__snapshots__/error_boundary.test.js.snap b/src/components/error_boundary/__snapshots__/error_boundary.test.js.snap index 323e08e4f6d..5115bd4559b 100644 --- a/src/components/error_boundary/__snapshots__/error_boundary.test.js.snap +++ b/src/components/error_boundary/__snapshots__/error_boundary.test.js.snap @@ -15,9 +15,11 @@ exports[`EuiErrorBoundary is rendered with an error 1`] = `

Error

-

- Error: Terrible error! -

+
+        

+ Error: Terrible error! +

+
diff --git a/src/components/error_boundary/error_boundary.js b/src/components/error_boundary/error_boundary.js index edf9f5bdf07..5040100834a 100644 --- a/src/components/error_boundary/error_boundary.js +++ b/src/components/error_boundary/error_boundary.js @@ -42,9 +42,11 @@ export class EuiErrorBoundary extends Component {

Error

-

- {this.state.error && this.state.error.toString()} -

+
+                

+ {this.state.error && this.state.error.toString()} +

+
From 4d1482e55aa229f7dbb38f8e9e9dc65f45b42008 Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Wed, 20 Dec 2017 22:05:43 -0800 Subject: [PATCH 2/3] Update CHANGELOG. --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ed8d70953f..a31c8b61547 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # [`master`](https://github.com/elastic/eui/tree/master) -- Updated `euiPopover` to propogate `panelPaddingSize` padding values to content only (title does inherit horizontal values) via CSS. [(#229)](https://github.com/elastic/eui/pull/229) +- Updated `euiPopover` to propagate `panelPaddingSize` padding values to content only (title does inherit horizontal values) via CSS. [(#229)](https://github.com/elastic/eui/pull/229) +- Updated `` to preserve newlines in error. [(#238)[https://github.com/elastic/eui/pull/238]] **Bug fixes** From 78d0924495680d031bcabc44bcaf73af4ba9f56e Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Wed, 20 Dec 2017 22:08:36 -0800 Subject: [PATCH 3/3] Update test. --- .../error_boundary/__snapshots__/error_boundary.test.js.snap | 4 +++- src/components/error_boundary/error_boundary.test.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/error_boundary/__snapshots__/error_boundary.test.js.snap b/src/components/error_boundary/__snapshots__/error_boundary.test.js.snap index 5115bd4559b..5124b9ba82a 100644 --- a/src/components/error_boundary/__snapshots__/error_boundary.test.js.snap +++ b/src/components/error_boundary/__snapshots__/error_boundary.test.js.snap @@ -17,7 +17,9 @@ exports[`EuiErrorBoundary is rendered with an error 1`] = `
         

- Error: Terrible error! + Error: I'm here to kick butt and chew bubblegum. + +And I'm all out of gum.

diff --git a/src/components/error_boundary/error_boundary.test.js b/src/components/error_boundary/error_boundary.test.js index 989e0ccfc11..8ece71c12e7 100644 --- a/src/components/error_boundary/error_boundary.test.js +++ b/src/components/error_boundary/error_boundary.test.js @@ -12,7 +12,7 @@ const GoodComponent = () => ( ); const BadComponent = () => { - throw new Error('Terrible error!'); + throw new Error('I\'m here to kick butt and chew bubblegum.\n\n\And I\'m all out of gum.'); }; describe('EuiErrorBoundary', () => {