Skip to content

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

Merged
cchaos merged 7 commits into
elastic:masterfrom
cchaos:new_badge
Apr 9, 2020
Merged

cchaos merged 7 commits into
elastic:masterfrom
cchaos:new_badge

Conversation

@cchaos

@cchaos cchaos commented Apr 8, 2020 •

Copy link
Copy Markdown
Contributor

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

@snide snide 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.

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

@cchaos

cchaos commented Apr 9, 2020

Copy link
Copy Markdown
Contributor Author

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

@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