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

[Docs] Adds a *NEW* badge to side nav items that are new #3283

Merged
merged 7 commits into from
Apr 9, 2020

Conversation

cchaos
Copy link
Contributor

@cchaos cchaos commented Apr 8, 2020

This is still a very manual process (it's not automatic with releases) but...

When there is a new component added to the docs, you can now add the key isNew: true to the sections object (just below the title in the _example.js files). This will add the pink NEW badge in the side nav.

Here are examples of the different states including truncation.

Screen Shot 2020-04-08 at 17 44 09 PM

Screen Shot 2020-04-08 at 17 44 04 PM

Screen Shot 2020-04-08 at 17 43 50 PM

Screen Shot 2020-04-08 at 17 43 37 PM


Also

I had to fix EuiSideNavItem's to pass down className on both itself and the icon otherwise custom classNames were getting overridden/ignored. Fixes part of #2380

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

Copy link
Contributor

@snide snide left a comment

Choose a reason for hiding this comment

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

isNew works. As an alternative. We could use dateIntroduced or something, and then check last 60 days or something. It would only work against the build time (which is fine), but might be a neat little log over time. At least then you wouldn't have to manually change them.

Code looks good to me. Anyways, just a suggestion. I'm fine either way.

@kibanamachine
Copy link

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

@cchaos
Copy link
Contributor Author

cchaos commented Apr 9, 2020

We could use dateIntroduced or something, and then check last 60 days or something.

Yeah that would be pretty cool. I think for now, at least this gets us the look/placement of the badge. We can certainly modify how it gets populated down the line.

@kibanamachine
Copy link

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

@cchaos cchaos merged commit 6a0ab1e into elastic:master Apr 9, 2020
@cchaos cchaos deleted the new_badge branch April 9, 2020 15:52
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