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

[types/toast] add types for EuiToast, EuiGlobalToastList(Item) #1045

Merged
merged 3 commits into from
Jul 25, 2018
Merged

[types/toast] add types for EuiToast, EuiGlobalToastList(Item) #1045

merged 3 commits into from
Jul 25, 2018

Conversation

spalger
Copy link
Contributor

@spalger spalger commented Jul 24, 2018

Adds types for the <EuiToast />, <EuiGlobalToastList />, and <EuiGlobalToastListItem /> components.

@chandlerprall
Copy link
Contributor

jenkins test this

* @see './global_toast_list.js'
*/
export interface Toast extends Omit<EuiToastProps, 'id'> {
id: string | number,
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the reason for allowing number ?

Copy link
Contributor Author

@spalger spalger Jul 24, 2018

Choose a reason for hiding this comment

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

That's the implementation in Kibana, id is an auto-incrementing number, so I figured since it's supported it should be documented/typed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible/easy to toString that value here? id as a string isn't valid as it is applied to the toast's div, and as we typescript out EUI further this will require a code change to EuiGlobalToastList to correctly support the id attribute as a specific case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it's all in one location so it won't be hard to fix in Kibana.

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.

typedefs LGTM

@spalger spalger merged commit 56b6851 into elastic:master Jul 25, 2018
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