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

Updated EuiHeaderAlert #2506

Merged
merged 13 commits into from
Nov 15, 2019
Merged

Updated EuiHeaderAlert #2506

merged 13 commits into from
Nov 15, 2019

Conversation

andreadelrio
Copy link
Contributor

Summary

Updated EuiHeaderAlert and added a new section to the docs under Header/Alerts. Removed unneeded call to i18n.

image

image

Fixes #2502

Checklist

- [ ] Checked in dark mode
- [ ] 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

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@ryankeairns ryankeairns left a comment

Choose a reason for hiding this comment

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

Left some comments, still need to review a bit.

@ryankeairns
Copy link
Contributor

This is looking really good, mostly just small things to address. Let me know if you need an example for mapping over the data.

Also, it would be good to add a note for the badge and action props just to provide a short explanation on what they do/how they affect the UI.

image

Thanks!!

@ryankeairns
Copy link
Contributor

@andreadelrio I lost track of this due to EAH and ElasticON, I'll re-check today!

Copy link
Contributor

@ryankeairns ryankeairns left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for all changes! Looks like there is one small conflict to resolve, then this should be good to go.

<div className={classes} {...rest}>
<EuiFlexGroup justifyContent="spaceBetween">
<EuiFlexItem>
<div className="euiHeaderAlert__date">{date}</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we replace the div with a time tag?

Suggested change
<div className="euiHeaderAlert__date">{date}</div>
<time className="euiHeaderAlert__date">{date}</time>

What might be a bit tougher but would love to see as well is to support automatically filling in a datetime attribute. I'm not sure what EuiI18n supports or not but instead of relying on Kibana (or other implementing devs) to pass in internationalized date strings, if EUI could accept an ISO8601 and then use that both in the datetime attribute and then "translate" it for the human readable section that'd be awesome. Would look something like:

<time className="euiHeaderAlert__date" datatime={date}>
	// NOTE: this is pseudo-code, I don't actually know how to make EuiI18n take a date 
	<EuiI18n value={date} /> 
</time>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@myasonik For the time being I'll just replace div with time. Sound good?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's ok if EuiI18n can't handle dates...

Copy link
Contributor

Choose a reason for hiding this comment

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

Since {date} is a passed prop from the consuming app, EUI doesn't need to do any localization on it. It should be on the consumer to do that level. We only localize strings in EUI if they are hard-coded.

src/components/header/header_alert/header_alert.tsx Outdated Show resolved Hide resolved
src/components/header/header_alert/header_alert.tsx Outdated Show resolved Hide resolved
src/components/header/header_alert/header_alert.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@myasonik myasonik left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you for getting those few a11y changes in!

Copy link
Contributor

@ryankeairns ryankeairns left a comment

Choose a reason for hiding this comment

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

Checked out latest changes locally, looks good!

@andreadelrio andreadelrio merged commit 3890763 into elastic:master Nov 15, 2019
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.

[EuiHeaderAlert] Updated to new styles for Kibana news feed
4 participants