-
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
[Security Solution] Integrate Vanilla Unified Data Table in Timeline #176064
Changes from 18 commits
78cfc74
7eb5b4d
5dff62f
72cfff5
258ed5d
20921de
dfde043
b1556c7
769d5ce
1a4b9a4
e87c5a9
aed026b
a5c7a81
c2e3719
6fb3bef
9595983
d42cb2e
f3faa32
aa41a23
aaf4ba4
c994a04
2d6e0b8
5a03ece
963363f
05bd286
332bfc2
d67ac0f
a8401a4
92cc95e
288195c
ff4feea
a22d803
c0fbb5f
1dfe8f4
1fe3ea6
4c8fe91
4a61483
fa5d8e0
b2d9ea5
6b81b0b
ab22474
2863544
20edaae
81ab130
df53346
a141c2b
2837017
9074af3
97425cd
6551476
374c0c7
1d05271
87655c5
642109f
077c0c1
c0934bd
557344d
d7af041
248226f
c421fa3
cf159a7
8694f9e
56c1ae6
0bfc88b
770f1f8
d01ba94
a4b1e9c
472c173
112a343
7360c8c
84fe0fb
c312a7b
8e840b2
2df4376
4aa05e9
2467a37
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -8,7 +8,6 @@ | |||||
|
||||||
import React, { useContext, useEffect, useRef, useState } from 'react'; | ||||||
import { EuiButtonIcon, EuiDataGridCellValueElementProps, EuiToolTip } from '@elastic/eui'; | ||||||
import { euiLightVars as themeLight, euiDarkVars as themeDark } from '@kbn/ui-theme'; | ||||||
import { i18n } from '@kbn/i18n'; | ||||||
import { UnifiedDataTableContext } from '../table_context'; | ||||||
import { DataTableRowControl } from './data_table_row_control'; | ||||||
|
@@ -31,9 +30,7 @@ export const ExpandButton = ({ rowIndex, setCellProps }: EuiDataGridCellValueEle | |||||
}); | ||||||
} else if (expanded && current && expanded.id === current.id) { | ||||||
setCellProps({ | ||||||
style: { | ||||||
backgroundColor: isDarkMode ? themeDark.euiColorHighlight : themeLight.euiColorHighlight, | ||||||
}, | ||||||
className: 'dscDocsGrid__cell--expanded', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done: 4a61483 |
||||||
}); | ||||||
} else { | ||||||
setCellProps({ style: undefined }); | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ | |
|
||
import React, { useContext, useEffect } from 'react'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { euiLightVars as themeLight, euiDarkVars as themeDark } from '@kbn/ui-theme'; | ||
import type { DataView, DataViewField } from '@kbn/data-views-plugin/public'; | ||
import { | ||
EuiDataGridCellValueElementProps, | ||
|
@@ -62,32 +61,22 @@ export const getRenderCellValueFn = ({ | |
const ctx = useContext(UnifiedDataTableContext); | ||
|
||
useEffect(() => { | ||
if (!externalCustomRenderers) { | ||
if (row?.isAnchor) { | ||
setCellProps({ | ||
className: 'dscDocsGrid__cell--highlight', | ||
}); | ||
} else if (ctx.expanded && row && ctx.expanded.id === row.id) { | ||
setCellProps({ | ||
style: { | ||
backgroundColor: ctx.isDarkMode | ||
? themeDark.euiColorHighlight | ||
: themeLight.euiColorHighlight, | ||
}, | ||
}); | ||
} else { | ||
setCellProps({ style: undefined }); | ||
} | ||
if (row?.isAnchor) { | ||
setCellProps({ | ||
className: 'dscDocsGrid__cell--highlight', | ||
}); | ||
} else if (ctx.expanded && row && ctx.expanded.id === row.id) { | ||
setCellProps({ | ||
className: 'dscDocsGrid__cell--expanded', | ||
logeekal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}); | ||
} else { | ||
setCellProps({ style: undefined }); | ||
} | ||
}, [ctx, row, setCellProps]); | ||
|
||
if (typeof row === 'undefined') { | ||
return <span className={CELL_CLASS}>-</span>; | ||
} | ||
|
||
if (!!externalCustomRenderers && !!externalCustomRenderers[columnId]) { | ||
return ( | ||
<> | ||
<span className={CELL_CLASS}> | ||
{externalCustomRenderers[columnId]({ | ||
rowIndex, | ||
columnId, | ||
|
@@ -101,10 +90,14 @@ export const getRenderCellValueFn = ({ | |
fieldFormats, | ||
closePopover, | ||
})} | ||
</> | ||
</span> | ||
); | ||
} | ||
|
||
if (typeof row === 'undefined') { | ||
return <span className={CELL_CLASS}>-</span>; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just curious why these lines were moved below since it seems like it works the same as before with the additional There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right. It is a strange change and I am not sure why this was done. I have reverted it and you can check it here |
||
|
||
/** | ||
* when using the fields api this code is used to show top level objects | ||
* this is used for legacy stuff like displaying products of our ecommerce dataset | ||
|
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.
Is this the element ref?
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.
@michaelolo24 , Yes it is provided to call
closeCellActionPopover
but this is not added in this PR. I just made the assertion to be more exact as it was needed here.