-
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.
[serverless] Create the Serverless Plugin (#155582)
> Derived from #153274 for production. ## Summary This PR creates the `serverless` plugin for Kibana Serverless projects. ![image](https://user-images.githubusercontent.com/297604/233892935-b3713575-a2f7-4e82-a9dd-e8c11823683f.png) It uses the methodology proven out in the proof-of-concept (#153274) and prepares it for production: - Adds chrome style and related API to the `chrome` services. - Creates the `serverless` plugin. - Invokes the new chrome style API for all serverless projects. - Alters `yarn` scripts to support all project types, and switching between them. - Creates the new "Project Switcher" component for use in the new chrome header for Serverless. - Creates a Storybook config for this and future components. - Adds API endpoint to trigger project switching and `Watcher` restarts. <img width="1598" alt="Screenshot 2023-04-26 at 10 44 01 AM" src="https://user-images.githubusercontent.com/297604/234612654-fdcf38ea-8c48-4066-bc85-507f40c984aa.png"> ## Next steps - [x] Creating a PR for enabling/disabling related plugins for Serverless. (#155583) - [ ] Creating product plugin PR based on #153274. --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
5e713fb
commit 8e37b38
Showing
83 changed files
with
1,621 additions
and
56 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
Validating CODEOWNERS rules …
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
xpack.serverless.plugin.developer.projectSwitcher.currentType: 'search' |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
xpack.infra.logs.app_target: discover | ||
xpack.serverless.plugin.developer.projectSwitcher.currentType: 'observability' |
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 @@ | ||
xpack.serverless.plugin.developer.projectSwitcher.currentType: 'security' |
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
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
90 changes: 90 additions & 0 deletions
90
packages/core/chrome/core-chrome-browser-internal/src/ui/project/header.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,90 @@ | ||
/* | ||
* 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 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { Router } from 'react-router-dom'; | ||
import { EuiHeader, EuiHeaderLogo, EuiHeaderSection, EuiHeaderSectionItem } from '@elastic/eui'; | ||
import { | ||
ChromeBreadcrumb, | ||
ChromeGlobalHelpExtensionMenuLink, | ||
ChromeHelpExtension, | ||
ChromeNavControl, | ||
} from '@kbn/core-chrome-browser/src'; | ||
import { Observable } from 'rxjs'; | ||
import { MountPoint } from '@kbn/core-mount-utils-browser'; | ||
import { InternalApplicationStart } from '@kbn/core-application-browser-internal'; | ||
import { HeaderBreadcrumbs } from '../header/header_breadcrumbs'; | ||
import { HeaderActionMenu } from '../header/header_action_menu'; | ||
import { HeaderHelpMenu } from '../header/header_help_menu'; | ||
import { HeaderNavControls } from '../header/header_nav_controls'; | ||
import { ProjectNavigation } from './navigation'; | ||
|
||
interface Props { | ||
breadcrumbs$: Observable<ChromeBreadcrumb[]>; | ||
actionMenu$: Observable<MountPoint | undefined>; | ||
kibanaDocLink: string; | ||
globalHelpExtensionMenuLinks$: Observable<ChromeGlobalHelpExtensionMenuLink[]>; | ||
helpExtension$: Observable<ChromeHelpExtension | undefined>; | ||
helpSupportUrl$: Observable<string>; | ||
kibanaVersion: string; | ||
application: InternalApplicationStart; | ||
navControlsRight$: Observable<ChromeNavControl[]>; | ||
} | ||
|
||
export const ProjectHeader = ({ | ||
application, | ||
kibanaDocLink, | ||
kibanaVersion, | ||
...observables | ||
}: Props) => { | ||
const renderLogo = () => ( | ||
<EuiHeaderLogo | ||
iconType="logoElastic" | ||
href="#" | ||
onClick={(e) => e.preventDefault()} | ||
aria-label="Go to home page" | ||
/> | ||
); | ||
|
||
return ( | ||
<> | ||
<EuiHeader position="fixed"> | ||
<EuiHeaderSection grow={false}> | ||
<EuiHeaderSectionItem border="right">{renderLogo()}</EuiHeaderSectionItem> | ||
<EuiHeaderSectionItem> | ||
<HeaderBreadcrumbs breadcrumbs$={observables.breadcrumbs$} /> | ||
</EuiHeaderSectionItem> | ||
</EuiHeaderSection> | ||
<EuiHeaderSection side="right"> | ||
<EuiHeaderSectionItem> | ||
<HeaderHelpMenu | ||
globalHelpExtensionMenuLinks$={observables.globalHelpExtensionMenuLinks$} | ||
helpExtension$={observables.helpExtension$} | ||
helpSupportUrl$={observables.helpSupportUrl$} | ||
kibanaDocLink={kibanaDocLink} | ||
kibanaVersion={kibanaVersion} | ||
navigateToUrl={application.navigateToUrl} | ||
/> | ||
</EuiHeaderSectionItem> | ||
<EuiHeaderSectionItem border="left"> | ||
<HeaderActionMenu actionMenu$={observables.actionMenu$} /> | ||
</EuiHeaderSectionItem> | ||
|
||
<EuiHeaderSectionItem> | ||
<HeaderNavControls navControls$={observables.navControlsRight$} /> | ||
</EuiHeaderSectionItem> | ||
</EuiHeaderSection> | ||
</EuiHeader> | ||
<Router history={application.history}> | ||
<ProjectNavigation> | ||
<span /> | ||
</ProjectNavigation> | ||
</Router> | ||
</> | ||
); | ||
}; |
9 changes: 9 additions & 0 deletions
9
packages/core/chrome/core-chrome-browser-internal/src/ui/project/index.ts
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,9 @@ | ||
/* | ||
* 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 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
export { ProjectHeader } from './header'; |
Oops, something went wrong.