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

Update combobox option's value TS definition #2080

Conversation

chandlerprall
Copy link
Contributor

@chandlerprall chandlerprall commented Jun 28, 2019

Summary

Fixes #2078 by updating the typescript definition for EuiComboBox's options' value.

I tested these changes in a new project to verify the generic was understood properly -
understood generic

I also dropped the resulting eui.d.ts file into Kibana and ran the typecheck script, there are two instances in x-pack/legacy/plugins/siem/public/components/edit_data_provider/index.tsx where EuiComboBox is used through styled-components which interprets the generic as {} which is invalid. Both cases are solved by moving the css style onto EuiComboBox as a prop.

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

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

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

LGTM. Confirmed the same result/required action in Kibana.

@chandlerprall chandlerprall requested a review from thompsongl July 1, 2019 16:42
@chandlerprall
Copy link
Contributor Author

@thompsongl I switched the generic to have a default value, un-doing the breaking aspect of this change.

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

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

Looks like just 2 updates required in Kibana after these changes, both of which are related to styled-components and not real TS errors.

@chandlerprall chandlerprall merged commit 2e7ad84 into elastic:master Jul 1, 2019
@chandlerprall chandlerprall deleted the bug/2078-combobox-option-value-type branch July 1, 2019 17:14
@snide snide mentioned this pull request Jul 12, 2019
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.

Typescript: Types for combo box option value
3 participants