Skip to content

Commit 22180a9

Browse files
walterrakibanamachinedarnautov
authored andcommitted
[ML] Hide Data Grid column options when histogram charts are enabled. (#79459)
* [ML] Fix data grid actions. * [ML] fix columnsWithChartsActionized Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Dima Arnautov <dmitrii.arnautov@elastic.co>
1 parent 963b0fd commit 22180a9

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

  • x-pack/plugins/ml/public/application/components/data_grid

x-pack/plugins/ml/public/application/components/data_grid/data_grid.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,14 @@ export const DataGrid: FC<Props> = memo(
9999
// };
100100
// };
101101

102+
// If the charts are visible, hide the column actions icon.
103+
const columnsWithChartsActionized = columnsWithCharts.map((d) => {
104+
if (chartsVisible === true) {
105+
d.actions = false;
106+
}
107+
return d;
108+
});
109+
102110
const popOverContent = useMemo(() => {
103111
return analysisType === ANALYSIS_CONFIG_TYPE.REGRESSION ||
104112
analysisType === ANALYSIS_CONFIG_TYPE.CLASSIFICATION
@@ -254,7 +262,7 @@ export const DataGrid: FC<Props> = memo(
254262
<div className="mlDataGrid">
255263
<EuiDataGrid
256264
aria-label={isWithHeader(props) ? props.title : ''}
257-
columns={columnsWithCharts.map((c) => {
265+
columns={columnsWithChartsActionized.map((c) => {
258266
c.initialWidth = 165;
259267
return c;
260268
})}

0 commit comments

Comments
 (0)