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

[EuiHeader] Added sections and position props #2928

Merged
merged 8 commits into from
Mar 5, 2020

Conversation

cchaos
Copy link
Contributor

@cchaos cchaos commented Feb 25, 2020

Continuing support for new nav updates

Sections

One of the most complex components to build is the EuiHeader. There are 6 different components you have to weave together the right way to display in the header.

This PR is an attempt to simplify a portion of that by allowing the user to pass sections instead of children.

Screen Shot 2020-02-28 at 17 50 09 PM

The docs example basically spits out the same content as the example above it but in 20 less lines of code (where it matters: in the render).

The passed prop looks something like this:

sections={[
  {
    items: [...],
    borders: 'right',
    breadcrumbs: [...],
  },
  {
    items: [...],
  },
]}

Where items is just an array of nodes, and breadcrumbs is an array of breadcrumbs. All the truncation should work properly and each section is spaced via space-between.


Position

I also decided that we should be managing the fixed position since we also know the height of the header. So I added the prop position which defaults to static but if changed to fixed will also apply a class to the window body with the correct padding.

Screen Recording 2020-02-25 at 06 26 PM

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • Checked in mobile
  • Checked in IE11 and Firefox
  • Props have proper autodocs
  • Added documentation 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

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

@cchaos
Copy link
Contributor Author

cchaos commented Feb 25, 2020

Hmm, don't review this PR just yet, I've got a truncation issue with the breadcrumbs.

@cchaos cchaos changed the title [EuiHeader] Added sections and position props [WIP] [EuiHeader] Added sections and position props Feb 26, 2020
@cchaos
Copy link
Contributor Author

cchaos commented Feb 26, 2020

I take this one back for now, I want to rethink it some more. This is originally just the quick way I did it in the K8 POC, but I don't think it's the right solution. Since I can't put into draft status, it is in WIP status.

@cchaos cchaos changed the title [WIP] [EuiHeader] Added sections and position props [EuiHeader] Added sections and position props Feb 28, 2020
@cchaos
Copy link
Contributor Author

cchaos commented Feb 28, 2020

Ok, I think I came up with a better solution and I've pulled this back into read for review status.

@kibanamachine
Copy link

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

@cchaos cchaos requested a review from thompsongl March 2, 2020 19:31
@kibanamachine
Copy link

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

@cchaos
Copy link
Contributor Author

cchaos commented Mar 2, 2020

I really need to start making sure I push my changes before I create or update PR's. I'm really sorrry @thompsongl & @snide if you've already starting looking at this, but apparently I never pushed my last commit which actually fixes it from my last attempt. It is now up to date. 😑

@kibanamachine
Copy link

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

@cchaos
Copy link
Contributor Author

cchaos commented Mar 3, 2020

jenkins, test this

@kibanamachine
Copy link

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

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

Need to rebase or merge master and update the CL entry

@cchaos cchaos requested review from miukimiu and removed request for snide March 4, 2020 23:03
@kibanamachine
Copy link

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

Copy link
Contributor

@miukimiu miukimiu left a comment

Choose a reason for hiding this comment

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

I reviewed the code and the build preview and everything LGTM! 🎉

@kibanamachine
Copy link

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

@cchaos cchaos merged commit 7cc113f into elastic:master Mar 5, 2020
@cchaos cchaos deleted the header_sections branch March 5, 2020 16:38
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