Skip to content

Use EuiCodeBlock for JSON settings, and overflow if long value#20744

Merged
jen-huang merged 2 commits intoelastic:masterfrom
jen-huang:fix/json-default-value
Jul 13, 2018
Merged

Use EuiCodeBlock for JSON settings, and overflow if long value#20744
jen-huang merged 2 commits intoelastic:masterfrom
jen-huang:fix/json-default-value

Conversation

@jen-huang
Copy link
Contributor

Fixes #20156

In Advanced Settings, change display of JSON default setting value to use EuiCodeBlock, and use its overflowHeight prop for long values. Screenshot shows a long JSON default value and a short JSON value:

screen shot 2018-07-12 at 1 33 31 pm

<EuiCode>
default_value
</EuiCode>
<UNDEFINED>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UNDEFINED in place of React.Fragment is a bug which is fixed with jest >= v23.0.0. I'm investigating a possible jest upgrade in another branch.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@bmcconaghy bmcconaghy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM, just had a question about the language.

<Fragment>
Default:
<EuiCodeBlock
language="js"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be json instead of js?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call, for some reason I thought both would highlight the same, but json is a little cleaner. updated.

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Checked code and tested locally.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants