-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Add side navigation component for serverless search #156465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0493ffb
5da6e09
5b8f09d
2fef742
cd1cad8
4199a7a
90c150a
12a8673
897ffcf
dcba408
1980903
00a3b5e
4945a14
ad537f1
15be9ad
f11f607
e7bc9ba
c309b1c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| /* | ||
| * 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'; | ||
|
|
||
| const navItems: ChromeNavigationNodeViewModel[] = [ | ||
| { | ||
| title: '', | ||
| id: 'root', | ||
| items: [ | ||
| { id: 'overview', title: 'Overview', href: '/app/enterprise_search/overview' }, | ||
| { id: 'indices', title: 'Indices', href: '/app/enterprise_search/content/search_indices' }, | ||
| { id: 'engines', title: 'Engines', href: '/app/enterprise_search/content/engines' }, | ||
| { id: 'api_keys', title: 'API keys', href: '/app/management/security/api_keys' }, | ||
| { | ||
| id: 'ingest_pipelines', | ||
| title: 'Ingest pipelines', | ||
| href: '/app/management/ingest/ingest_pipelines', | ||
| }, | ||
| ], | ||
| }, | ||
| ]; | ||
|
|
||
| export const createServerlessSearchSideNavComponent = (core: CoreStart) => () => { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are inside the |
||
| // Currently, this allows the "Search" section of the side nav to render as pre-expanded. | ||
| // This will soon be powered from state received from core.chrome | ||
| const activeNavItemId = 'search_project_nav.root'; | ||
|
|
||
| return ( | ||
| <NavigationKibanaProvider core={core}> | ||
| <Navigation | ||
| navigationTree={[ | ||
| { | ||
| id: 'search_project_nav', | ||
| items: navItems, | ||
| title: 'Search', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here too |
||
| icon: 'logoEnterpriseSearch', | ||
| }, | ||
| ]} | ||
| activeNavItemId={activeNavItemId} | ||
| homeHref="/app/enterprise_search/content/setup_guide" | ||
| linkToCloud="projects" | ||
| /> | ||
| </NavigationKibanaProvider> | ||
| ); | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ | |
| */ | ||
|
|
||
| import { CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; | ||
| import { createServerlessSearchSideNavComponent as createComponent } from './layout/nav'; | ||
| import { | ||
| ServerlessSearchPluginSetup, | ||
| ServerlessSearchPluginSetupDependencies, | ||
|
|
@@ -24,9 +25,10 @@ export class ServerlessSearchPlugin | |
| } | ||
|
|
||
| public start( | ||
| _core: CoreStart, | ||
| core: CoreStart, | ||
| _startDeps: ServerlessSearchPluginStartDependencies | ||
| ): ServerlessSearchPluginStart { | ||
| core.chrome.project.setSideNavComponent(createComponent(core)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we should still set it through the serverless plugin as it was in the POC. not sure if there is a benefit to it
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See: #156600 (comment) I think we should bring it back |
||
| return {}; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to translate those
title