From 34f378e2f565e66c96e2d16b9341324706ac8e5e Mon Sep 17 00:00:00 2001 From: Panagiota Mitsopoulou Date: Fri, 13 Sep 2024 10:41:28 +0300 Subject: [PATCH 01/19] change nav hierarchy for stateful cloud to use panelOpener --- .../src/project_navigation/utils.ts | 5 - .../components/navigation_item_open_panel.tsx | 9 +- .../observability/public/navigation_tree.ts | 399 ++++++++---------- 3 files changed, 188 insertions(+), 225 deletions(-) diff --git a/packages/core/chrome/core-chrome-browser-internal/src/project_navigation/utils.ts b/packages/core/chrome/core-chrome-browser-internal/src/project_navigation/utils.ts index 06e5156dfac6e..9a45290c95389 100644 --- a/packages/core/chrome/core-chrome-browser-internal/src/project_navigation/utils.ts +++ b/packages/core/chrome/core-chrome-browser-internal/src/project_navigation/utils.ts @@ -274,11 +274,6 @@ function validateNodeProps< `[Chrome navigation] Error in node [${id}]. Only one of "href" or "cloudLink" can be provided.` ); } - if (renderAs === 'panelOpener' && !link) { - throw new Error( - `[Chrome navigation] Error in node [${id}]. If renderAs is set to "panelOpener", a "link" must also be provided.` - ); - } if (renderAs === 'item' && !link && !onClick) { throw new Error( `[Chrome navigation] Error in node [${id}]. If renderAs is set to "item", a "link" or "onClick" must also be provided.` diff --git a/packages/shared-ux/chrome/navigation/src/ui/components/navigation_item_open_panel.tsx b/packages/shared-ux/chrome/navigation/src/ui/components/navigation_item_open_panel.tsx index 9d354ec27bc31..8beb9a809264c 100644 --- a/packages/shared-ux/chrome/navigation/src/ui/components/navigation_item_open_panel.tsx +++ b/packages/shared-ux/chrome/navigation/src/ui/components/navigation_item_open_panel.tsx @@ -81,13 +81,18 @@ export const NavigationItemOpenPanel: FC = ({ item, navigateToUrl, active const onLinkClick = useCallback( (e: React.MouseEvent) => { if (!href) { + if (selectedNode?.id === item.id) { + closePanel(); + } else { + openPanel(item); + } return; } e.preventDefault(); navigateToUrl(href); closePanel(); }, - [closePanel, href, navigateToUrl] + [closePanel, href, item, navigateToUrl, openPanel, selectedNode] ); const onIconClick = useCallback(() => { @@ -123,7 +128,7 @@ export const NavigationItemOpenPanel: FC = ({ item, navigateToUrl, active size="s" color="text" onClick={onIconClick} - iconType="spaces" + iconType="arrowRight" iconSize="m" aria-label={i18n.translate('sharedUXPackages.chrome.sideNavigation.togglePanel', { defaultMessage: 'Toggle "{title}" panel navigation', diff --git a/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts b/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts index 9a064af35d3e8..3da27ca241e62 100644 --- a/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts +++ b/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts @@ -66,97 +66,36 @@ const navTree: NavigationTreeDefinition = { link: 'slo', }, { - id: 'aiMl', - title: i18n.translate('xpack.observability.obltNav.ml.aiAndMlGroupTitle', { - defaultMessage: 'AI & ML', + link: 'observabilityAIAssistant', + title: i18n.translate('xpack.observability.obltNav.aiMl.aiAssistant', { + defaultMessage: 'AI Assistant', }), - renderAs: 'accordion', - children: [ - { - link: 'observabilityAIAssistant', - title: i18n.translate('xpack.observability.obltNav.aiMl.aiAssistant', { - defaultMessage: 'AI Assistant', - }), - }, - { - link: 'ml:anomalyDetection', - renderAs: 'item', - children: [ - { - link: 'ml:singleMetricViewer', - }, - { - link: 'ml:anomalyExplorer', - }, - { - link: 'ml:settings', - }, - ], - }, - { - title: i18n.translate('xpack.observability.obltNav.ml.logRateAnalysis', { - defaultMessage: 'Log rate analysis', - }), - link: 'ml:logRateAnalysis', - getIsActive: ({ pathNameSerialized, prepend }) => { - return pathNameSerialized.includes(prepend('/app/ml/aiops/log_rate_analysis')); - }, - }, - { - link: 'logs:anomalies', - }, - { - link: 'logs:log-categories', - }, - { - title: i18n.translate('xpack.observability.obltNav.ml.changePointDetection', { - defaultMessage: 'Change point detection', - }), - link: 'ml:changePointDetections', - getIsActive: ({ pathNameSerialized, prepend }) => { - return pathNameSerialized.includes(prepend('/app/ml/aiops/change_point_detection')); - }, - }, - { - title: i18n.translate('xpack.observability.obltNav.ml.job.notifications', { - defaultMessage: 'Job notifications', - }), - link: 'ml:notifications', - }, - ], }, { id: 'apm', title: i18n.translate('xpack.observability.obltNav.applications', { defaultMessage: 'Applications', }), - renderAs: 'accordion', + renderAs: 'panelOpener', children: [ { - link: 'apm:services', - getIsActive: ({ pathNameSerialized }) => { - const regex = /app\/apm\/.*service.*/; - return regex.test(pathNameSerialized); - }, - }, - { - link: 'apm:traces', - getIsActive: ({ pathNameSerialized, prepend }) => { - return pathNameSerialized.startsWith(prepend('/app/apm/traces')); - }, - }, - { - link: 'apm:dependencies', - getIsActive: ({ pathNameSerialized, prepend }) => { - return pathNameSerialized.startsWith(prepend('/app/apm/dependencies')); - }, + children: [ + { link: 'apm:services' }, + { link: 'apm:traces' }, + { link: 'apm:dependencies' }, + { + link: 'ux', + title: i18n.translate('xpack.observability.obltNav.apm.ux', { + defaultMessage: 'User experience', + }), + }, + ], }, { id: 'synthetics', title: i18n.translate('xpack.observability.obltNav.apm.syntheticsGroupTitle', { defaultMessage: 'Synthetics', }), - renderAs: 'accordion', children: [ { link: 'synthetics', @@ -164,10 +103,17 @@ const navTree: NavigationTreeDefinition = { defaultMessage: 'Monitors', }), }, - { link: 'synthetics:certificates' }, + { + link: 'synthetics:certificates', + title: i18n.translate( + 'xpack.observability.obltNav.apm.synthetics.tlsCertificates', + { + defaultMessage: 'TLS certificates', + } + ), + }, ], }, - { link: 'ux' }, ], }, { @@ -175,32 +121,31 @@ const navTree: NavigationTreeDefinition = { title: i18n.translate('xpack.observability.obltNav.infrastructure', { defaultMessage: 'Infrastructure', }), - renderAs: 'accordion', + renderAs: 'panelOpener', children: [ { - link: 'metrics:inventory', - getIsActive: ({ pathNameSerialized, prepend }) => { - return pathNameSerialized.startsWith(prepend('/app/metrics/inventory')); - }, - }, - { - link: 'metrics:hosts', - getIsActive: ({ pathNameSerialized, prepend }) => { - return pathNameSerialized.startsWith(prepend('/app/metrics/hosts')); - }, - }, - { - link: 'metrics:metrics-explorer', + children: [ + { link: 'metrics:inventory' }, + { link: 'metrics:hosts' }, + { + link: 'metrics:metrics-explorer', + title: i18n.translate( + 'xpack.observability.obltNav.infrastructure.metricsExplorer', + { + defaultMessage: 'Metrics explorer', + } + ), + }, + ], }, { id: 'profiling', title: i18n.translate( 'xpack.observability.obltNav.infrastructure.universalProfiling', { - defaultMessage: 'Universal Profiling', + defaultMessage: 'Universal profiling', } ), - renderAs: 'accordion', children: [ { link: 'profiling:stacktraces', @@ -215,134 +160,10 @@ const navTree: NavigationTreeDefinition = { }, ], }, - { - id: 'otherTools', - title: i18n.translate('xpack.observability.obltNav.otherTools', { - defaultMessage: 'Other tools', - }), - renderAs: 'accordion', - children: [ - { - link: 'logs:stream', - title: i18n.translate('xpack.observability.obltNav.otherTools.logsStream', { - defaultMessage: 'Logs stream', - }), - }, - { link: 'maps' }, - { link: 'canvas' }, - { link: 'graph' }, - ], - }, - ], - }, - ], - footer: [ - { type: 'recentlyAccessed' }, - { - type: 'navItem', - title: i18n.translate('xpack.observability.obltNav.getStarted', { - defaultMessage: 'Get started', - }), - link: 'observabilityOnboarding', - icon: 'launch', - }, - { - type: 'navItem', - id: 'devTools', - title: i18n.translate('xpack.observability.obltNav.devTools', { - defaultMessage: 'Developer tools', - }), - link: 'dev_tools', - icon: 'editorCodeBlock', - }, - { - type: 'navGroup', - id: 'project_settings_project_nav', - title: i18n.translate('xpack.observability.obltNav.management', { - defaultMessage: 'Management', - }), - icon: 'gear', - breadcrumbStatus: 'hidden', - children: [ - { - link: 'management', - title: i18n.translate('xpack.observability.obltNav.stackManagement', { - defaultMessage: 'Stack Management', - }), - renderAs: 'panelOpener', - spaceBefore: null, - children: [ - { - title: 'Ingest', - children: [{ link: 'management:ingest_pipelines' }, { link: 'management:pipelines' }], - }, - { - title: 'Data', - children: [ - { link: 'management:index_management' }, - { link: 'management:index_lifecycle_management' }, - { link: 'management:snapshot_restore' }, - { link: 'management:rollup_jobs' }, - { link: 'management:transform' }, - { link: 'management:cross_cluster_replication' }, - { link: 'management:remote_clusters' }, - { link: 'management:migrate_data' }, - ], - }, - { - title: 'Alerts and Insights', - children: [ - { link: 'management:triggersActions' }, - { link: 'management:cases' }, - { link: 'management:triggersActionsConnectors' }, - { link: 'management:reporting' }, - { link: 'management:jobsListLink' }, - { link: 'management:watcher' }, - { link: 'management:maintenanceWindows' }, - ], - }, - { - title: 'Security', - children: [ - { link: 'management:users' }, - { link: 'management:roles' }, - { link: 'management:api_keys' }, - { link: 'management:role_mappings' }, - ], - }, - { - title: 'Kibana', - children: [ - { link: 'management:dataViews' }, - { link: 'management:filesManagement' }, - { link: 'management:objects' }, - { link: 'management:tags' }, - { link: 'management:search_sessions' }, - { link: 'management:aiAssistantManagementSelection' }, - { link: 'management:spaces' }, - { link: 'management:settings' }, - ], - }, - { - title: 'Stack', - children: [ - { link: 'management:license_management' }, - { link: 'management:upgrade_assistant' }, - ], - }, - ], - }, - { - link: 'integrations', - }, - { - link: 'fleet', - }, { id: 'machine_learning-landing', link: 'securitySolutionUI:machine_learning-landing', renderAs: 'panelOpener', - spaceBefore: null, children: [ { children: [ @@ -467,6 +288,148 @@ const navTree: NavigationTreeDefinition = { }, ], }, + { + id: 'otherTools', + title: i18n.translate('xpack.observability.obltNav.otherTools', { + defaultMessage: 'Other tools', + }), + renderAs: 'panelOpener', + icon: 'editorCodeBlock', + children: [ + { + link: 'logs:stream', + title: i18n.translate('xpack.observability.obltNav.otherTools.logsStream', { + defaultMessage: 'Logs stream', + }), + }, + { + link: 'logs:anomalies', + title: i18n.translate('xpack.observability.obltNav.otherTools.logsAnomalies', { + defaultMessage: 'Logs anomalies', + }), + }, + { + link: 'logs:log-categories', + title: i18n.translate('xpack.observability.obltNav.otherTools.logsCategories', { + defaultMessage: 'Logs categories', + }), + }, + { link: 'maps' }, + { link: 'canvas' }, + { link: 'graph' }, + { + link: 'visualize', + title: i18n.translate('xpack.observability.obltNav.otherTools.logsCategories', { + defaultMessage: 'Visualize library', + }), + }, + ], + }, + ], + }, + ], + footer: [ + { type: 'recentlyAccessed' }, + { + type: 'navItem', + title: i18n.translate('xpack.observability.obltNav.addData', { + defaultMessage: 'Add data', + }), + link: 'observabilityOnboarding', + icon: 'launch', + }, + { + type: 'navItem', + id: 'devTools', + title: i18n.translate('xpack.observability.obltNav.devTools', { + defaultMessage: 'Developer tools', + }), + link: 'dev_tools', + icon: 'editorCodeBlock', + }, + { + type: 'navGroup', + id: 'project_settings_project_nav', + title: i18n.translate('xpack.observability.obltNav.management', { + defaultMessage: 'Management', + }), + icon: 'gear', + breadcrumbStatus: 'hidden', + children: [ + { + link: 'management', + title: i18n.translate('xpack.observability.obltNav.stackManagement', { + defaultMessage: 'Stack Management', + }), + renderAs: 'panelOpener', + spaceBefore: null, + children: [ + { + title: 'Ingest', + children: [{ link: 'management:ingest_pipelines' }, { link: 'management:pipelines' }], + }, + { + title: 'Data', + children: [ + { link: 'management:index_management' }, + { link: 'management:index_lifecycle_management' }, + { link: 'management:snapshot_restore' }, + { link: 'management:rollup_jobs' }, + { link: 'management:transform' }, + { link: 'management:cross_cluster_replication' }, + { link: 'management:remote_clusters' }, + { link: 'management:migrate_data' }, + ], + }, + { + title: 'Alerts and Insights', + children: [ + { link: 'management:triggersActions' }, + { link: 'management:cases' }, + { link: 'management:triggersActionsConnectors' }, + { link: 'management:reporting' }, + { link: 'management:jobsListLink' }, + { link: 'management:watcher' }, + { link: 'management:maintenanceWindows' }, + ], + }, + { + title: 'Security', + children: [ + { link: 'management:users' }, + { link: 'management:roles' }, + { link: 'management:api_keys' }, + { link: 'management:role_mappings' }, + ], + }, + { + title: 'Kibana', + children: [ + { link: 'management:dataViews' }, + { link: 'management:filesManagement' }, + { link: 'management:objects' }, + { link: 'management:tags' }, + { link: 'management:search_sessions' }, + { link: 'management:aiAssistantManagementSelection' }, + { link: 'management:spaces' }, + { link: 'management:settings' }, + ], + }, + { + title: 'Stack', + children: [ + { link: 'management:license_management' }, + { link: 'management:upgrade_assistant' }, + ], + }, + ], + }, + { + link: 'integrations', + }, + { + link: 'fleet', + }, { id: 'cloudLinkUserAndRoles', cloudLink: 'userAndRoles', From 412622884c7060ef677311fc17fe0f71caefc905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loix?= Date: Wed, 18 Sep 2024 12:02:56 +0100 Subject: [PATCH 02/19] Fix toggle panel from main button --- .../components/navigation_item_open_panel.tsx | 25 +++++++++-------- .../ui/components/panel/navigation_panel.tsx | 28 +++++++++++++++---- 2 files changed, 35 insertions(+), 18 deletions(-) diff --git a/packages/shared-ux/chrome/navigation/src/ui/components/navigation_item_open_panel.tsx b/packages/shared-ux/chrome/navigation/src/ui/components/navigation_item_open_panel.tsx index 8beb9a809264c..e060635b072c5 100644 --- a/packages/shared-ux/chrome/navigation/src/ui/components/navigation_item_open_panel.tsx +++ b/packages/shared-ux/chrome/navigation/src/ui/components/navigation_item_open_panel.tsx @@ -73,35 +73,36 @@ export const NavigationItemOpenPanel: FC = ({ item, navigateToUrl, active [`nav-item-id-${id}`]: id, [`nav-item-isActive`]: isActive, }); + const buttonDataTestSubj = classNames(`panelOpener`, `panelOpener-${path}`, { [`panelOpener-id-${id}`]: id, [`panelOpener-deepLinkId-${deepLink?.id}`]: !!deepLink, }); + const togglePanel = useCallback(() => { + if (selectedNode?.id === item.id) { + closePanel(); + } else { + openPanel(item); + } + }, [selectedNode?.id, item, closePanel, openPanel]); + const onLinkClick = useCallback( (e: React.MouseEvent) => { if (!href) { - if (selectedNode?.id === item.id) { - closePanel(); - } else { - openPanel(item); - } + togglePanel(); return; } e.preventDefault(); navigateToUrl(href); closePanel(); }, - [closePanel, href, item, navigateToUrl, openPanel, selectedNode] + [closePanel, href, navigateToUrl, togglePanel] ); const onIconClick = useCallback(() => { - if (selectedNode?.id === item.id) { - closePanel(); - } else { - openPanel(item); - } - }, [openPanel, closePanel, item, selectedNode]); + togglePanel(); + }, [togglePanel]); const isExpanded = selectedNode?.path === path; diff --git a/packages/shared-ux/chrome/navigation/src/ui/components/panel/navigation_panel.tsx b/packages/shared-ux/chrome/navigation/src/ui/components/panel/navigation_panel.tsx index 8e63e1179c955..10befd048bbaa 100644 --- a/packages/shared-ux/chrome/navigation/src/ui/components/panel/navigation_panel.tsx +++ b/packages/shared-ux/chrome/navigation/src/ui/components/panel/navigation_panel.tsx @@ -32,6 +32,12 @@ const getTestSubj = (selectedNode: PanelNavNode | null): string | undefined => { }); }; +const getTargetTestSubj = (target: EventTarget | null): string | undefined => { + if (!target) return; + + return (target as HTMLElement).dataset.testSubj; +}; + export const NavigationPanel: FC = () => { const { euiTheme } = useEuiTheme(); const { isOpen, close, getContent, selectedNode } = usePanel(); @@ -48,12 +54,22 @@ export const NavigationPanel: FC = () => { const onOutsideClick = useCallback( ({ target }: Event) => { - // Only close if we are not clicking on the currently selected nav node - if ( - !(target as HTMLButtonElement).dataset.testSubj?.includes( - `panelOpener-${selectedNode?.path}` - ) - ) { + let doClose = true; + + if (target) { + // Only close if we are not clicking on the currently selected nav node + const testSubj = + getTargetTestSubj(target) ?? getTargetTestSubj((target as HTMLElement).parentNode); + + if ( + testSubj?.includes(`nav-item-${selectedNode?.path}`) || + testSubj?.includes(`panelOpener-${selectedNode?.path}`) + ) { + doClose = false; + } + } + + if (doClose) { close(); } }, From bec5a72e59a9a5ebd17830af23fd1b3bcec7c40e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loix?= Date: Wed, 18 Sep 2024 12:09:13 +0100 Subject: [PATCH 03/19] Fix icon --- .../src/ui/components/navigation_item_open_panel.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/shared-ux/chrome/navigation/src/ui/components/navigation_item_open_panel.tsx b/packages/shared-ux/chrome/navigation/src/ui/components/navigation_item_open_panel.tsx index e060635b072c5..277da24ffeb50 100644 --- a/packages/shared-ux/chrome/navigation/src/ui/components/navigation_item_open_panel.tsx +++ b/packages/shared-ux/chrome/navigation/src/ui/components/navigation_item_open_panel.tsx @@ -61,6 +61,7 @@ export const NavigationItemOpenPanel: FC = ({ item, navigateToUrl, active const isNotMobile = useIsWithinMinBreakpoint('s'); const isIconVisible = isNotMobile && !isSideNavCollapsed && !!children && children.length > 0; const isActive = isActiveFromUrl(item.path, activeNodes); + const hasLandingPage = Boolean(href); const itemClassNames = classNames( 'sideNavItem', @@ -129,7 +130,7 @@ export const NavigationItemOpenPanel: FC = ({ item, navigateToUrl, active size="s" color="text" onClick={onIconClick} - iconType="arrowRight" + iconType={hasLandingPage ? 'spaces' : 'arrowRight'} iconSize="m" aria-label={i18n.translate('sharedUXPackages.chrome.sideNavigation.togglePanel', { defaultMessage: 'Toggle "{title}" panel navigation', From f7d3ccb851891239b4248988e06e445f0dce8c48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loix?= Date: Wed, 18 Sep 2024 12:42:58 +0100 Subject: [PATCH 04/19] Update func test helper to open/close panel with the link button --- .../page_objects/solution_navigation.ts | 25 ++++++++++++++++--- .../tests/observability_sidenav.ts | 20 +++++++++++++++ 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/test/functional/page_objects/solution_navigation.ts b/test/functional/page_objects/solution_navigation.ts index 882c5a478dbce..72feb4f1c12ce 100644 --- a/test/functional/page_objects/solution_navigation.ts +++ b/test/functional/page_objects/solution_navigation.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import expect from '@kbn/expect'; +import expect from '@kbn/expect/expect'; import type { AppDeepLinkId } from '@kbn/core-chrome-browser'; import type { NavigationID as MlNavId } from '@kbn/default-nav-ml'; @@ -186,14 +186,33 @@ export function SolutionNavigationProvider(ctx: Pick Date: Wed, 18 Sep 2024 16:08:39 +0300 Subject: [PATCH 05/19] remove unused i18n keys --- x-pack/plugins/translations/translations/fr-FR.json | 5 ----- x-pack/plugins/translations/translations/ja-JP.json | 5 ----- x-pack/plugins/translations/translations/zh-CN.json | 5 ----- 3 files changed, 15 deletions(-) diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index aa80184194c94..43cb4b63ab2d0 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -32539,15 +32539,10 @@ "xpack.observability.obltNav.apm.syntheticsGroupTitle": "Synthetics", "xpack.observability.obltNav.applications": "Applications", "xpack.observability.obltNav.devTools": "Outils de développeur", - "xpack.observability.obltNav.getStarted": "Démarrer", "xpack.observability.obltNav.headerSolutionSwitcher.obltSolutionTitle": "Observabilité", "xpack.observability.obltNav.infrastructure": "Infrastructure", "xpack.observability.obltNav.infrastructure.universalProfiling": "Universal Profiling", "xpack.observability.obltNav.management": "Gestion", - "xpack.observability.obltNav.ml.aiAndMlGroupTitle": "IA et ML", - "xpack.observability.obltNav.ml.changePointDetection": "Modifier la détection du point", - "xpack.observability.obltNav.ml.job.notifications": "Notifications de tâches", - "xpack.observability.obltNav.ml.logRateAnalysis": "Analyse du taux de log", "xpack.observability.obltNav.otherTools": "Autres outils", "xpack.observability.obltNav.otherTools.logsStream": "Flux de logs", "xpack.observability.obltNav.stackManagement": "Gestion de la Suite", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 9280f3b99b867..e185481ea9fa2 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -32525,15 +32525,10 @@ "xpack.observability.obltNav.apm.syntheticsGroupTitle": "Synthetics", "xpack.observability.obltNav.applications": "アプリケーション", "xpack.observability.obltNav.devTools": "開発者ツール", - "xpack.observability.obltNav.getStarted": "使ってみる", "xpack.observability.obltNav.headerSolutionSwitcher.obltSolutionTitle": "Observability", "xpack.observability.obltNav.infrastructure": "インフラストラクチャー", "xpack.observability.obltNav.infrastructure.universalProfiling": "ユニバーサルプロファイリング", "xpack.observability.obltNav.management": "管理", - "xpack.observability.obltNav.ml.aiAndMlGroupTitle": "AI & ML", - "xpack.observability.obltNav.ml.changePointDetection": "変化点検出", - "xpack.observability.obltNav.ml.job.notifications": "ジョブ通知", - "xpack.observability.obltNav.ml.logRateAnalysis": "ログレート分析", "xpack.observability.obltNav.otherTools": "その他のツール", "xpack.observability.obltNav.otherTools.logsStream": "ログストリーム", "xpack.observability.obltNav.stackManagement": "スタック管理", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 08826a2d5775e..148e8ccaf9e82 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -32565,15 +32565,10 @@ "xpack.observability.obltNav.apm.syntheticsGroupTitle": "Synthetics", "xpack.observability.obltNav.applications": "应用程序", "xpack.observability.obltNav.devTools": "开发者工具", - "xpack.observability.obltNav.getStarted": "开始使用", "xpack.observability.obltNav.headerSolutionSwitcher.obltSolutionTitle": "Observability", "xpack.observability.obltNav.infrastructure": "基础设施", "xpack.observability.obltNav.infrastructure.universalProfiling": "Universal Profiling", "xpack.observability.obltNav.management": "管理", - "xpack.observability.obltNav.ml.aiAndMlGroupTitle": "AI 和 ML", - "xpack.observability.obltNav.ml.changePointDetection": "更改点检测", - "xpack.observability.obltNav.ml.job.notifications": "作业通知", - "xpack.observability.obltNav.ml.logRateAnalysis": "日志速率分析", "xpack.observability.obltNav.otherTools": "其他工具", "xpack.observability.obltNav.otherTools.logsStream": "日志流", "xpack.observability.obltNav.stackManagement": "Stack Management", From 6832603d8db0e3b0c39719cb43ce5183f599277b Mon Sep 17 00:00:00 2001 From: Panagiota Mitsopoulou Date: Wed, 18 Sep 2024 21:24:51 +0300 Subject: [PATCH 06/19] add machine learning supplied configurations --- .../observability/public/navigation_tree.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts b/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts index 9f97f7db06438..a549e81c3b2b2 100644 --- a/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts +++ b/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts @@ -218,6 +218,9 @@ export function createNavTree(pluginsStart: ObservabilityPublicPluginsStart) { { link: 'ml:settings', }, + { + link: 'ml:suppliedConfigurations', + } ], }, { From 7cbdd0a32d0d7a5b8bf0cc9429023a1e4621d87d Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 18 Sep 2024 20:47:38 +0000 Subject: [PATCH 07/19] [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' --- test/functional/page_objects/solution_navigation.ts | 2 +- .../observability/public/navigation_tree.ts | 2 +- .../functional_solution_sidenav/tests/observability_sidenav.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/functional/page_objects/solution_navigation.ts b/test/functional/page_objects/solution_navigation.ts index 72feb4f1c12ce..882cafa6cd91e 100644 --- a/test/functional/page_objects/solution_navigation.ts +++ b/test/functional/page_objects/solution_navigation.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import expect from '@kbn/expect/expect'; +import expect from '@kbn/expect'; import type { AppDeepLinkId } from '@kbn/core-chrome-browser'; import type { NavigationID as MlNavId } from '@kbn/default-nav-ml'; diff --git a/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts b/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts index 1bbbe91ae3020..f857eddabd8da 100644 --- a/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts +++ b/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts @@ -207,7 +207,7 @@ export function createNavTree(pluginsStart: ObservabilityPublicPluginsStart) { }, { link: 'ml:suppliedConfigurations', - } + }, ], }, { diff --git a/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts b/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts index 4ff8f86d7d93f..6f329b086154c 100644 --- a/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts +++ b/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts @@ -5,7 +5,7 @@ * 2.0. */ -import expect from '@kbn/expect/expect'; +import expect from '@kbn/expect'; import { FtrProviderContext } from '../ftr_provider_context'; export default function ({ getPageObjects, getService }: FtrProviderContext) { From 7c876466053d00f15a1f8a6260259c4eb49c5ecf Mon Sep 17 00:00:00 2001 From: Panagiota Mitsopoulou Date: Thu, 19 Sep 2024 00:33:16 +0300 Subject: [PATCH 08/19] bring back ml menu --- .../observability/public/navigation_tree.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts b/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts index f857eddabd8da..087275a040883 100644 --- a/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts +++ b/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts @@ -167,8 +167,10 @@ export function createNavTree(pluginsStart: ObservabilityPublicPluginsStart) { }, { id: 'machine_learning-landing', - link: 'securitySolutionUI:machine_learning-landing', renderAs: 'panelOpener', + title: i18n.translate('xpack.observability.obltNav.machineLearning', { + defaultMessage: 'Machine learning', + }), children: [ { children: [ From f35ab587230bc6bbea3458fcc34cd121e20dc5a3 Mon Sep 17 00:00:00 2001 From: Panagiota Mitsopoulou Date: Thu, 19 Sep 2024 11:20:20 +0300 Subject: [PATCH 09/19] use sentence case for machine learning menu items --- .../observability/public/navigation_tree.ts | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts b/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts index 087275a040883..4973bcb7e4113 100644 --- a/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts +++ b/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts @@ -182,6 +182,12 @@ export function createNavTree(pluginsStart: ObservabilityPublicPluginsStart) { }, { link: 'ml:memoryUsage', + title: i18n.translate( + 'xpack.observability.obltNav.machineLearning.memoryUsage', + { + defaultMessage: 'Memory usage', + } + ), }, ], }, @@ -245,6 +251,12 @@ export function createNavTree(pluginsStart: ObservabilityPublicPluginsStart) { children: [ { link: 'ml:nodesOverview', + title: i18n.translate( + 'xpack.observability.obltNav.ml.model_management.trainedModels', + { + defaultMessage: 'Trained models', + } + ), }, ], }, @@ -267,7 +279,7 @@ export function createNavTree(pluginsStart: ObservabilityPublicPluginsStart) { { link: 'ml:indexDataVisualizer', title: i18n.translate( - 'xpack.observability.obltNav.ml.data_visualizer.file_data_visualizer', + 'xpack.observability.obltNav.ml.data_visualizer.data_view_data_visualizer', { defaultMessage: 'Data view data visualizer', } @@ -275,6 +287,12 @@ export function createNavTree(pluginsStart: ObservabilityPublicPluginsStart) { }, { link: 'ml:dataDrift', + title: i18n.translate( + 'xpack.observability.obltNav.ml.data_visualizer.data_drift', + { + defaultMessage: 'Data drift', + } + ), }, ], }, @@ -287,12 +305,30 @@ export function createNavTree(pluginsStart: ObservabilityPublicPluginsStart) { children: [ { link: 'ml:logRateAnalysis', + title: i18n.translate( + 'xpack.observability.obltNav.ml.aiops_labs.log_rate_analysis', + { + defaultMessage: 'Log rate analysis', + } + ), }, { link: 'ml:logPatternAnalysis', + title: i18n.translate( + 'xpack.observability.obltNav.ml.aiops_labs.log_pattern_analysis', + { + defaultMessage: 'Log pattern analysis', + } + ), }, { link: 'ml:changePointDetections', + title: i18n.translate( + 'xpack.observability.obltNav.ml.aiops_labs.change_point_detection', + { + defaultMessage: 'Change point detection', + } + ), }, ], }, From 7c9cf84232f27e6ac01ada8e3f634df92107d40d Mon Sep 17 00:00:00 2001 From: Panagiota Mitsopoulou Date: Thu, 19 Sep 2024 11:38:55 +0300 Subject: [PATCH 10/19] add missing data set quality in stack management --- .../observability/public/navigation_tree.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts b/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts index 4973bcb7e4113..c1e036828d4f1 100644 --- a/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts +++ b/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts @@ -421,6 +421,7 @@ export function createNavTree(pluginsStart: ObservabilityPublicPluginsStart) { title: 'Data', children: [ { link: 'management:index_management' }, + { link: 'management:data_quality' }, { link: 'management:index_lifecycle_management' }, { link: 'management:snapshot_restore' }, { link: 'management:rollup_jobs' }, From bc10b40a61bf84c54e2ab0f4db55534dc99ad9ef Mon Sep 17 00:00:00 2001 From: Panagiota Mitsopoulou Date: Thu, 19 Sep 2024 15:11:04 +0300 Subject: [PATCH 11/19] fix failing tests --- .../tests/observability_sidenav.ts | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts b/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts index 6f329b086154c..9b82c9f73e88b 100644 --- a/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts +++ b/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts @@ -64,17 +64,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(isOpen).to.be(false); } - // ----------------------------------------------------------------------------------------- - // NOTE: those tests below will now break after the navigation changes. Please update them. - - // check the AI & ML subsection - await solutionNavigation.sidenav.openSection('observability_project_nav.aiMl'); // open AI & ML subsection - await solutionNavigation.sidenav.clickLink({ deepLinkId: 'ml:anomalyDetection' }); - await solutionNavigation.sidenav.expectLinkActive({ deepLinkId: 'ml:anomalyDetection' }); - await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ text: 'Anomaly Detection' }); - await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ - deepLinkId: 'ml:anomalyDetection', - }); + // check the AI Assistant + await solutionNavigation.sidenav.clickLink({ navId: 'observabilityAIAssistant' }); // click on AI Assistant link + await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ text: 'AI Assistant' }); // navigate to a different section await solutionNavigation.sidenav.openSection('project_settings_project_nav'); From 7904689acc7c250d2cf708423f1017342622792e Mon Sep 17 00:00:00 2001 From: Panagiota Mitsopoulou Date: Thu, 19 Sep 2024 15:12:52 +0300 Subject: [PATCH 12/19] add more tests --- .../page_objects/solution_navigation.ts | 3 +++ x-pack/test/functional_solution_sidenav/index.ts | 4 ++-- .../tests/observability_sidenav.ts | 16 ++++++++++++++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/test/functional/page_objects/solution_navigation.ts b/test/functional/page_objects/solution_navigation.ts index 882cafa6cd91e..95f8f9a584610 100644 --- a/test/functional/page_objects/solution_navigation.ts +++ b/test/functional/page_objects/solution_navigation.ts @@ -130,6 +130,9 @@ export function SolutionNavigationProvider(ctx: Pick { describe('Solution navigation smoke tests', function () { loadTestFile(require.resolve('./tests/observability_sidenav')); - loadTestFile(require.resolve('./tests/search_sidenav')); - loadTestFile(require.resolve('./tests/security_sidenav')); + // loadTestFile(require.resolve('./tests/search_sidenav')); + // loadTestFile(require.resolve('./tests/security_sidenav')); }); }; diff --git a/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts b/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts index 9b82c9f73e88b..6064266b10f8c 100644 --- a/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts +++ b/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts @@ -56,14 +56,26 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(isOpen).to.be(true); } - // TODO: here navigate to some link inside the panel (note: this is a smoke test file not full coverage) - await solutionNavigation.sidenav.closePanel('apm', { button: 'link' }); { const isOpen = await solutionNavigation.sidenav.isPanelOpen('apm'); expect(isOpen).to.be(false); } + // open Infrastructure panel using the icon button and navigate to some link inside the panel + await solutionNavigation.sidenav.openPanel('metrics', { button: 'icon' }); + { + const isOpen = await solutionNavigation.sidenav.isPanelOpen('metrics'); + expect(isOpen).to.be(true); + } + await solutionNavigation.sidenav.clickPanelLink('metrics:inventory'); + await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ text: 'Inventory' }); + + { + const isOpen = await solutionNavigation.sidenav.isPanelOpen('metrics'); + expect(isOpen).to.be(false); + } + // check the AI Assistant await solutionNavigation.sidenav.clickLink({ navId: 'observabilityAIAssistant' }); // click on AI Assistant link await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ text: 'AI Assistant' }); From 97301991334b73d8037e106ed18336219d497030 Mon Sep 17 00:00:00 2001 From: Panagiota Mitsopoulou Date: Tue, 1 Oct 2024 21:59:05 +0300 Subject: [PATCH 13/19] uncomment tests --- x-pack/test/functional_solution_sidenav/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/test/functional_solution_sidenav/index.ts b/x-pack/test/functional_solution_sidenav/index.ts index 623149331683a..9056551e235d5 100644 --- a/x-pack/test/functional_solution_sidenav/index.ts +++ b/x-pack/test/functional_solution_sidenav/index.ts @@ -11,7 +11,7 @@ import { FtrProviderContext } from './ftr_provider_context'; export default ({ loadTestFile }: FtrProviderContext): void => { describe('Solution navigation smoke tests', function () { loadTestFile(require.resolve('./tests/observability_sidenav')); - // loadTestFile(require.resolve('./tests/search_sidenav')); - // loadTestFile(require.resolve('./tests/security_sidenav')); + loadTestFile(require.resolve('./tests/search_sidenav')); + loadTestFile(require.resolve('./tests/security_sidenav')); }); }; From 67d34b82b09892d187de17972fb2dbbfd7ba355a Mon Sep 17 00:00:00 2001 From: Panagiota Mitsopoulou Date: Tue, 1 Oct 2024 22:20:01 +0300 Subject: [PATCH 14/19] update infrastructure breadcrumb --- .../tests/observability_sidenav.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts b/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts index 6064266b10f8c..edaa4a67f75e0 100644 --- a/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts +++ b/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts @@ -69,7 +69,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(isOpen).to.be(true); } await solutionNavigation.sidenav.clickPanelLink('metrics:inventory'); - await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ text: 'Inventory' }); + await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ + text: 'Infrastructure Inventory', + }); { const isOpen = await solutionNavigation.sidenav.isPanelOpen('metrics'); From 8d3ab8f9790b5d7ce65c4d22cc6c30a9e1ad34d7 Mon Sep 17 00:00:00 2001 From: Panagiota Mitsopoulou Date: Tue, 1 Oct 2024 22:26:00 +0300 Subject: [PATCH 15/19] update to sentence case --- .../observability/public/navigation_tree.ts | 7 ++++++- .../tests/observability_sidenav.ts | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts b/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts index a9e49b0ca19d7..c661976fd0765 100644 --- a/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts +++ b/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts @@ -131,7 +131,12 @@ export function createNavTree(pluginsStart: ObservabilityPublicPluginsStart) { children: [ { children: [ - { link: 'metrics:inventory' }, + { + link: 'metrics:inventory', + title: i18n.translate('xpack.observability.infrastructure.inventory', { + defaultMessage: 'Infrastructure inventory', + }), + }, { link: 'metrics:hosts' }, { link: 'metrics:metrics-explorer', diff --git a/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts b/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts index edaa4a67f75e0..20ae32824689c 100644 --- a/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts +++ b/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts @@ -70,7 +70,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { } await solutionNavigation.sidenav.clickPanelLink('metrics:inventory'); await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ - text: 'Infrastructure Inventory', + text: 'Infrastructure inventory', }); { From e542e88eee01e28571a3ee67bef77e8f65e60cb7 Mon Sep 17 00:00:00 2001 From: Panagiota Mitsopoulou Date: Tue, 1 Oct 2024 23:22:03 +0300 Subject: [PATCH 16/19] add more test cases --- .../page_objects/solution_navigation.ts | 10 +++++- .../tests/observability_sidenav.ts | 31 +++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/test/functional/page_objects/solution_navigation.ts b/test/functional/page_objects/solution_navigation.ts index 95f8f9a584610..a0544e1100507 100644 --- a/test/functional/page_objects/solution_navigation.ts +++ b/test/functional/page_objects/solution_navigation.ts @@ -59,7 +59,11 @@ export function SolutionNavigationProvider(ctx: Pick Date: Wed, 2 Oct 2024 18:10:22 +0300 Subject: [PATCH 17/19] remove unnecessary comments --- .../functional_solution_sidenav/tests/observability_sidenav.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts b/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts index 4e66390340d45..b250dd08211ac 100644 --- a/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts +++ b/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts @@ -118,7 +118,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await solutionNavigation.sidenav.clickLink({ deepLinkId: 'management' }); await solutionNavigation.sidenav.expectLinkActive({ deepLinkId: 'management' }); await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ deepLinkId: 'management' }); - // ----------------------------------------------------------------------------------------- // navigate back to the home page using header logo await solutionNavigation.clickLogo(); From 120e1c21194c46749f0a26d1baae1361a88f5fb3 Mon Sep 17 00:00:00 2001 From: Panagiota Mitsopoulou Date: Wed, 2 Oct 2024 18:23:10 +0300 Subject: [PATCH 18/19] remove additional tests from sidenav tests --- .../tests/observability_sidenav.ts | 35 ------------------- 1 file changed, 35 deletions(-) diff --git a/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts b/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts index b250dd08211ac..87daa58fc2681 100644 --- a/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts +++ b/x-pack/test/functional_solution_sidenav/tests/observability_sidenav.ts @@ -78,41 +78,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(isOpen).to.be(false); } - // check the AI Assistant - await solutionNavigation.sidenav.clickLink({ navId: 'observabilityAIAssistant' }); // click on AI Assistant link - await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ text: 'AI Assistant' }); - - // check Other Tools section - await solutionNavigation.sidenav.openPanel('otherTools', { button: 'link' }); - { - const isOpen = await solutionNavigation.sidenav.isPanelOpen('otherTools'); - expect(isOpen).to.be(true); - } - await solutionNavigation.sidenav.expectLinkExists({ - panelNavLinkId: 'logs:anomalies', - }); - - await solutionNavigation.sidenav.expectLinkExists({ - panelNavLinkId: 'logs:log-categories', - }); - - await solutionNavigation.sidenav.clickPanelLink('visualize'); - await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ - text: 'Visualize library', - }); - - // check Machine Learning section - await solutionNavigation.sidenav.openPanel('machine_learning-landing'); - { - const isOpen = await solutionNavigation.sidenav.isPanelOpen('machine_learning-landing'); - expect(isOpen).to.be(true); - } - - await solutionNavigation.sidenav.clickPanelLink('ml:suppliedConfigurations'); - await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ - text: 'Supplied configurations', - }); - // navigate to a different section await solutionNavigation.sidenav.openSection('project_settings_project_nav'); await solutionNavigation.sidenav.clickLink({ deepLinkId: 'management' }); From bf283787837b23ced90aa7d4719a21f9c59a3eb0 Mon Sep 17 00:00:00 2001 From: Panagiota Mitsopoulou Date: Thu, 3 Oct 2024 12:12:33 +0300 Subject: [PATCH 19/19] add o11y sidenav functional tests --- .../apps/observability/index.ts | 1 + .../apps/observability/sidenav/sidenav.ts | 72 +++++++++++++++++++ .../with_rac_write.config.ts | 3 + 3 files changed, 76 insertions(+) create mode 100644 x-pack/test/observability_functional/apps/observability/sidenav/sidenav.ts diff --git a/x-pack/test/observability_functional/apps/observability/index.ts b/x-pack/test/observability_functional/apps/observability/index.ts index 96256248e5d88..f061fe68649d5 100644 --- a/x-pack/test/observability_functional/apps/observability/index.ts +++ b/x-pack/test/observability_functional/apps/observability/index.ts @@ -26,5 +26,6 @@ export default function ({ loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./pages/rule_details_page')); loadTestFile(require.resolve('./pages/alert_details_page')); loadTestFile(require.resolve('./pages/alerts/metric_threshold')); + loadTestFile(require.resolve('./sidenav/sidenav')); }); } diff --git a/x-pack/test/observability_functional/apps/observability/sidenav/sidenav.ts b/x-pack/test/observability_functional/apps/observability/sidenav/sidenav.ts new file mode 100644 index 0000000000000..201729b0bcc06 --- /dev/null +++ b/x-pack/test/observability_functional/apps/observability/sidenav/sidenav.ts @@ -0,0 +1,72 @@ +/* + * 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 expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../ftr_provider_context'; + +export default function ({ getPageObjects, getService }: FtrProviderContext) { + const { common, solutionNavigation } = getPageObjects(['common', 'solutionNavigation']); + const spaces = getService('spaces'); + const browser = getService('browser'); + + describe('o11y sidenav', () => { + let cleanUp: () => Promise; + let spaceCreated: { id: string } = { id: '' }; + before(async () => { + // Navigate to the spaces management page which will log us in Kibana + await common.navigateToUrl('management', 'kibana/spaces', { + shouldUseHashForSubUrl: false, + }); + // Create a space with the observability solution and navigate to its home page + ({ cleanUp, space: spaceCreated } = await spaces.create({ solution: 'oblt' })); + await browser.navigateTo(spaces.getRootUrl(spaceCreated.id)); + }); + + after(async () => { + // Clean up space created + await cleanUp(); + }); + + describe('sidenav & breadcrumbs', () => { + it('renders the correct nav and navigate to links', async () => { + await solutionNavigation.sidenav.clickLink({ navId: 'observabilityAIAssistant' }); // click on AI Assistant link + await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ text: 'AI Assistant' }); + + // check Other Tools section + await solutionNavigation.sidenav.openPanel('otherTools', { button: 'link' }); + { + const isOpen = await solutionNavigation.sidenav.isPanelOpen('otherTools'); + expect(isOpen).to.be(true); + } + await solutionNavigation.sidenav.expectLinkExists({ + panelNavLinkId: 'logs:anomalies', + }); + + await solutionNavigation.sidenav.expectLinkExists({ + panelNavLinkId: 'logs:log-categories', + }); + + await solutionNavigation.sidenav.clickPanelLink('visualize'); + await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ + text: 'Visualize library', + }); + + // check Machine Learning section + await solutionNavigation.sidenav.openPanel('machine_learning-landing'); + { + const isOpen = await solutionNavigation.sidenav.isPanelOpen('machine_learning-landing'); + expect(isOpen).to.be(true); + } + + await solutionNavigation.sidenav.clickPanelLink('ml:suppliedConfigurations'); + await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ + text: 'Supplied configurations', + }); + }); + }); + }); +} diff --git a/x-pack/test/observability_functional/with_rac_write.config.ts b/x-pack/test/observability_functional/with_rac_write.config.ts index 83227af64d701..6ca4262b3ea42 100644 --- a/x-pack/test/observability_functional/with_rac_write.config.ts +++ b/x-pack/test/observability_functional/with_rac_write.config.ts @@ -52,6 +52,9 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { ...xpackFunctionalConfig.get('kbnTestServer'), serverArgs: [ ...xpackFunctionalConfig.get('kbnTestServer.serverArgs'), + '--xpack.cloud.id=ftr_fake_cloud_id:aGVsbG8uY29tOjQ0MyRFUzEyM2FiYyRrYm4xMjNhYmM=', + '--xpack.cloud.base_url=https://cloud.elastic.co', + '--xpack.spaces.allowSolutionVisibility=true', `--elasticsearch.hosts=https://${servers.elasticsearch.hostname}:${servers.elasticsearch.port}`, `--elasticsearch.ssl.certificateAuthorities=${CA_CERT_PATH}`, `--plugin-path=${resolve(__dirname, '../functional_with_es_ssl/plugins/alerts')}`,