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

[EuiPageTemplates] Some fixes for BWC #6015

Merged

Conversation

cchaos
Copy link
Contributor

@cchaos cchaos commented Jun 30, 2022

Note
I'm testing this PR against Kibana locally and I'm hopeful we have something we can finally publish to Kibana without too much worry about negative effects.

EuiPageTemplate

  • Added mainProps to support custom id and other basic HTML attributes to be passed to the inner / <main> content wrapper

EuiPageSection

  • Fixed the restrictWidth rendered styles for custom values
  • Reduced complexity of margin styles
  • Converted to use logical properties

EuiPageTemplate.Sidebar

  • Fixed the overflow scroll by setting height to auto instead of 100%.

EuiPageTemplate.BottomBar

  • Now excludes paddingSize from being passed through since this affects all 4 sides and un-aligns the contents to the page contents. If consumers want to adjust, they can pass their own style overrides.
  • Moved inline styles to css block and added overflow: hidden in case the contents contains negative margins (like flex groups) that are larger than the padding area.

EuiPageTemplate__Deprecated

  • Because I removed the nested styles that would apply margin after page headers within page body, I wanted to keep some level of BWC with current implementations of the template by manually adding in bottom margin based on the configuration and paddingSize.
  • Added a "Deprecated" section (and playground) to the docs so we can monitor any unexpected changes

Screen Shot 2022-06-23 at 14 45 52 PM

Other

  • Added height as an option to the euiYScroll() mixins to easily change from 100% to something else.
  • Removed this feature's own version of euiBreakpoint Emotion mixin
  • Fixed docs site 404 illustrations
  • Fixed Screen reader live docs’ usage of EuiPageTemplate

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_6015/

cchaos added 2 commits July 26, 2022 14:08
- Adds `mainProps` to EuiPageTemplate for allowing customization of things like `id` (for skip link)
- Fixed docs site 404 illustrations
- Removed old `euiBreakpoint` for new one
- Fixed Screen reader live docs’ usage of EuiPageTemplate
@cchaos cchaos marked this pull request as ready for review July 27, 2022 15:29
@cchaos
Copy link
Contributor Author

cchaos commented Jul 27, 2022

Ok, this PR is ready for review. Once merged into the Feature branch, I'll do one final pass through the entire checklist including the final CL items and Kibana local test.

@kibanamachine
Copy link

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

@thompsongl thompsongl self-requested a review July 27, 2022 16:22
Copy link
Contributor

@elizabetdev elizabetdev left a comment

Choose a reason for hiding this comment

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

I looked at the code and tested it locally in Chrome, Safari, and Firefox.

There's a local warning that must be resolved:

Warning: React does not recognize the `innerProps` prop on a DOM element.

I also added some suggestions and all the rest looks good to me. 🎉

src-docs/src/views/page_template/page_template_example.js Outdated Show resolved Hide resolved
src-docs/src/views/page_template/page_template_example.js Outdated Show resolved Hide resolved
src-docs/src/views/page_template/deprecated.tsx Outdated Show resolved Hide resolved
@@ -0,0 +1,30 @@
import React, { useState } from 'react';

import { EuiPageTemplate_Deprecated as EuiPageTemplate } from '../../../../src';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like the GREP mechanism for the imports of the source code doesn't understand this as syntax and is adding commas between:
Screen Shot 2022-07-28 at 13 58 20 PM

Anyone know of a quick fix?

Copy link
Contributor

Choose a reason for hiding this comment

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

My attempt to fix this. Replace the following code:

const combinedImports = elasticImports.join(', ');

With:

const combinedImports = elasticImports.includes('as')
      ? elasticImports.join(' ')
      : elasticImports.join(',\n  ');

But better @thompsongl comes with a better solution. 🤣

Copy link
Contributor

Choose a reason for hiding this comment

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

865cf85 should do it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🙌 Yoda best!

@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

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.

Code changes LGTM!

@cchaos cchaos requested a review from elizabetdev August 1, 2022 17:10
Copy link
Contributor

@elizabetdev elizabetdev left a comment

Choose a reason for hiding this comment

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

Thanks, @cchaos! LGTM! 🎉

@cchaos cchaos merged commit cc1c6ed into elastic:feature/page_templates Aug 2, 2022
@cchaos cchaos deleted the _page_next/fix_deprecated branch August 2, 2022 14:10
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.

4 participants