[Serverless] make parent nav item into breadcrumb link (#183189)

## Summary

Currently the breadcrumb of the parent navigation item isn't a link:

<img width="339" alt="Screenshot 2024-05-10 at 2 06 42 PM"
src="1471125f-59d7-468e-8ede-3a3c3c3e42dc">

This change makes it so the breadcrumb of parent navigation item is
linkable:
<img width="293" alt="Screenshot 2024-05-10 at 2 21 27 PM"
src="aad5e650-33e1-419d-b866-0b7ec70e1f42">

The links will go to the first item in the list of child links.

The merging of this PR depends on
https://github.com/elastic/kibana/pull/183508 allows for this
functionality to work without making the left side parent collapsible
link, also a href link - only the breadcrumb.

## Testing
- Start a serverless kibana instance

- Navigate to a child link of an accordion using the left side
navigation
<img width="589" alt="Screenshot 2024-05-15 at 11 26 24 AM"
src="d225967d-37d1-4f19-b3f5-856fcc1bce68">

- The breadcrumb should of this page should be a link and link you to
the first child link of the accordion
This commit is contained in:
Sandra G 2024-05-16 08:14:18 -04:00 committed by GitHub
parent fb8ba21e28
commit 99ab2f4a9a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View file

@ -72,6 +72,7 @@ export const navigationTree: NavigationTreeDefinition = {
{
id: 'aiops',
title: 'AIOps',
link: 'ml:anomalyDetection',
renderAs: 'accordion',
spaceBefore: null,
children: [
@ -80,6 +81,7 @@ export const navigationTree: NavigationTreeDefinition = {
defaultMessage: 'Anomaly detection',
}),
link: 'ml:anomalyDetection',
id: 'ml:anomalyDetection',
renderAs: 'item',
children: [
{
@ -124,6 +126,7 @@ export const navigationTree: NavigationTreeDefinition = {
title: i18n.translate('xpack.serverlessObservability.nav.applications', {
defaultMessage: 'Applications',
}),
link: 'apm:services',
renderAs: 'accordion',
children: [
{
@ -156,6 +159,7 @@ export const navigationTree: NavigationTreeDefinition = {
title: i18n.translate('xpack.serverlessObservability.nav.infrastructure', {
defaultMessage: 'Infrastructure',
}),
link: 'metrics:inventory',
renderAs: 'accordion',
children: [
{

View file

@ -51,8 +51,8 @@ export default function ({ getPageObject, getService }: FtrProviderContext) {
// check the aiops subsection
await svlCommonNavigation.sidenav.openSection('observability_project_nav.aiops'); // open ai ops subsection
await svlCommonNavigation.sidenav.clickLink({ deepLinkId: 'ml:anomalyDetection' });
await svlCommonNavigation.sidenav.expectLinkActive({ deepLinkId: 'ml:anomalyDetection' });
await svlCommonNavigation.sidenav.clickLink({ navId: 'ml:anomalyDetection' });
await svlCommonNavigation.sidenav.expectLinkActive({ navId: 'ml:anomalyDetection' });
await svlCommonNavigation.breadcrumbs.expectBreadcrumbExists({ text: 'AIOps' });
await svlCommonNavigation.breadcrumbs.expectBreadcrumbExists({
deepLinkId: 'ml:anomalyDetection',