From 045e7d9098e9ffedab171497f35b98122c9cc0f2 Mon Sep 17 00:00:00 2001 From: Walter Rafelsberger Date: Tue, 6 Oct 2020 13:53:19 +0200 Subject: [PATCH] [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 --- .../application/components/data_grid/data_grid.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/ml/public/application/components/data_grid/data_grid.tsx b/x-pack/plugins/ml/public/application/components/data_grid/data_grid.tsx index 1949a3c339161..b36ee0fc32556 100644 --- a/x-pack/plugins/ml/public/application/components/data_grid/data_grid.tsx +++ b/x-pack/plugins/ml/public/application/components/data_grid/data_grid.tsx @@ -99,6 +99,14 @@ export const DataGrid: FC = memo( // }; // }; + // If the charts are visible, hide the column actions icon. + const columnsWithChartsActionized = columnsWithCharts.map((d) => { + if (chartsVisible === true) { + d.actions = false; + } + return d; + }); + const popOverContent = useMemo(() => { return analysisType === ANALYSIS_CONFIG_TYPE.REGRESSION || analysisType === ANALYSIS_CONFIG_TYPE.CLASSIFICATION @@ -254,7 +262,7 @@ export const DataGrid: FC = memo(
{ + columns={columnsWithChartsActionized.map((c) => { c.initialWidth = 165; return c; })}