Skip to content

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

Merged
cchaos merged 8 commits into
elastic:feature/page_templatesfrom
cchaos:_page_next/using_context
Jun 23, 2022
Merged

cchaos merged 8 commits into
elastic:feature/page_templatesfrom
cchaos:_page_next/using_context

Conversation

@cchaos

@cchaos cchaos commented Jun 21, 2022 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

@kibanamachine

Copy link
Copy Markdown
Contributor

@kibanamachine

Copy link
Copy Markdown
Contributor

@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

cchaos commented Jun 22, 2022

Copy link
Copy Markdown
Contributor Author

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

@kibanamachine

Copy link
Copy Markdown
Contributor

@cchaos

cchaos commented Jun 22, 2022

Copy link
Copy Markdown
Contributor Author

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

cchaos commented Jun 23, 2022

Copy link
Copy Markdown
Contributor Author

Ok, ready for review again 🤦‍♀️

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

Copy link
Copy Markdown
Contributor

@thompsongl thompsongl left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

@cchaos

cchaos commented Jun 23, 2022

Copy link
Copy Markdown
Contributor Author

Flakey?
Jenkins, test this

@cchaos

cchaos commented Jun 23, 2022

Copy link
Copy Markdown
Contributor Author

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
@cchaos cchaos mentioned this pull request Aug 8, 2022
11 tasks done
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