Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding whitespace prop to EuiCodeBlockProps #4475

Merged
merged 9 commits into from
Feb 11, 2021

Conversation

ashikmeerankutty
Copy link
Contributor

@ashikmeerankutty ashikmeerankutty commented Feb 2, 2021

Summary

Fixes #4473

  • Added whitespace prop to EuiCodeBlockProps

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • Checked in mobile
  • Checked in Chrome, Safari, Edge, and Firefox
  • Props have proper autodocs and playground toggles
    - [ ] Added documentation
    - [ ] Checked Code Sandbox works for the any docs examples
    - [ ] Added or updated jest tests
    - [ ] Checked for breaking changes and labeled appropriately
    - [ ] Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@kibanamachine
Copy link

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@thompsongl
Copy link
Contributor

Thanks, @ashikmeerankutty!
Asking because I know you are capable 😉 :

Could you look into refactoring the types for code_block, code, and _code_block to avoid bugs like this in the future?
Here's the idea:
The types for EuiCodeBlock and EuiCodeBlockImpl are identical except for inline (inline?: boolean for EuiCodeBlockImpl; inline?: false; for EuiCodeBlock). We're currently duplicating type definitions in both files..
The types for EuiCode are a subset of the types of EuiCodeBlockImpl: language, transparentBackground, and inline. Again, only inline is different (inline?: boolean for EuiCodeBlockImpl; inline?: true; for EuiCode).
Essentially, both could extend from a EuiCodeBlockImpl type interface.

No problem if you can't take it on. Just let me know and I'll push a commit to this branch.

@ashikmeerankutty
Copy link
Contributor Author

@thompsongl Thanks for the review. I will refactor those types and push.

@ashikmeerankutty
Copy link
Contributor Author

@thompsongl Sorry for the delay, It seems to be the only difference between EuiCodeBlock and EuiCode is the inline prop. For EuiCodeBlock it is false and EuiCode it is true. So do we actually need to expose the inline prop for both ?.

@thompsongl
Copy link
Contributor

So do we actually need to expose the inline prop for both ?

Nope. It's not possible to change the inline value for either, so it's not necessary to expose in the props table.

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

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

This is much cleaner; than you!

@ashikmeerankutty
Copy link
Contributor Author

@thompsongl Updated the PR with the changes requested. Please do review.

@thompsongl thompsongl self-requested a review February 10, 2021 18:50
@thompsongl
Copy link
Contributor

jenkins test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4475/

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

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

LGTM!
Thanks, @ashikmeerankutty!

@thompsongl
Copy link
Contributor

jenkins test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4475/

@thompsongl
Copy link
Contributor

jenkins test this

flaky

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4475/

@thompsongl thompsongl merged commit da39314 into elastic:master Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[EuiCodeBlock] whiteSpace property missing in type
3 participants