This repository has been archived by the owner on Mar 31, 2024. It is now read-only.
forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Onboarding] Create guided_onboarding plugin (elastic#138611)
* [Guided onboarding] Smashed commit of all POC work for guided onboarding and guided onboarding example plugins * [Guided onboarding] Fixed type errors * [Guided onboarding] Removed guidedOnboardingExample limit * [Guided onboarding] Fixed a functonal test for exposed configs * [Guided onboarding] Fixed plugin limit * [Guided onboarding] Added more information to the example plugin * [Guided onboarding] Fixed no-console error * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * [Guided onboarding] Fixed snake case errors * move guided_onboarding out of x-pack Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Alison Goryachev <[email protected]>
- Loading branch information
1 parent
7d6b5c6
commit 95086f4
Showing
41 changed files
with
1,666 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"prefix": "guidedOnboardingExample", | ||
"paths": { | ||
"guidedOnboardingExample": "." | ||
}, | ||
"translations": ["translations/ja-JP.json"] | ||
} |
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 @@ | ||
# guidedOnboardingExample | ||
|
||
A Kibana plugin | ||
|
||
--- | ||
|
||
## Development | ||
|
||
See the [kibana contributing guide](https://github.com/elastic/kibana/blob/main/CONTRIBUTING.md) for instructions setting up your development environment. |
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,10 @@ | ||
/* | ||
* 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 const PLUGIN_ID = 'guidedOnboardingExample'; | ||
export const PLUGIN_NAME = 'guidedOnboardingExample'; |
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,14 @@ | ||
{ | ||
"id": "guidedOnboardingExample", | ||
"version": "1.0.0", | ||
"kibanaVersion": "kibana", | ||
"owner": { | ||
"name": "platform-onboarding", | ||
"githubTeam": "platform-onboarding" | ||
}, | ||
"description": "Example plugin to consume guidedOnboarding", | ||
"server": false, | ||
"ui": true, | ||
"requiredPlugins": ["navigation", "guidedOnboarding"], | ||
"optionalPlugins": [] | ||
} |
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,30 @@ | ||
/* | ||
* 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 ReactDOM from 'react-dom'; | ||
import { AppMountParameters, CoreStart } from '@kbn/core/public'; | ||
import { AppPluginStartDependencies } from './types'; | ||
import { GuidedOnboardingExampleApp } from './components/app'; | ||
|
||
export const renderApp = ( | ||
{ notifications }: CoreStart, | ||
{ guidedOnboarding }: AppPluginStartDependencies, | ||
{ element, history }: AppMountParameters | ||
) => { | ||
ReactDOM.render( | ||
<GuidedOnboardingExampleApp | ||
notifications={notifications} | ||
guidedOnboarding={guidedOnboarding} | ||
history={history} | ||
/>, | ||
element | ||
); | ||
|
||
return () => ReactDOM.unmountComponentAtNode(element); | ||
}; |
70 changes: 70 additions & 0 deletions
70
examples/guided_onboarding_example/public/components/app.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,70 @@ | ||
/* | ||
* 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 { FormattedMessage, I18nProvider } from '@kbn/i18n-react'; | ||
import { Router, Switch, Route } from 'react-router-dom'; | ||
|
||
import { | ||
EuiPage, | ||
EuiPageBody, | ||
EuiPageContent_Deprecated as EuiPageContent, | ||
EuiPageHeader, | ||
EuiTitle, | ||
} from '@elastic/eui'; | ||
|
||
import { CoreStart, ScopedHistory } from '@kbn/core/public'; | ||
|
||
import { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/public/types'; | ||
import { StepTwo } from './step_two'; | ||
import { StepOne } from './step_one'; | ||
import { Main } from './main'; | ||
|
||
interface GuidedOnboardingExampleAppDeps { | ||
notifications: CoreStart['notifications']; | ||
guidedOnboarding: GuidedOnboardingPluginStart; | ||
history: ScopedHistory; | ||
} | ||
|
||
export const GuidedOnboardingExampleApp = (props: GuidedOnboardingExampleAppDeps) => { | ||
const { notifications, guidedOnboarding, history } = props; | ||
|
||
return ( | ||
<I18nProvider> | ||
<EuiPage restrictWidth="1000px"> | ||
<EuiPageBody> | ||
<EuiPageHeader> | ||
<EuiTitle size="l"> | ||
<h1> | ||
<FormattedMessage | ||
id="guidedOnboardingExample.title" | ||
defaultMessage="Guided onboarding examples" | ||
/> | ||
</h1> | ||
</EuiTitle> | ||
</EuiPageHeader> | ||
<EuiPageContent> | ||
<Router history={history}> | ||
<Switch> | ||
<Route exact path="/"> | ||
<Main notifications={notifications} guidedOnboarding={guidedOnboarding} /> | ||
</Route> | ||
<Route exact path="/stepOne"> | ||
<StepOne guidedOnboarding={guidedOnboarding} /> | ||
</Route> | ||
<Route exact path="/stepTwo"> | ||
<StepTwo guidedOnboarding={guidedOnboarding} /> | ||
</Route> | ||
</Switch> | ||
</Router> | ||
</EuiPageContent> | ||
</EuiPageBody> | ||
</EuiPage> | ||
</I18nProvider> | ||
); | ||
}; |
Oops, something went wrong.