kopia lustrzana https://github.com/wagtail/wagtail
Improve error display cross-browsers, and add translatable string
rodzic
411895e450
commit
7238f22ebd
|
@ -83,7 +83,7 @@ class EditorFallback extends PureComponent {
|
|||
className="Draftail-ToolbarButton"
|
||||
onClick={this.toggleError}
|
||||
>
|
||||
{'Show error'}
|
||||
{STRINGS.SHOW_ERROR}
|
||||
</button>
|
||||
|
||||
{/* At first we propose reloading the editor. If it still crashes, reload the whole page. */}
|
||||
|
@ -122,7 +122,7 @@ class EditorFallback extends PureComponent {
|
|||
{showError && (
|
||||
<pre className="help-block help-critical">
|
||||
<code className="EditorFallback__error">
|
||||
{`${error.stack}\n${info.componentStack}`}
|
||||
{`${error.name}: ${error.message}\n\n${error.stack}\n${info.componentStack}`}
|
||||
</code>
|
||||
</pre>
|
||||
)}
|
||||
|
|
|
@ -88,7 +88,9 @@ exports[`EditorFallback #error #showError 1`] = `
|
|||
<code
|
||||
className="EditorFallback__error"
|
||||
>
|
||||
test stack
|
||||
Error: test
|
||||
|
||||
test stack
|
||||
test
|
||||
</code>
|
||||
</pre>
|
||||
|
|
|
@ -39,6 +39,7 @@ global.wagtailConfig = {
|
|||
RELOAD_PAGE: 'Reload the page',
|
||||
RELOAD_EDITOR: 'Reload saved content',
|
||||
SHOW_LATEST_CONTENT: 'Show latest content',
|
||||
SHOW_ERROR: 'Show error',
|
||||
EDITOR_CRASH: 'The editor just crashed. Content has been reset to the last saved version.',
|
||||
},
|
||||
};
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
RELOAD_PAGE: "{% trans 'Reload the page' %}",
|
||||
RELOAD_EDITOR: "{% trans 'Reload saved content' %}",
|
||||
SHOW_LATEST_CONTENT: "{% trans 'Show latest content' %}",
|
||||
SHOW_ERROR: "{% trans 'Show error' %}",
|
||||
EDITOR_CRASH: "{% trans 'The editor just crashed. Content has been reset to the last saved version.' %}",
|
||||
};
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue