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

Convert EuiToast to TypeScript #2032

Merged
merged 5 commits into from
Jun 13, 2019

Conversation

pugnascotia
Copy link
Contributor

Summary

Convert EuiToast to TypeScript.

Checklist

  • This was checked in mobile
  • This was checked in IE11
  • This was checked in dark mode
  • Any props added have proper autodocs
  • Documentation examples were added
  • A changelog entry exists and is marked appropriately
  • This was checked for breaking changes and labeled appropriately
  • Jest tests were updated or added to match the most common scenarios
  • This was checked against keyboard-only and screenreader scenarios
  • This required updates to Framer X components

@@ -1,14 +1,13 @@
import React from 'react';
import { render, mount } from 'enzyme';
import sinon from 'sinon';
Copy link
Contributor

Choose a reason for hiding this comment

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

💝💖

Copy link
Contributor

@chandlerprall chandlerprall left a comment

Choose a reason for hiding this comment

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

One small change requested, approving to not block merging.

const headerClasses = classNames('euiToastHeader', {
'euiToastHeader--withBody': children,
});

let headerIcon;
let headerIcon: ReactElement<typeof EuiIcon>;
Copy link
Contributor

Choose a reason for hiding this comment

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

ReactElement's signature takes props as the first arg, then the component constructor. This should be ReactElement<PropsOf<EuiIcon>, typeof EuiIcon> (PropsOf from EUI's common.ts). However, the argument defaults are fine and this can be simplified to let headerIcon: ReactElement;

@pugnascotia pugnascotia merged commit 1bede52 into elastic:master Jun 13, 2019
@pugnascotia pugnascotia deleted the convert-toast-to-ts branch June 13, 2019 10:30
@PhilippBaranovskiy
Copy link
Contributor

@pugnascotia, I'm sorry, have you just rename global_toast_list snapshot without updating?
May the following error be a result of this PR?

Capture

I'm not sure when and why I started getting this.

@pugnascotia
Copy link
Contributor Author

Those aren't snapshot errors. Strange though - I couldn't have merged if CI wasn't passing. Are you seeing that on master, or another branch?

@PhilippBaranovskiy
Copy link
Contributor

Those aren't snapshot errors. Strange though - I couldn't have merged if CI wasn't passing. Are you seeing that on master, or another branch?

Hm. Seems that merging master into my branch solved the issue, strange.
I did it just 20 minutes earlier and it hadn't.

Anyway, thanks 🙏

@chandlerprall
Copy link
Contributor

That's a known flaky test in our suite #1999

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants