Skip to content

[Page Templates Feature] EuiPage docs & toggles#5662

Merged
cchaos merged 6 commits intoelastic:feature/page_templatesfrom
cchaos:feature_page_templates/page_docs_toggles
Apr 6, 2022
Merged

[Page Templates Feature] EuiPage docs & toggles#5662
cchaos merged 6 commits intoelastic:feature/page_templatesfrom
cchaos:feature_page_templates/page_docs_toggles

Conversation

@cchaos
Copy link
Copy Markdown
Contributor

@cchaos cchaos commented Feb 24, 2022

Summary

This PR fills out the new EuiPage specific doc section under Page components. It also is one example of setting up a demo example pattern that creates outside toggles and passes these through as props. It would be a good example PR to iterate on this behavior and the UI supporting it.

Screen Recording 2022-04-04 at 12 33 25 PM

[Docs only] Checklist

^^ In the codesandbox the content is blank because the default values are just fragments. I think this is ok because the consumer can then just replace with their own content but the code doesn't break.

cchaos added 2 commits February 15, 2022 17:33
Comment on lines +15 to +17
}: EuiPageProps & {
content: ReactElement;
sideBar: ReactElement;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This example extends all of EuiPageProps in order to allow the pass through from the file with the toggles while creating custom ones for what would be user-generated content.

direction={horizontal ? 'row' : 'column'}
/>
</div>
<EuiPanel style={{ borderWidth: '1px 0' }} hasBorder borderRadius="none">
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm up for design thoughts on the visual of this. I was having trouble deciding if the toggles should be outside of the example panel, above the example, or here (between the example and the code).

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.

I was having trouble deciding if the toggles should be outside of the example panel, above the example, or here (between the example and the code).

IMO it looks better to have the toggles as part of the demo panel. In the following examples, the controls/toggles seem a little bit lost.

controls for demos@2x

No preference if they should be above or between the example and the code but not outside. I just think we should establish a pattern and then we can update the other examples in EUI.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed. Ok I think I'll leave them where they are for now and see if in the next PR I can create a re-usable component that would allow us to easily swap the position if we want to later for all them at once.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added this ability to the GuideSection component for reusability and updated this usage in d5e031e. It does mean that any example that wants toggles needs to use <GuideSection> directly, and not through the example object. But I feel like we're headed more and more in that direction anyway.

@cchaos cchaos requested a review from elizabetdev February 24, 2022 18:35
@kibanamachine
Copy link
Copy Markdown

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

@elizabetdev
Copy link
Copy Markdown
Contributor

jenkins test this

@kibanamachine
Copy link
Copy Markdown

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

@cee-chen cee-chen deleted the branch elastic:feature/page_templates March 31, 2022 15:55
@cee-chen cee-chen closed this Mar 31, 2022
@cee-chen
Copy link
Copy Markdown
Contributor

cee-chen commented Mar 31, 2022

Shoot, I'm an idiot, sorry, I accidentally clicked the 'delete branch' button on another PR and frantically undeleted it, but it accidentally closed this PR 🤦‍♀️

@cee-chen cee-chen reopened this Mar 31, 2022
@kibanamachine
Copy link
Copy Markdown

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

cchaos added 2 commits April 2, 2022 17:22
…tes/page_docs_toggles

# Conflicts:
#	scripts/a11y-testing.js
#	src-docs/src/views/page/page_template_example.js
#	src-docs/src/views/panel/panel_example.js
…eature_page_templates/page_docs_toggles

# Conflicts:
#	scripts/a11y-testing.js
#	src-docs/src/views/page/page_template_example.js
#	src-docs/src/views/panel/panel_example.js
@kibanamachine
Copy link
Copy Markdown

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

@cchaos
Copy link
Copy Markdown
Contributor Author

cchaos commented Apr 4, 2022

Opening this up for actual review (note, this is going into a feature branch). Also, the a11y tests are breaking because of wrong roles. But this will be fixed later.

@cchaos cchaos marked this pull request as ready for review April 4, 2022 16:38
@cchaos
Copy link
Copy Markdown
Contributor Author

cchaos commented Apr 4, 2022

Oh I meant to also say that I'm opening for review because I have a final process nailed down and want to get this effort finalized.

@cchaos cchaos requested a review from breehall April 4, 2022 18:53
Copy link
Copy Markdown
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.

LGTM! 🎉

Tested in Chrome, Safari, Edge, and Firefox.

direction={horizontal ? 'row' : 'column'}
/>
</div>
<EuiPanel style={{ borderWidth: '1px 0' }} hasBorder borderRadius="none">
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.

I was having trouble deciding if the toggles should be outside of the example panel, above the example, or here (between the example and the code).

IMO it looks better to have the toggles as part of the demo panel. In the following examples, the controls/toggles seem a little bit lost.

controls for demos@2x

No preference if they should be above or between the example and the code but not outside. I just think we should establish a pattern and then we can update the other examples in EUI.

@kibanamachine
Copy link
Copy Markdown

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

@cchaos cchaos force-pushed the feature_page_templates/page_docs_toggles branch from c7baa69 to c305078 Compare April 5, 2022 19:07
@kibanamachine
Copy link
Copy Markdown

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

…ugh custom controls

Update EuiPage’s example usage to use GuideSection directly
@kibanamachine
Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor

@breehall breehall left a comment

Choose a reason for hiding this comment

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

This looks good to me! I love the addition of toggles at the bottom of the code snippets.

Copy link
Copy Markdown
Contributor

@breehall breehall left a comment

Choose a reason for hiding this comment

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

LGTM! My comments have been addressed and this is ready to go!

@cchaos
Copy link
Copy Markdown
Contributor Author

cchaos commented Apr 6, 2022

🙌 Merging! CI says "no" but it's because of a known Axe failure that I'll be fixing later when I update the actual components. This is just a feature branch merge anyway.

@cchaos cchaos merged commit b659d6e into elastic:feature/page_templates Apr 6, 2022
@cchaos cchaos deleted the feature_page_templates/page_docs_toggles branch April 6, 2022 21:34
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.

5 participants