-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Observability] Add side navigation for serverless observability (#15…
…7360) ## Summary The PR introduces the first iteration of the side navigation bar for serverless observability. Part of #153777 ### Run locally ``` yarn serverless-oblt ``` #### Screenshots  https://github.com/elastic/kibana/assets/3369346/39ded143-0d4b-4ea6-9534-0ca87b80662d ### Fixes - Fix rendering the icon for the nested navigation items - 24ee4dc ### Notes - There is an issue where the selected navigation item is not properly highlighted and loses focus when the user clicks anywhere else on the page. (atm out of the scope of the PR) - The navigation tree is subject to change as there is an ongoing discussion about the naming and order --------- Co-authored-by: Søren Louv-Jansen <soren.louv@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
e6c91c9
commit 1f99a04
Showing
8 changed files
with
152 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
115 changes: 115 additions & 0 deletions
115
x-pack/plugins/serverless_observability/public/components/side_navigation/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
/* | ||
* 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 { CoreStart } from '@kbn/core/public'; | ||
import { | ||
ChromeNavigationNodeViewModel, | ||
Navigation, | ||
NavigationKibanaProvider, | ||
} from '@kbn/shared-ux-chrome-navigation'; | ||
import React from 'react'; | ||
|
||
// #TODO translate titles? | ||
const navItems: ChromeNavigationNodeViewModel[] = [ | ||
{ | ||
id: 'services-infra', | ||
items: [ | ||
{ id: 'services', title: 'Services', href: '/app/apm/services' }, | ||
{ | ||
id: 'infra', | ||
title: 'Infrastructure', | ||
href: '/app/metrics/inventory', | ||
}, | ||
], | ||
}, | ||
{ | ||
id: 'alerts-cases-slos', | ||
items: [ | ||
{ | ||
id: 'alerts', | ||
title: 'Alerts', | ||
href: '/app/observability/alerts', | ||
}, | ||
{ | ||
id: 'Cases', | ||
title: 'Cases', | ||
href: '/app/observability/cases', | ||
}, | ||
{ | ||
id: 'slos', | ||
title: 'SLOs', | ||
href: '/app/observability/slos', | ||
}, | ||
], | ||
}, | ||
{ | ||
id: 'signals', | ||
title: 'Signals', | ||
items: [ | ||
{ | ||
id: 'traces', | ||
title: 'Traces', | ||
href: '/app/apm/traces', | ||
}, | ||
{ | ||
id: 'logs', | ||
title: 'Logs', | ||
href: '/app/logs/stream', | ||
}, | ||
], | ||
}, | ||
{ | ||
id: 'toolbox', | ||
title: 'Toolbox', | ||
items: [ | ||
{ | ||
id: 'visualization', | ||
title: 'Visualization', | ||
href: '/app/visualize', | ||
}, | ||
{ | ||
id: 'dashboards', | ||
title: 'Dashboards', | ||
href: '/app/dashboards', | ||
}, | ||
], | ||
}, | ||
{ | ||
id: 'on-boarding', | ||
items: [ | ||
{ | ||
id: 'get-started', | ||
title: 'Get started', | ||
icon: 'launch', | ||
href: '/app/observabilityOnboarding', | ||
}, | ||
], | ||
}, | ||
]; | ||
|
||
export const getObservabilitySideNavComponent = (core: CoreStart) => () => { | ||
const activeNavItemId = 'observability_project_nav.root'; | ||
|
||
return ( | ||
<NavigationKibanaProvider core={core}> | ||
<Navigation | ||
navigationTree={[ | ||
{ | ||
id: 'observability_project_nav', | ||
items: navItems, | ||
title: 'Observability', | ||
icon: 'logoObservability', | ||
}, | ||
]} | ||
activeNavItemId={activeNavItemId} | ||
homeHref="/app/enterprise_search/content/setup_guide" | ||
linkToCloud="projects" | ||
platformConfig={{ devTools: { enabled: false } }} | ||
/> | ||
</NavigationKibanaProvider> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
x-pack/plugins/serverless_observability/public/services.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* 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 { CoreStart } from '@kbn/core/public'; | ||
import React from 'react'; | ||
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; | ||
import type { ServerlessObservabilityPluginStartDependencies } from './types'; | ||
|
||
type Services = CoreStart & ServerlessObservabilityPluginStartDependencies; | ||
|
||
export const KibanaServicesProvider: React.FC<{ | ||
core: CoreStart; | ||
pluginsStart: ServerlessObservabilityPluginStartDependencies; | ||
}> = ({ core, pluginsStart, children }) => { | ||
const services: Services = { ...core, ...pluginsStart }; | ||
return <KibanaContextProvider services={services}>{children}</KibanaContextProvider>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters