Skip to content

Commit

Permalink
[ML] Hide Data Grid column options when histogram charts are enabled. (
Browse files Browse the repository at this point in the history
…#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>
  • Loading branch information
3 people authored Oct 6, 2020
1 parent 4ed1cb3 commit 045e7d9
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ export const DataGrid: FC<Props> = 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
Expand Down Expand Up @@ -254,7 +262,7 @@ export const DataGrid: FC<Props> = memo(
<div className="mlDataGrid">
<EuiDataGrid
aria-label={isWithHeader(props) ? props.title : ''}
columns={columnsWithCharts.map((c) => {
columns={columnsWithChartsActionized.map((c) => {
c.initialWidth = 165;
return c;
})}
Expand Down

0 comments on commit 045e7d9

Please sign in to comment.