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

[Feature] Converting EuiPageTemplate to use ReactContext instead of cloneChildren #5987

Merged

Conversation

cchaos
Copy link
Contributor

@cchaos cchaos commented Jun 21, 2022

Summary

Since most of Kibana's usages wildly separate the content from the template, the cloning method was not going to work as it required the children to be direct descendents without any file obfuscation.

So instead, I'm creating a template context in order to pass through the top-level props like padding and restricted width.

The exception of which is the sidebar. This needs to be a direct child because the presence of this exact element determines the configuration. I've noted this in the docs.

The bottom bar now uses createPortal to insert itself at the right place.

Checklist

  • [ ] Checked 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 any docs examples
  • Added or updated jest and cypress tests
  • [ ] Checked for breaking changes and labeled appropriately
  • [ ] Checked for accessibility including keyboard-only and screenreader modes
  • [ ] Updated the Figma library counterpart
  • [ ] A changelog entry exists and is marked appropriately

@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@cchaos cchaos marked this pull request as ready for review June 22, 2022 22:09
@cchaos cchaos requested a review from thompsongl June 22, 2022 22:09
@cchaos
Copy link
Contributor Author

cchaos commented Jun 22, 2022

@thompsongl This PR is good now, do you mind doing a quick once-over?

@kibanamachine
Copy link

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

@cchaos
Copy link
Contributor Author

cchaos commented Jun 22, 2022

Nevermind, sending this back to draft because the portal doesn't work when nested... 😖

@cchaos cchaos marked this pull request as draft June 22, 2022 22:40
@cchaos cchaos removed the request for review from thompsongl June 22, 2022 22:40
@cchaos cchaos marked this pull request as ready for review June 23, 2022 14:43
@cchaos
Copy link
Contributor Author

cchaos commented Jun 23, 2022

Ok, ready for review again 🤦‍♀️

@cchaos cchaos requested a review from thompsongl June 23, 2022 14:43
@kibanamachine
Copy link

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

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.

Nice! This turned out well; LGTM

@cchaos cchaos changed the title [WIP] Converting EuiPageTemplate to use ReactContext instead of cloneChildren [Feature] Converting EuiPageTemplate to use ReactContext instead of cloneChildren Jun 23, 2022
@kibanamachine
Copy link

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

@cchaos
Copy link
Contributor Author

cchaos commented Jun 23, 2022

Flakey?
Jenkins, test this

@cchaos
Copy link
Contributor Author

cchaos commented Jun 23, 2022

CI's drunk, I need to move on, since this is merging into a feature branch anyway, I'm merging.

@cchaos cchaos merged commit f47547b into elastic:feature/page_templates Jun 23, 2022
@cchaos cchaos deleted the _page_next/using_context branch June 23, 2022 17:43
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.

3 participants