From 68a7d5e6b33f0f395238a1c2ca7c7a437b0ccf23 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 31 Oct 2024 06:22:44 +1100 Subject: [PATCH 1/2] [8.x] [ML] Data Frame Analytics: removing scss overrides for exploration pages (#197724) (#198157) # Backport This will backport the following commits from `main` to `8.x`: - [[ML] Data Frame Analytics: removing scss overrides for exploration pages (#197724)](https://github.com/elastic/kibana/pull/197724) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Melissa Alvarez --- .../data_frame_analytics/_index.scss | 4 +- .../_classification_exploration.scss | 47 --- .../classification_exploration.tsx | 26 +- .../evaluate_panel.tsx | 382 ++++++++++-------- .../evaluate_stat.tsx | 43 +- .../data_view_prompt/data_view_prompt.tsx | 58 +-- .../expandable_section.scss | 13 - .../expandable_section/expandable_section.tsx | 116 +++--- .../expandable_section_results.tsx | 10 +- .../expandable_section_splom.tsx | 10 +- .../regression_exploration/_index.scss | 1 - .../_regression_exploration.scss | 3 - .../regression_exploration/evaluate_stat.tsx | 43 +- .../expanded_row_details_pane.scss | 8 - .../expanded_row_details_pane.tsx | 25 +- .../create_analytics_button/_index.scss | 4 - .../timeseries_chart/timeseries_chart.js | 2 - 17 files changed, 381 insertions(+), 414 deletions(-) delete mode 100644 x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/_classification_exploration.scss delete mode 100644 x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section.scss delete mode 100644 x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/_index.scss delete mode 100644 x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/_regression_exploration.scss delete mode 100644 x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/expanded_row_details_pane.scss delete mode 100644 x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_button/_index.scss diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/_index.scss b/x-pack/plugins/ml/public/application/data_frame_analytics/_index.scss index a043a691c9ef6..9b97275417d50 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/_index.scss +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/_index.scss @@ -1,5 +1,3 @@ -@import 'pages/analytics_exploration/components/regression_exploration/index'; @import 'pages/job_map/components/index'; @import 'pages/analytics_management/components/analytics_list/index'; -@import 'pages/analytics_management/components/create_analytics_button/index'; -@import 'pages/analytics_creation/components/index'; +@import 'pages/analytics_creation/components/index'; \ No newline at end of file diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/_classification_exploration.scss b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/_classification_exploration.scss deleted file mode 100644 index c429daaf3c8dc..0000000000000 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/_classification_exploration.scss +++ /dev/null @@ -1,47 +0,0 @@ -/* Fixed width so we can align it with the padding of the AUC ROC chart. */ -$labelColumnWidth: 80px; - -/* - Workaround for EuiDataGrid within a Flex Layout, - this tricks browsers treating the width as a px value instead of % -*/ -.mlDataFrameAnalyticsClassification { - width: 100%; -} - -.mlDataFrameAnalyticsClassification__evaluateSectionContent { - padding: 0 5%; -} - -/* - The following two classes are a workaround to avoid having EuiDataGrid in a flex layout - and just uses a legacy approach for a two column layout so we don't break IE11. -*/ -.mlDataFrameAnalyticsClassification__evaluateSectionContent:after { - content: ''; - display: table; - clear: both; -} - -.mlDataFrameAnalyticsClassification__actualLabel { - float: left; - width: $labelColumnWidth; - padding-top: $euiSize * 4; -} - -/* - Gives EuiDataGrid a min-width of 480px, otherwise the columns options will disappear if you hide all columns. -*/ -.mlDataFrameAnalyticsClassification__dataGridMinWidth { - float: left; - min-width: 480px; - width: calc(100% - #{$labelColumnWidth}); - - .euiDataGridRowCell--boolean { - text-transform: none; - } -} - -.mlDataFrameAnalyticsClassification__evaluationMetrics { - width: 60%; -} diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/classification_exploration.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/classification_exploration.tsx index 8a198666a9732..fac1c8e76a759 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/classification_exploration.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/classification_exploration.tsx @@ -19,18 +19,16 @@ interface Props { } export const ClassificationExploration: FC = ({ jobId }) => ( -
- -
+ ); diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/evaluate_panel.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/evaluate_panel.tsx index 0298a70ba4afa..0d30b0371a027 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/evaluate_panel.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/evaluate_panel.tsx @@ -5,8 +5,6 @@ * 2.0. */ -import './_classification_exploration.scss'; - import type { FC } from 'react'; import React, { useEffect, useState } from 'react'; @@ -291,190 +289,218 @@ export const EvaluatePanel: FC = ({ jobConfig, jobStatus, se } contentPadding={true} content={ - <> - {!isLoadingConfusionMatrix ? ( - <> - {errorConfusionMatrix !== null && } - {errorConfusionMatrix === null && ( + + + {/* Confusion matrix title and table */} + + {!isLoadingConfusionMatrix ? ( <> - - - {getHelpText(dataSubsetTitle)} - - - - - - {/* BEGIN TABLE ELEMENTS */} - -
-
- - - -
-
- {columns.length > 0 && columnsData.length > 0 && ( - <> -
+ {errorConfusionMatrix !== null && } + {errorConfusionMatrix === null && ( + <> + {/* confusion matrix title */} + + + + + {getHelpText(dataSubsetTitle)} + + + + + + + + {/* confusion matrix table */} + + + -
- - - - )} -
-
- {/* END TABLE ELEMENTS */} - - )} - - ) : null} - {/* Accuracy and Recall */} - - - {evaluationQualityMetricsHelpText} - - - - - - - - - - - - - - - - - - {/* AUC ROC Chart */} - - - - - - - - - - - - {Array.isArray(errorRocCurve) && ( - - {errorRocCurve.map((e) => ( - <> - {e} -
+
+ + + {columns.length > 0 && columnsData.length > 0 ? ( + <> + + + + + + + + + + ) : null} + + +
+ - ))} + )} - } - /> - )} - {!isLoadingRocCurve && errorRocCurve === null && rocCurveData.length > 0 && ( -
- + + + {/* evaluation quality metrics */} + + + {/* evaluation title */} + + {evaluationQualityMetricsHelpText} + + + + {/* evaluation stats */} + + + + + + + + + + + + + + + + + {/* AUC ROC Chart */} + + + + + + + + + + + + + + + {Array.isArray(errorRocCurve) && ( + + {errorRocCurve.map((e) => ( + <> + {e} +
+ + ))} + + } + /> + )} + {!isLoadingRocCurve && errorRocCurve === null && rocCurveData.length > 0 && ( +
+ +
)} - /> -
- )} - {isLoadingRocCurve && } - + {isLoadingRocCurve && } + + + + } /> diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/evaluate_stat.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/evaluate_stat.tsx index c4ebd2da2ead9..279744e479b80 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/evaluate_stat.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/evaluate_stat.tsx @@ -7,7 +7,7 @@ import type { FC } from 'react'; import React from 'react'; -import { EuiStat, EuiIconTip, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { EuiStat, EuiIconTip, EuiFlexGroup, EuiFlexItem, useEuiTheme } from '@elastic/eui'; import { EMPTY_STAT } from '../../../../common/analytics'; interface Props { @@ -24,22 +24,25 @@ export const EvaluateStat: FC = ({ description, dataTestSubj, tooltipContent, -}) => ( - - - - - - - - -); +}) => { + const { + euiTheme: { size }, + } = useEuiTheme(); + + return ( + + + + + + + + + ); +}; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/data_view_prompt/data_view_prompt.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/data_view_prompt/data_view_prompt.tsx index 9f3cfaffc53fb..6de4a59521313 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/data_view_prompt/data_view_prompt.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/data_view_prompt/data_view_prompt.tsx @@ -8,7 +8,7 @@ import type { FC } from 'react'; import React, { useMemo } from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; -import { EuiLink, EuiText } from '@elastic/eui'; +import { EuiLink, EuiText, useEuiTheme } from '@elastic/eui'; import { useMlKibana } from '../../../../../contexts/kibana'; interface Props { @@ -24,6 +24,10 @@ export const DataViewPrompt: FC = ({ destIndex, color }) => { }, } = useMlKibana(); + const { + euiTheme: { size }, + } = useEuiTheme(); + const canCreateDataView = useMemo( () => capabilities.savedObjectsManagement.edit === true || capabilities.indexPatterns.save === true, @@ -31,36 +35,34 @@ export const DataViewPrompt: FC = ({ destIndex, color }) => { ); return ( - <> - + + + {canCreateDataView === true ? ( + + + ), }} /> - {canCreateDataView === true ? ( - - - - ), - }} - /> - ) : null} - - + ) : null} + ); }; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section.scss b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section.scss deleted file mode 100644 index 59fd59d69c4a5..0000000000000 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section.scss +++ /dev/null @@ -1,13 +0,0 @@ -.mlExpandableSection { - padding: $euiSizeS $euiSize; -} - -.mlExpandableSection-contentPadding { - padding: $euiSizeS; -} - -// Make sure the charts tooltip in popover -// have higher zIndex than Eui popover cells -[id^='echTooltipPortal'] { - z-index: $euiZLevel9 !important; -} \ No newline at end of file diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section.tsx index 68de97b30b575..9ba13f16926fe 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section.tsx @@ -5,8 +5,6 @@ * 2.0. */ -import './expandable_section.scss'; - import type { FC, ReactNode } from 'react'; import React, { useCallback, useMemo } from 'react'; @@ -18,6 +16,7 @@ import { EuiSkeletonText, EuiPanel, EuiText, + useEuiTheme, } from '@elastic/eui'; import { getDefaultExplorationPageUrlState, @@ -59,6 +58,10 @@ export const ExpandableSection: FC = ({ docsLink, urlStateKey, }) => { + const { + euiTheme: { size }, + } = useEuiTheme(); + const overrides = useMemo( () => (isExpandedDefault !== undefined ? { [urlStateKey]: isExpandedDefault } : undefined), [urlStateKey, isExpandedDefault] @@ -77,68 +80,65 @@ export const ExpandableSection: FC = ({ return ( -
- - - - - - -

