Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
0493ffb
Add side navigation component for serverless search
tsullivan May 3, 2023
5da6e09
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine May 3, 2023
5b8f09d
simplify per code review
tsullivan May 3, 2023
2fef742
Merge branch 'main' into serverless/nav-component/search
tsullivan May 3, 2023
cd1cad8
rename create component function
tsullivan May 3, 2023
4199a7a
Re-introduce hardcoded activeNavItemId + comment
tsullivan May 3, 2023
90c150a
Merge branch 'serverless/nav-component/search' of github.com:tsulliva…
tsullivan May 3, 2023
12a8673
bump serverlessSearch bundle size limit
tsullivan May 3, 2023
897ffcf
re-bump the optimizer limit for serverless search plugin
tsullivan May 3, 2023
dcba408
Merge branch 'main' into serverless/nav-component/search
tsullivan May 3, 2023
1980903
Refactor shared-ux chrome nav package to work with ChromeNavigationNode
sebelga May 3, 2023
00a3b5e
Fix jest test
sebelga May 3, 2023
4945a14
[ChromeNavPackage] Refactor to work with ChromeNavigationNode #156526
tsullivan May 3, 2023
ad537f1
Merge branch 'chrome-nav/set-navigation-api' into serverless/nav-comp…
tsullivan May 3, 2023
15be9ad
api changes for navigation component refactor
tsullivan May 3, 2023
f11f607
Merge remote-tracking branch 'elastic/main' into serverless/nav-compo…
tsullivan May 4, 2023
e7bc9ba
re-bump the optimizer limit for serverless search plugin
tsullivan May 5, 2023
c309b1c
Merge branch 'main' into serverless/nav-component/search
tsullivan May 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pageLoadAssetSize:
securitySolution: 66738
serverless: 16573
serverlessObservability: 16582
serverlessSearch: 17548
serverlessSearch: 20555
serverlessSecurity: 41807
sessionView: 77750
share: 71239
Expand Down
56 changes: 56 additions & 0 deletions x-pack/plugins/serverless_search/public/layout/nav.tsx
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' },
Copy link
Copy Markdown
Contributor

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

{ 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) => () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are inside the serverless_search plugin. I think we can simply call this createSideNavComponent

// 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',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too title should be translated

icon: 'logoEnterpriseSearch',
},
]}
activeNavItemId={activeNavItemId}
homeHref="/app/enterprise_search/content/setup_guide"
linkToCloud="projects"
/>
</NavigationKibanaProvider>
);
};
4 changes: 3 additions & 1 deletion x-pack/plugins/serverless_search/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

import { CoreSetup, CoreStart, Plugin } from '@kbn/core/public';
import { createServerlessSearchSideNavComponent as createComponent } from './layout/nav';
import {
ServerlessSearchPluginSetup,
ServerlessSearchPluginSetupDependencies,
Expand All @@ -24,9 +25,10 @@ export class ServerlessSearchPlugin
}

public start(
_core: CoreStart,
core: CoreStart,
_startDeps: ServerlessSearchPluginStartDependencies
): ServerlessSearchPluginStart {
core.chrome.project.setSideNavComponent(createComponent(core));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See: #156600 (comment)

I think we should bring it back

return {};
}

Expand Down
3 changes: 0 additions & 3 deletions x-pack/plugins/serverless_search/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* 2.0.
*/

import { ServerlessPluginSetup, ServerlessPluginStart } from '@kbn/serverless/public';
import { ManagementSetup, ManagementStart } from '@kbn/management-plugin/public';
import {
EnterpriseSearchPublicSetup,
Expand All @@ -21,11 +20,9 @@ export interface ServerlessSearchPluginStart {}
export interface ServerlessSearchPluginSetupDependencies {
enterpriseSearch: EnterpriseSearchPublicSetup;
management: ManagementSetup;
serverless: ServerlessPluginSetup;
}

export interface ServerlessSearchPluginStartDependencies {
enterpriseSearch: EnterpriseSearchPublicStart;
management: ManagementStart;
serverless: ServerlessPluginStart;
}
2 changes: 1 addition & 1 deletion x-pack/plugins/serverless_search/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"@kbn/config-schema",
"@kbn/enterprise-search-plugin",
"@kbn/management-plugin",
"@kbn/serverless",
"@kbn/shared-ux-chrome-navigation",
]
}