[EuiDataGrid] Deprecate the closePopover callback passed to cellActions in favor of closeCellPopover ref API#5734
Conversation
…r of using the ref method
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5734/ |
chandlerprall
left a comment
There was a problem hiding this comment.
Code changes look good.
Would you mind building eui.d.ts and testing it in Kibana? Should help identify any uses over there that have been affected.
|
For sure, great call! |
|
|
|
Ah wait, turns out I was running the wrong command(s). proc [tsc] src/plugins/discover/public/components/discover_grid/discover_grid_cell_actions.test.tsx:46:11 - error TS2322: Type '{ Component: (props: any) => Element; rowIndex: number; colIndex: number; columnId: string; isExpanded: false; closePopover: Mock<any, any>; }' is not assignable to type 'IntrinsicAttributes & EuiDataGridColumnCellActionProps'.
proc [tsc] Property 'closePopover' does not exist on type 'IntrinsicAttributes & EuiDataGridColumnCellActionProps'.
proc [tsc]
proc [tsc] 46 closePopover={jest.fn()}
proc [tsc] ~~~~~~~~~~~~
proc [tsc]
proc [tsc] src/plugins/discover/public/components/discover_grid/discover_grid_cell_actions.test.tsx:75:11 - error TS2322: Type '{ Component: (props: any) => Element; rowIndex: number; colIndex: number; columnId: string; isExpanded: false; closePopover: Mock<any, any>; }' is not assignable to type 'IntrinsicAttributes & EuiDataGridColumnCellActionProps'.
proc [tsc] Property 'closePopover' does not exist on type 'IntrinsicAttributes & EuiDataGridColumnCellActionProps'.
proc [tsc]
proc [tsc] 75 closePopover={jest.fn()}
proc [tsc] ~~~~~~~~~~~~
proc [tsc]
proc [tsc] src/plugins/vis_types/table/public/components/table_vis_columns.tsx:58:45 - error TS2339: Property 'closePopover' does not exist on type 'EuiDataGridColumnCellActionProps'.
proc [tsc]
proc [tsc] 58 ({ rowIndex, columnId, Component, closePopover }: EuiDataGridColumnCellActionProps) => {
proc [tsc] ~~~~~~~~~~~~
proc [tsc]
proc [tsc] src/plugins/vis_types/table/public/components/table_vis_columns.tsx:95:45 - error TS2339: Property 'closePopover' does not exist on type 'EuiDataGridColumnCellActionProps'.
proc [tsc]
proc [tsc] 95 ({ rowIndex, columnId, Component, closePopover }: EuiDataGridColumnCellActionProps) => {
proc [tsc] ~~~~~~~~~~~~
proc [tsc]
proc [tsc] x-pack/plugins/lens/public/datatable_visualization/components/columns.tsx:76:47 - error TS2339: Property 'closePopover' does not exist on type 'EuiDataGridColumnCellActionProps'.
proc [tsc]
proc [tsc] 76 ({ rowIndex, columnId, Component, closePopover }: EuiDataGridColumnCellActionProps) => {
proc [tsc] ~~~~~~~~~~~~
proc [tsc]
proc [tsc] x-pack/plugins/lens/public/datatable_visualization/components/columns.tsx:114:47 - error TS2339: Property 'closePopover' does not exist on type 'EuiDataGridColumnCellActionProps'.
proc [tsc]
proc [tsc] 114 ({ rowIndex, columnId, Component, closePopover }: EuiDataGridColumnCellActionProps) => {
proc [tsc] ~~~~~~~~~~~~
proc [tsc] So looks like just 2 plugins with production changes to close the popover. I looked at the them more closely and I'm pretty sure I can see where to make those changes and pass |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5734/ |
Summary
This PR essentially deprecates/reverts #4346 in favor of the
closeCellPopoverref API added in #5590/#5550.The removed 'email' doc example is actually broken in prod - I apparently forgot to pass
closePopoverto the popover cell actions when I was refactoring 🙈 After chatting with @chandlerprall, we decided that instead of fixing it, it was best to reduce confusion for consumers by favoring 1 API over having 2 ways to close cell popovers.Checklist
and playground togglesAdded orupdated jest and cypress tests