{title}

-
-
-
- {headerItems === HEADER_ITEMS_LOADING && } - {isHeaderItems(headerItems) - ? headerItems.map(({ label, value, id }) => ( - - {label !== undefined && value !== undefined ? ( - - - -

{label}

-
-
- - {value} - -
- ) : null} - {label === undefined ? ( - - - - {value} - - - - ) : null} -
- )) - : null} -
-
- {docsLink !== undefined && {docsLink}} -
-
+ + + + + + +

{title}

+
+
+
+ {headerItems === HEADER_ITEMS_LOADING && } + {isHeaderItems(headerItems) + ? headerItems.map(({ label, value, id }) => ( + + {label !== undefined && value !== undefined ? ( + + + +

{label}

+
+
+ + {value} + +
+ ) : null} + {label === undefined ? ( + + + + {value} + + + + ) : null} +
+ )) + : null} +
+
+ {docsLink !== undefined && {docsLink}} +
{isExpanded && (
{content} diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_results.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_results.tsx index cc296a42afbae..d8c20f7f3d6fc 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_results.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_results.tsx @@ -23,6 +23,7 @@ import { EuiSpacer, EuiText, EuiToolTip, + useEuiTheme, } from '@elastic/eui'; import type { DataView } from '@kbn/data-views-plugin/public'; @@ -142,6 +143,9 @@ export const ExpandableSectionResults: FC = ({ notifications: { toasts }, }, } = useMlKibana(); + const { + euiTheme: { size }, + } = useEuiTheme(); const dataViewId = dataView?.id; @@ -371,14 +375,12 @@ export const ExpandableSectionResults: FC = ({ const resultsSectionContent = ( <> {jobConfig !== undefined && needsDestDataView && ( -
- -
+ )} {jobConfig !== undefined && (isRegressionAnalysis(jobConfig.analysis) || isClassificationAnalysis(jobConfig.analysis)) && ( - + {tableItems.length === SEARCH_SIZE ? showingFirstDocs : showingDocs} )} diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_splom.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_splom.tsx index 22b31abb17661..8ada4cab23410 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_splom.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_splom.tsx @@ -5,14 +5,12 @@ * 2.0. */ -import './expandable_section.scss'; - import type { FC } from 'react'; import React from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; -import { EuiHorizontalRule, EuiSpacer } from '@elastic/eui'; +import { EuiHorizontalRule, EuiSpacer, useEuiTheme } from '@elastic/eui'; import type { ScatterplotMatrixProps } from '../../../../../components/scatterplot_matrix'; import { ScatterplotMatrix } from '../../../../../components/scatterplot_matrix'; @@ -20,11 +18,15 @@ import { ScatterplotMatrix } from '../../../../../components/scatterplot_matrix' import { ExpandableSection } from './expandable_section'; export const ExpandableSectionSplom: FC = (props) => { + const { + euiTheme: { size }, + } = useEuiTheme(); + const splomSectionHeaderItems = undefined; const splomSectionContent = ( <> -
+
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/_index.scss b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/_index.scss deleted file mode 100644 index bb948785d3efa..0000000000000 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/_index.scss +++ /dev/null @@ -1 +0,0 @@ -@import 'regression_exploration'; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/_regression_exploration.scss b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/_regression_exploration.scss deleted file mode 100644 index edcc9870ff93b..0000000000000 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/_regression_exploration.scss +++ /dev/null @@ -1,3 +0,0 @@ -.mlDataFrameAnalyticsRegression__evaluateStat { - padding-top: $euiSizeL; -} diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_stat.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_stat.tsx index 89582c51b68f0..f56e1b1dc53f7 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_stat.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_stat.tsx @@ -9,7 +9,7 @@ import type { FC } from 'react'; import React from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { EuiStat, EuiIconTip, EuiFlexGroup, EuiFlexItem, EuiLink } from '@elastic/eui'; +import { EuiStat, EuiIconTip, EuiFlexGroup, EuiFlexItem, EuiLink, useEuiTheme } from '@elastic/eui'; import { REGRESSION_STATS } from '../../../../common/analytics'; interface Props { @@ -83,24 +83,25 @@ const tooltipContent = { ), }; -export const EvaluateStat: FC = ({ isLoading, statType, title, dataTestSubj }) => ( - - - - - - {statType !== REGRESSION_STATS.HUBER && ( - = ({ isLoading, statType, title, dataTestSubj }) => { + const { + euiTheme: { size }, + } = useEuiTheme(); + + return ( + + + - )} - - -); + + + {statType !== REGRESSION_STATS.HUBER && } + + + ); +}; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/expanded_row_details_pane.scss b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/expanded_row_details_pane.scss deleted file mode 100644 index 5343760b1fe9f..0000000000000 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/expanded_row_details_pane.scss +++ /dev/null @@ -1,8 +0,0 @@ -.mlExpandedRowDetails { - padding: $euiSizeS $euiSize $euiSize; -} - -/* Hide the basic table's header */ -.mlExpandedRowDetailsSection thead { - display: none; -} \ No newline at end of file diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/expanded_row_details_pane.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/expanded_row_details_pane.tsx index 32394ec3d1dd4..2c9a79fbc1c0d 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/expanded_row_details_pane.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/expanded_row_details_pane.tsx @@ -5,10 +5,9 @@ * 2.0. */ -import './expanded_row_details_pane.scss'; - import type { FC, ReactElement } from 'react'; import React from 'react'; +import { i18n } from '@kbn/i18n'; import { EuiBasicTable, @@ -21,6 +20,7 @@ import { EuiText, EuiTitle, EuiSpacer, + useEuiTheme, } from '@elastic/eui'; export interface SectionItem { @@ -106,11 +106,21 @@ export const Section: FC = ({ section }) => { const columns = [ { field: 'title', - name: '', + name: i18n.translate( + 'xpack.ml.dataframe.analytics.expandedRowDetails.analysisStatsHeaderField', + { + defaultMessage: 'Field', + } + ), }, { field: 'description', - name: '', + name: i18n.translate( + 'xpack.ml.dataframe.analytics.expandedRowDetails.analysisStatsHeaderValue', + { + defaultMessage: 'Value', + } + ), render: (v: SectionItem['description']) => <>{v}, }, ]; @@ -126,7 +136,6 @@ export const Section: FC = ({ section }) => { columns={columns} tableCaption={section.title} tableLayout="auto" - className="mlExpandedRowDetailsSection" data-test-subj={`${section.dataTestSubj}-table`} />
@@ -150,12 +159,16 @@ export const ExpandedRowDetailsPane: FC = ({ progress, dataTestSubj, }) => { + const { + euiTheme: { size }, + } = useEuiTheme(); + return ( <> diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_button/_index.scss b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_button/_index.scss deleted file mode 100644 index 14ff9de7ded4d..0000000000000 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_button/_index.scss +++ /dev/null @@ -1,4 +0,0 @@ -.dataFrameAnalyticsCreateSearchDialog { - width: $euiSizeL * 30; - min-height: $euiSizeL * 25; -} diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js index d78ed1ed6e7fc..f39bab106c643 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js @@ -1370,8 +1370,6 @@ class TimeseriesChartIntl extends Component { .attr('y', -2) .attr('height', contextChartLineTopMargin); - // Draw the brush handles using SVG foreignObject elements. - // Note these are not supported on IE11 and below, so will not appear in IE. const leftHandle = contextGroup .append('foreignObject') .attr('width', 10) From 5a4a17f67c4c0c84ee313c0a20731ae9e583b84e Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 31 Oct 2024 06:47:33 +1100 Subject: [PATCH 2/2] [8.x] [Mappings editor] Handle unsupported types (#198185) (#198421) # Backport This will backport the following commits from `main` to `8.x`: - [[Mappings editor] Handle unsupported types (#198185)](https://github.com/elastic/kibana/pull/198185) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Elena Stoeva <59341489+ElenaStoeva@users.noreply.github.com> --- .../application/components/mappings_editor/lib/utils.ts | 6 ++---- .../components/mappings_editor/use_state_listener.tsx | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/lib/utils.ts b/x-pack/plugins/index_management/public/application/components/mappings_editor/lib/utils.ts index 728ba79eedd81..71231c89b673c 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/lib/utils.ts +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/lib/utils.ts @@ -623,7 +623,7 @@ export const getFieldsMatchingFilterFromState = ( } => { return Object.fromEntries( Object.entries(state.fields.byId).filter(([_, fieldId]) => - filteredDataTypes.includes(TYPE_DEFINITION[state.fields.byId[fieldId.id].source.type].label) + filteredDataTypes.includes(getTypeLabelFromField(state.fields.byId[fieldId.id].source)) ) ); }; @@ -646,9 +646,7 @@ export const getFieldsFromState = ( const getField = (fieldId: string) => { if (filteredDataTypes) { if ( - filteredDataTypes.includes( - TYPE_DEFINITION[normalizedFields.byId[fieldId].source.type].label - ) + filteredDataTypes.includes(getTypeLabelFromField(normalizedFields.byId[fieldId].source)) ) { return normalizedFields.byId[fieldId]; } diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/use_state_listener.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/use_state_listener.tsx index 5c5e1c6a289fa..26610773ddbf4 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/use_state_listener.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/use_state_listener.tsx @@ -26,9 +26,9 @@ import { deNormalizeRuntimeFields, getAllFieldTypesFromState, getFieldsFromState, + getTypeLabelFromField, } from './lib'; import { useMappingsState, useDispatch } from './mappings_state_context'; -import { TYPE_DEFINITION } from './constants'; interface Args { onChange?: OnUpdateHandler; @@ -56,7 +56,7 @@ export const useMappingsStateListener = ({ onChange, value, status }: Args) => { const allFieldsTypes = getAllFieldTypesFromState(deNormalize(normalize(mappedFields))); return allFieldsTypes.map((dataType) => ({ checked: undefined, - label: TYPE_DEFINITION[dataType].label, + label: getTypeLabelFromField({ type: dataType }), 'data-test-subj': `indexDetailsMappingsSelectFilter-${dataType}`, })); }, [mappedFields]);