mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Remove highlighting from the review step of the Index Template wizard, for requests beyond a certain size. This will prevent the syntax highlighting from slowing down Kibana when reviewing large requests. (#53549)
This commit is contained in:
parent
dd1faba7e3
commit
194f2ca6ed
1 changed files with 5 additions and 1 deletions
|
@ -163,6 +163,10 @@ export const StepReview: React.FunctionComponent<StepProps> = ({ template, updat
|
|||
const templateString = JSON.stringify(serializedTemplate, null, 2);
|
||||
const request = `${endpoint}\n${templateString}`;
|
||||
|
||||
// Beyond a certain point, highlighting the syntax will bog down performance to unacceptable
|
||||
// levels. This way we prevent that happening for very large requests.
|
||||
const language = request.length < 60000 ? 'json' : undefined;
|
||||
|
||||
return (
|
||||
<div data-test-subj="requestTab">
|
||||
<EuiSpacer size="m" />
|
||||
|
@ -178,7 +182,7 @@ export const StepReview: React.FunctionComponent<StepProps> = ({ template, updat
|
|||
|
||||
<EuiSpacer size="m" />
|
||||
|
||||
<EuiCodeBlock language="json" isCopyable>
|
||||
<EuiCodeBlock language={language} isCopyable>
|
||||
{request}
|
||||
</EuiCodeBlock>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue