-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Upgrade to [email protected] [table typescript types] #52688
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@elastic/kibana-app-arch LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for platform changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ML/transform changes LGTM. Thanks for this update, this should allow us to get rid of our custom types in a follow up!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security changes LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
infra
changes LGTM - thank you!
@@ -169,8 +169,8 @@ export const AnomaliesTable: React.FunctionComponent<{ | |||
); | |||
}; | |||
|
|||
const StyledEuiBasicTable = euiStyled(EuiBasicTable)` | |||
const StyledEuiBasicTable: typeof EuiBasicTable = euiStyled(EuiBasicTable as any)` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not pretty but I couldn't find a better way either 🤷♀️
Pinging @elastic/siem (Team:SIEM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
APM changes look good. 👍
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
Summary
The two biggest changes here are icon snapshot updates (for accessibility, elastic/eui#2554) and typescript definitions for
EuiBasicTable
andEuiInMemoryTable
(elastic/eui#2428).When unifying Kibana's usage of eui tables with the new types, I avoided changes to run-time code, always preferring to mess only with the type definitions, usages, and in some cases avoiding the confusion with a
// @ts-ignore
. The primary differences are:Item
each row representsItem
, and field rendering ensures the specified field exists on the item.Item
. This, combined with TypeScript's lack of usage-based inference, led to a number of additionalas const
.In addition, some apps (SIEM in particular) have defined a
Direction
enum ofASC
&DESC
which caused problems in the sorting callbacks which expect the enum value, but the EUI table only guarantees a string literal of'asc' | 'desc'
- TS enum values are nominally typed, as demonstrated by this typescript playground. I resolved those by updating the onSort callback to allowDirection | 'asc' | 'desc'
.17.1.2
Bug fixes
EuiCodeEditor
custom mode file error by initializing with existing mode (#2616)EuiIcon
default titles (#2632)17.1.1
Bug fixes
EuiTreeView
and added truncation (#2627)17.1.0
key
property inside theoptions
prop inEuiSelectableList
component (#2608)toolbarAdditionalControls
prop toEuiDataGrid
to allow for custom buttons in the toolbar (#2594)EuiBasicTable
,EuiInMemoryTable
, and related components (#2428)logoSecurity
andappSecurityAnalytics
icons (#2613)Bug fixes
EuiDataGrid
when using keyboard shortcuts to paginate (#2602)EuiIcon
accessibility by adding atitle
prop and a defaultaria-label
(#2554)EuiDataGrid
's in-memory sorting of numeric columns when the cell data contains multiple digit groups (#2603)EuiBasicTable
.paginationBar
is hidden when there is no data andEuiPagination
is displayed even when there is only one page (#2598)EuiPopover
was unmounted before calls to setState (#2614)