Skip to content

Commit

Permalink
[Logs Explorer] Change the default link for "Discover" in the serverl…
Browse files Browse the repository at this point in the history
…ess nav (#173420)

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
weltenwort and kibanamachine authored Jan 3, 2024
1 parent 9da2776 commit eb83fac
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,20 @@ const navigationTree: NavigationTreeDefinition = {
title: i18n.translate('xpack.serverlessObservability.nav.discover', {
defaultMessage: 'Discover',
}),
link: 'discover',
link: 'observability-log-explorer',
// prevent this entry from ever becoming active, effectively falling through to the obs-log-explorer child
getIsActive: () => false,
// avoid duplicate "Discover" breadcrumbs
breadcrumbStatus: 'hidden',
renderAs: 'item',
children: [
{
// This is to show "observability-log-explorer" breadcrumbs when navigating from "discover" to "log explorer"
link: 'observability-log-explorer',
sideNavStatus: 'hidden',
link: 'discover',
children: [
{
link: 'observability-log-explorer',
},
],
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});

describe('Side nav', function () {
this.tags([
'skipSvlOblt', // the "Discover" side nav entry does something different in oblt
]);

it('should sync Lens global state to Discover sidebar link and carry over the state when navigating to Discover', async () => {
await PageObjects.common.navigateToApp('discover');
await PageObjects.common.navigateToApp('lens');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,15 @@ export default function ({ getPageObject, getService }: FtrProviderContext) {
});
await svlCommonNavigation.sidenav.expectSectionClosed('project_settings_project_nav');

// navigate to discover
await svlCommonNavigation.sidenav.clickLink({ deepLinkId: 'discover' });
await svlCommonNavigation.sidenav.expectLinkActive({ deepLinkId: 'discover' });
await svlCommonNavigation.breadcrumbs.expectBreadcrumbExists({ deepLinkId: 'discover' });
expect(await browser.getCurrentUrl()).contain('/app/discover');
// navigate to the logs explorer tab by default
await svlCommonNavigation.sidenav.clickLink({ deepLinkId: 'observability-log-explorer' });
await svlCommonNavigation.sidenav.expectLinkActive({
deepLinkId: 'observability-log-explorer',
});
await svlCommonNavigation.breadcrumbs.expectBreadcrumbExists({
deepLinkId: 'observability-log-explorer',
});
expect(await browser.getCurrentUrl()).contain('/app/observability-log-explorer');

// check the aiops subsection
await svlCommonNavigation.sidenav.openSection('observability_project_nav.aiops'); // open ai ops subsection
Expand Down

0 comments on commit eb83fac

Please sign in to comment.