From 3f7f583adcd6e82c8a45bcad84a388765eba55c3 Mon Sep 17 00:00:00 2001 From: Robert Jaszczurek Date: Tue, 29 Jul 2025 19:46:51 +0200 Subject: [PATCH 1/4] fix aria-label --- .../shared/ml/public/application/overview/overview_page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/platform/plugins/shared/ml/public/application/overview/overview_page.tsx b/x-pack/platform/plugins/shared/ml/public/application/overview/overview_page.tsx index 1b1727887d854..28d72659fb6ba 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/overview/overview_page.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/overview/overview_page.tsx @@ -202,7 +202,7 @@ export const OverviewPage: FC<{ timefilter: TimefilterContract }> = ({ timefilte />, ]} ariaLabel={i18n.translate('xpack.ml.overview.nodesPanel.ariaLabel', { - defaultMessage: 'overview panel', + defaultMessage: 'Nodes panel', })} > From 218c7a7bdc38b37b378675b76417517a5f4ed1e8 Mon Sep 17 00:00:00 2001 From: Robert Jaszczurek Date: Tue, 29 Jul 2025 20:25:48 +0200 Subject: [PATCH 2/4] Remove old translations --- .../plugins/private/translations/translations/fr-FR.json | 1 - .../plugins/private/translations/translations/ja-JP.json | 1 - .../plugins/private/translations/translations/zh-CN.json | 1 - 3 files changed, 3 deletions(-) diff --git a/x-pack/platform/plugins/private/translations/translations/fr-FR.json b/x-pack/platform/plugins/private/translations/translations/fr-FR.json index 66974512956b3..964fd15024a96 100644 --- a/x-pack/platform/plugins/private/translations/translations/fr-FR.json +++ b/x-pack/platform/plugins/private/translations/translations/fr-FR.json @@ -28435,7 +28435,6 @@ "xpack.ml.overview.anomalyDetection.viewJobsActionName": "Afficher les tâches", "xpack.ml.overview.anomalyDetection.viewResultsActionName": "Afficher dans l’Explorateur d'anomalies", "xpack.ml.overview.dataFrameAnalytics.jobContextMenu.details": "Détails de la tâche", - "xpack.ml.overview.nodesPanel.ariaLabel": "panneau d'aperçu", "xpack.ml.overview.nodesPanel.header": "Nœuds", "xpack.ml.overview.nodesPanel.totalNodesLabel": "Total", "xpack.ml.overview.nodesPanel.viewNodeLink": "Afficher les nœuds", diff --git a/x-pack/platform/plugins/private/translations/translations/ja-JP.json b/x-pack/platform/plugins/private/translations/translations/ja-JP.json index 668b50f708f0f..98b6f4453a04c 100644 --- a/x-pack/platform/plugins/private/translations/translations/ja-JP.json +++ b/x-pack/platform/plugins/private/translations/translations/ja-JP.json @@ -28472,7 +28472,6 @@ "xpack.ml.overview.anomalyDetection.viewJobsActionName": "ジョブを表示", "xpack.ml.overview.anomalyDetection.viewResultsActionName": "異常エクスプローラーで表示", "xpack.ml.overview.dataFrameAnalytics.jobContextMenu.details": "ジョブの詳細", - "xpack.ml.overview.nodesPanel.ariaLabel": "概要パネル", "xpack.ml.overview.nodesPanel.header": "ノード", "xpack.ml.overview.nodesPanel.totalNodesLabel": "合計", "xpack.ml.overview.nodesPanel.viewNodeLink": "ノードの表示", diff --git a/x-pack/platform/plugins/private/translations/translations/zh-CN.json b/x-pack/platform/plugins/private/translations/translations/zh-CN.json index 91c464e4abcc0..289e05564cbdc 100644 --- a/x-pack/platform/plugins/private/translations/translations/zh-CN.json +++ b/x-pack/platform/plugins/private/translations/translations/zh-CN.json @@ -28458,7 +28458,6 @@ "xpack.ml.overview.anomalyDetection.viewJobsActionName": "查看作业", "xpack.ml.overview.anomalyDetection.viewResultsActionName": "在 Anomaly Explorer 中查看", "xpack.ml.overview.dataFrameAnalytics.jobContextMenu.details": "作业详情", - "xpack.ml.overview.nodesPanel.ariaLabel": "概览面板", "xpack.ml.overview.nodesPanel.header": "节点", "xpack.ml.overview.nodesPanel.totalNodesLabel": "合计", "xpack.ml.overview.nodesPanel.viewNodeLink": "查看节点", From 62ea1b858041fe18546ffbb6191e7798322078ab Mon Sep 17 00:00:00 2001 From: Robert Jaszczurek Date: Wed, 30 Jul 2025 09:10:55 +0200 Subject: [PATCH 3/4] Remove unused page --- .../overview/overview_management.tsx | 137 ------------------ 1 file changed, 137 deletions(-) delete mode 100644 x-pack/platform/plugins/shared/ml/public/application/overview/overview_management.tsx diff --git a/x-pack/platform/plugins/shared/ml/public/application/overview/overview_management.tsx b/x-pack/platform/plugins/shared/ml/public/application/overview/overview_management.tsx deleted file mode 100644 index b9eaba6998d8a..0000000000000 --- a/x-pack/platform/plugins/shared/ml/public/application/overview/overview_management.tsx +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { FC } from 'react'; -import React, { useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { EuiLink, EuiSpacer } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { mlTimefilterRefresh$, useTimefilter } from '@kbn/ml-date-picker'; -import { useStorage } from '@kbn/ml-local-storage'; -import { OverviewStatsBar } from '../components/collapsible_panel/collapsible_panel'; -import { ML_PAGES } from '../../../common/constants/locator'; -import type { MlStorageKey, TMlStorageMapped } from '../../../common/types/storage'; -import { ML_OVERVIEW_PANELS } from '../../../common/types/storage'; -import { CollapsiblePanel } from '../components/collapsible_panel'; -import { usePermissionCheck } from '../capabilities/check_capabilities'; -import { mlNodesAvailable } from '../ml_nodes_check'; -import { OverviewContent } from './components/content'; -import { NodeAvailableWarning } from '../components/node_available_warning'; -import { JobsAwaitingNodeWarning } from '../components/jobs_awaiting_node_warning'; -import { SavedObjectsWarning } from '../components/saved_objects_warning'; -import { UpgradeWarning } from '../components/upgrade'; -import { HelpMenu } from '../components/help_menu'; -import { useMlKibana, useMlLink } from '../contexts/kibana'; -import { NodesList } from '../memory_usage/nodes_overview'; -import { MlPageHeader } from '../components/page_header'; -import { PageTitle } from '../components/page_title'; -import { getMlNodesCount } from '../ml_nodes_check/check_ml_nodes'; - -export const overviewPanelDefaultState = Object.freeze({ - nodes: true, - adJobs: true, - dfaJobs: true, -}); - -export const OverviewPage: FC = () => { - const [canViewMlNodes, canCreateJob] = usePermissionCheck(['canViewMlNodes', 'canCreateJob']); - - const disableCreateAnomalyDetectionJob = !canCreateJob || !mlNodesAvailable(); - const { - services: { docLinks }, - } = useMlKibana(); - const helpLink = docLinks.links.ml.guide; - - const viewNodesLink = useMlLink({ - page: ML_PAGES.MEMORY_USAGE, - }); - - const timefilter = useTimefilter({ timeRangeSelector: true, autoRefreshSelector: true }); - - const [adLazyJobCount, setAdLazyJobCount] = useState(0); - const [dfaLazyJobCount, setDfaLazyJobCount] = useState(0); - - const [panelsState, setPanelsState] = useStorage< - MlStorageKey, - TMlStorageMapped - >(ML_OVERVIEW_PANELS, overviewPanelDefaultState); - - return ( -
- - - - - - { - const { from, to } = timefilter.getTime(); - const timeRange = { start: from, end: to }; - mlTimefilterRefresh$.next({ - lastRefresh: Date.now(), - timeRange, - }); - }} - /> - - - {canViewMlNodes ? ( - <> - { - setPanelsState({ ...panelsState, nodes: update }); - }} - header={ - - } - headerItems={[ - , - - {i18n.translate('xpack.ml.overview.nodesPanel.viewNodeLink', { - defaultMessage: 'View nodes', - })} - , - ]} - ariaLabel={i18n.translate('xpack.ml.overview.nodesPanel.ariaLabel', { - defaultMessage: 'overview panel', - })} - > - - - - - ) : null} - - - -
- ); -}; - -// required for dynamic import using React.lazy() -// eslint-disable-next-line import/no-default-export -export default OverviewPage; From f4ba0f7c77ecb30598d06ce2aecd50bd0a7522bb Mon Sep 17 00:00:00 2001 From: Robert Jaszczurek Date: Wed, 30 Jul 2025 10:16:06 +0200 Subject: [PATCH 4/4] Remove unused translations --- .../plugins/private/translations/translations/fr-FR.json | 1 - .../plugins/private/translations/translations/ja-JP.json | 1 - .../plugins/private/translations/translations/zh-CN.json | 1 - 3 files changed, 3 deletions(-) diff --git a/x-pack/platform/plugins/private/translations/translations/fr-FR.json b/x-pack/platform/plugins/private/translations/translations/fr-FR.json index 964fd15024a96..0a46a74ad078b 100644 --- a/x-pack/platform/plugins/private/translations/translations/fr-FR.json +++ b/x-pack/platform/plugins/private/translations/translations/fr-FR.json @@ -28437,7 +28437,6 @@ "xpack.ml.overview.dataFrameAnalytics.jobContextMenu.details": "Détails de la tâche", "xpack.ml.overview.nodesPanel.header": "Nœuds", "xpack.ml.overview.nodesPanel.totalNodesLabel": "Total", - "xpack.ml.overview.nodesPanel.viewNodeLink": "Afficher les nœuds", "xpack.ml.overview.overviewLabel": "Aperçu", "xpack.ml.overview.statsBar.failedAnalyticsLabel": "Échoué", "xpack.ml.overview.statsBar.runningAnalyticsLabel": "En cours d'exécution", diff --git a/x-pack/platform/plugins/private/translations/translations/ja-JP.json b/x-pack/platform/plugins/private/translations/translations/ja-JP.json index 98b6f4453a04c..1aa63d9e1ddbc 100644 --- a/x-pack/platform/plugins/private/translations/translations/ja-JP.json +++ b/x-pack/platform/plugins/private/translations/translations/ja-JP.json @@ -28474,7 +28474,6 @@ "xpack.ml.overview.dataFrameAnalytics.jobContextMenu.details": "ジョブの詳細", "xpack.ml.overview.nodesPanel.header": "ノード", "xpack.ml.overview.nodesPanel.totalNodesLabel": "合計", - "xpack.ml.overview.nodesPanel.viewNodeLink": "ノードの表示", "xpack.ml.overview.overviewLabel": "概要", "xpack.ml.overview.statsBar.failedAnalyticsLabel": "失敗", "xpack.ml.overview.statsBar.runningAnalyticsLabel": "実行中", diff --git a/x-pack/platform/plugins/private/translations/translations/zh-CN.json b/x-pack/platform/plugins/private/translations/translations/zh-CN.json index 289e05564cbdc..0b6ba84004c4a 100644 --- a/x-pack/platform/plugins/private/translations/translations/zh-CN.json +++ b/x-pack/platform/plugins/private/translations/translations/zh-CN.json @@ -28460,7 +28460,6 @@ "xpack.ml.overview.dataFrameAnalytics.jobContextMenu.details": "作业详情", "xpack.ml.overview.nodesPanel.header": "节点", "xpack.ml.overview.nodesPanel.totalNodesLabel": "合计", - "xpack.ml.overview.nodesPanel.viewNodeLink": "查看节点", "xpack.ml.overview.overviewLabel": "概览", "xpack.ml.overview.statsBar.failedAnalyticsLabel": "失败", "xpack.ml.overview.statsBar.runningAnalyticsLabel": "正在运行",