diff --git a/x-pack/plugins/security_solution_serverless/public/navigation/default_navigation.tsx b/x-pack/plugins/security_solution_serverless/public/navigation/default_navigation.tsx index b5049f2e4d366..f49a627eb7eb8 100644 --- a/x-pack/plugins/security_solution_serverless/public/navigation/default_navigation.tsx +++ b/x-pack/plugins/security_solution_serverless/public/navigation/default_navigation.tsx @@ -14,7 +14,6 @@ import { SolutionSideNavPanelContent } from '@kbn/security-solution-side-nav/pan import useObservable from 'react-use/lib/useObservable'; import { useKibana } from '../common/services'; import type { ProjectNavigationLink, ProjectPageName } from './links/types'; -// import { processCloudLinks } from './links/nav_links'; import { useFormattedSideNavItems } from './side_navigation/use_side_nav_items'; import { CATEGORIES, FOOTER_CATEGORIES } from './categories'; import { formatNavigationTree } from './navigation_tree/navigation_tree'; @@ -23,12 +22,10 @@ const getPanelContentProvider = ( projectNavLinks: ProjectNavigationLink[] ): React.FC => React.memo(function PanelContentProvider({ selectedNode: { path }, closePanel }) { - // const { cloud } = useKibana().services; const linkId = path[path.length - 1] as ProjectPageName; const currentPanelItem = projectNavLinks.find((item) => item.id === linkId); const { title = '', links = [], categories } = currentPanelItem ?? {}; - // const panelLinks = processCloudLinks(links, cloud); const items = useFormattedSideNavItems(links); if (items.length === 0) { diff --git a/x-pack/plugins/security_solution_serverless/public/navigation/navigation_tree/navigation_tree.test.ts b/x-pack/plugins/security_solution_serverless/public/navigation/navigation_tree/navigation_tree.test.ts index 868c944d8cae5..377f01ca0d784 100644 --- a/x-pack/plugins/security_solution_serverless/public/navigation/navigation_tree/navigation_tree.test.ts +++ b/x-pack/plugins/security_solution_serverless/public/navigation/navigation_tree/navigation_tree.test.ts @@ -53,6 +53,7 @@ describe('formatNavigationTree', () => { expect(securityNode?.children).toEqual([ { + id: link1.id, link: chromeNavLink1.id, title: link1.title, }, @@ -75,6 +76,7 @@ describe('formatNavigationTree', () => { breadcrumbStatus: 'hidden', children: [ { + id: link1.id, link: chromeNavLink1.id, title: link1.title, }, @@ -97,10 +99,12 @@ describe('formatNavigationTree', () => { breadcrumbStatus: 'hidden', children: [ { + id: link1.id, link: chromeNavLink1.id, title: link1.title, }, { + id: link2.id, link: chromeNavLink2.id, title: link2.title, }, @@ -125,6 +129,7 @@ describe('formatNavigationTree', () => { breadcrumbStatus: 'hidden', children: [ { + id: link1.id, link: chromeNavLink1.id, title: link1.title, }, @@ -149,6 +154,7 @@ describe('formatNavigationTree', () => { breadcrumbStatus: 'hidden', children: [ { + id: link1.id, link: chromeNavLink1.id, title: link1.title, }, @@ -163,6 +169,7 @@ describe('formatNavigationTree', () => { expect(securityNode?.children).toEqual([ { + id: link3.id, link: chromeNavLink3.id, title: link3.title, }, @@ -179,13 +186,15 @@ describe('formatNavigationTree', () => { expect(securityNode?.children).toEqual([ { + id: link1.id, link: chromeNavLink1.id, title: link1.title, children: [ { + id: link2.id, link: chromeNavLink2.id, title: link2.title, - children: [{ link: chromeNavLink3.id, title: link3.title }], + children: [{ id: link3.id, link: chromeNavLink3.id, title: link3.title }], renderAs: 'panelOpener', }, ], @@ -208,11 +217,13 @@ describe('formatNavigationTree', () => { expect(securityNode?.children).toEqual([ { + id: SecurityPageName.usersEvents, link: chromeNavLinkTest.id, title: link1.title, breadcrumbStatus: 'hidden', }, { + id: link2.id, link: chromeNavLink2.id, title: link2.title, }, diff --git a/x-pack/plugins/security_solution_serverless/public/navigation/navigation_tree/navigation_tree.ts b/x-pack/plugins/security_solution_serverless/public/navigation/navigation_tree/navigation_tree.ts index 9c3caf359e27a..2d9ad8c1bb2d5 100644 --- a/x-pack/plugins/security_solution_serverless/public/navigation/navigation_tree/navigation_tree.ts +++ b/x-pack/plugins/security_solution_serverless/public/navigation/navigation_tree/navigation_tree.ts @@ -118,6 +118,7 @@ const createNodeFromProjectNavLink = (projectNavLink: ProjectNavigationLink): No const { id, title, links, categories, disabled } = projectNavLink; const link = getNavLinkIdFromProjectPageName(id); const node: NodeDefinition = { + id, link: link as AppDeepLinkId, title, ...(isBreadcrumbHidden(id) && { breadcrumbStatus: 'hidden' }), @@ -171,6 +172,7 @@ const formatFooterNodesFromLinks = ( ...(isCloudLink(projectNavLink.id) ? { cloudLink: getCloudLink(projectNavLink.id), + openInNewTab: true, } : { link: getNavLinkIdFromProjectPageName(projectNavLink.id) as AppDeepLinkId,