mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[Platform Onboarding] Elastic cloud migration assistant page (#145523)
This commit is contained in:
parent
f04b03ecd7
commit
e868b3aa77
29 changed files with 680 additions and 17 deletions
|
@ -440,6 +440,10 @@ The plugin exposes the static DefaultEditorController class to consume.
|
|||
|Integrates with DriftChat in order to provide live support to our Elastic Cloud users. This plugin should only run on Elastic Cloud.
|
||||
|
||||
|
||||
|{kib-repo}blob/{branch}/x-pack/plugins/cloud_integrations/cloud_data_migration/README.md[cloudDataMigration]
|
||||
|Static migration page where self-managed users can see text/copy about migrating to Elastic Cloud
|
||||
|
||||
|
||||
|{kib-repo}blob/{branch}/x-pack/plugins/cloud_integrations/cloud_experiments/README.mdx[cloudExperiments]
|
||||
|The Cloud Experiments Service provides the necessary APIs to implement A/B testing scenarios, fetching the variations in configuration and reporting back metrics to track conversion rates of the experiments.
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ pageLoadAssetSize:
|
|||
charts: 55000
|
||||
cloud: 21076
|
||||
cloudChat: 19894
|
||||
cloudDataMigration: 19170
|
||||
cloudExperiments: 59358
|
||||
cloudFullStory: 18493
|
||||
cloudGainsight: 18710
|
||||
|
|
|
@ -103,11 +103,61 @@ exports[`AddData render 1`] = `
|
|||
</EuiFlexGroup>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
<EuiImage
|
||||
alt="Illustration of Elastic data integrations"
|
||||
className="homDataAdd__illustration"
|
||||
src="/plugins/kibanaReact/assets/illustration_integrations_lightmode.svg"
|
||||
/>
|
||||
<EuiPanel
|
||||
paddingSize="l"
|
||||
>
|
||||
<EuiFlexGroup
|
||||
alignItems="center"
|
||||
gutterSize="xl"
|
||||
>
|
||||
<EuiFlexItem>
|
||||
<EuiImage
|
||||
alt="Illustration for cloud data migration"
|
||||
src="/plugins/kibanaReact/assets/illustration_cloud_migration.png"
|
||||
/>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
<EuiTitle
|
||||
size="xs"
|
||||
>
|
||||
<h4>
|
||||
<FormattedMessage
|
||||
defaultMessage="Considering Elastic Cloud?"
|
||||
id="home.addData.moveYourDataTitle"
|
||||
values={Object {}}
|
||||
/>
|
||||
</h4>
|
||||
</EuiTitle>
|
||||
<EuiSpacer
|
||||
size="s"
|
||||
/>
|
||||
<EuiText
|
||||
size="s"
|
||||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Moving your data to Elastic Cloud is easy and can save you time and money."
|
||||
id="home.addData.moveYourDataToElasticCloud"
|
||||
values={Object {}}
|
||||
/>
|
||||
</EuiText>
|
||||
<EuiSpacer
|
||||
size="m"
|
||||
/>
|
||||
<EuiButton
|
||||
color="primary"
|
||||
href="/app/management/data/migrate_data"
|
||||
onClick={[Function]}
|
||||
size="m"
|
||||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Explore the benefits"
|
||||
id="home.addData.moveYourDataButtonLabel"
|
||||
values={Object {}}
|
||||
/>
|
||||
</EuiButton>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</EuiPanel>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</_EuiPageSection>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import React, { FC, MouseEvent } from 'react';
|
||||
import {
|
||||
EuiButton,
|
||||
|
@ -13,6 +14,7 @@ import {
|
|||
EuiFlexGroup,
|
||||
EuiFlexItem,
|
||||
EuiImage,
|
||||
EuiPanel,
|
||||
EuiSpacer,
|
||||
EuiText,
|
||||
EuiTitle,
|
||||
|
@ -138,18 +140,76 @@ export const AddData: FC<Props> = ({ addBasePath, application, isDarkMode, isClo
|
|||
</EuiFlexGroup>
|
||||
</EuiFlexItem>
|
||||
|
||||
<EuiFlexItem>
|
||||
<EuiImage
|
||||
alt="Illustration of Elastic data integrations"
|
||||
className="homDataAdd__illustration"
|
||||
src={
|
||||
addBasePath('/plugins/kibanaReact/assets/') +
|
||||
(isDarkMode
|
||||
? 'illustration_integrations_darkmode.svg'
|
||||
: 'illustration_integrations_lightmode.svg')
|
||||
}
|
||||
/>
|
||||
</EuiFlexItem>
|
||||
{!isCloudEnabled ? (
|
||||
<EuiFlexItem>
|
||||
<EuiPanel paddingSize="l">
|
||||
<EuiFlexGroup alignItems="center" gutterSize="xl">
|
||||
<EuiFlexItem>
|
||||
<EuiImage
|
||||
alt={i18n.translate('home.moveData.illustration.alt.text', {
|
||||
defaultMessage: 'Illustration for cloud data migration',
|
||||
})}
|
||||
src={
|
||||
addBasePath('/plugins/kibanaReact/assets/') +
|
||||
'illustration_cloud_migration.png'
|
||||
}
|
||||
/>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
<EuiTitle size="xs">
|
||||
<h4>
|
||||
<FormattedMessage
|
||||
id="home.addData.moveYourDataTitle"
|
||||
defaultMessage="Considering Elastic Cloud?"
|
||||
/>
|
||||
</h4>
|
||||
</EuiTitle>
|
||||
|
||||
<EuiSpacer size="s" />
|
||||
|
||||
<EuiText size="s">
|
||||
<FormattedMessage
|
||||
id="home.addData.moveYourDataToElasticCloud"
|
||||
defaultMessage="Moving your data to Elastic Cloud is easy and can save you time and money."
|
||||
/>
|
||||
</EuiText>
|
||||
|
||||
<EuiSpacer size="m" />
|
||||
|
||||
{/* eslint-disable-next-line @elastic/eui/href-or-on-click */}
|
||||
<EuiButton
|
||||
color="primary"
|
||||
href={addBasePath('/app/management/data/migrate_data')}
|
||||
onClick={(event: MouseEvent) => {
|
||||
trackUiMetric(METRIC_TYPE.CLICK, 'migrate_data_to_cloud');
|
||||
createAppNavigationHandler('/app/management/data/migrate_data')(event);
|
||||
}}
|
||||
>
|
||||
<FormattedMessage
|
||||
id="home.addData.moveYourDataButtonLabel"
|
||||
defaultMessage="Explore the benefits"
|
||||
/>
|
||||
</EuiButton>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</EuiPanel>
|
||||
</EuiFlexItem>
|
||||
) : (
|
||||
<EuiFlexItem>
|
||||
<EuiImage
|
||||
alt={i18n.translate('home.addData.illustration.alt.text', {
|
||||
defaultMessage: 'Illustration of Elastic data integrations',
|
||||
})}
|
||||
className="homDataAdd__illustration"
|
||||
src={
|
||||
addBasePath('/plugins/kibanaReact/assets/') +
|
||||
(isDarkMode
|
||||
? 'illustration_integrations_darkmode.svg'
|
||||
: 'illustration_integrations_lightmode.svg')
|
||||
}
|
||||
/>
|
||||
</EuiFlexItem>
|
||||
)}
|
||||
</EuiFlexGroup>
|
||||
</KibanaPageTemplate.Section>
|
||||
);
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 108 KiB |
|
@ -1070,6 +1070,8 @@
|
|||
"@kbn/cases-plugin/*": ["x-pack/plugins/cases/*"],
|
||||
"@kbn/cloud-chat-plugin": ["x-pack/plugins/cloud_integrations/cloud_chat"],
|
||||
"@kbn/cloud-chat-plugin/*": ["x-pack/plugins/cloud_integrations/cloud_chat/*"],
|
||||
"@kbn/cloud-data-migration-plugin": ["x-pack/plugins/cloud_integrations/cloud_data_migration"],
|
||||
"@kbn/cloud-data-migration-plugin/*": ["x-pack/plugins/cloud_integrations/cloud_data_migration/*"],
|
||||
"@kbn/cloud-experiments-plugin": ["x-pack/plugins/cloud_integrations/cloud_experiments"],
|
||||
"@kbn/cloud-experiments-plugin/*": ["x-pack/plugins/cloud_integrations/cloud_experiments/*"],
|
||||
"@kbn/cloud-full-story-plugin": ["x-pack/plugins/cloud_integrations/cloud_full_story"],
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
"xpack.cloud": "plugins/cloud",
|
||||
"xpack.cloudChat": "plugins/cloud_integrations/cloud_chat",
|
||||
"xpack.cloudLinks": "plugins/cloud_integrations/cloud_links",
|
||||
"xpack.cloudDataMigration": "plugins/cloud_integrations/cloud_data_migration",
|
||||
"xpack.csp": "plugins/cloud_security_posture",
|
||||
"xpack.customBranding": "plugins/custom_branding",
|
||||
"xpack.dashboard": "plugins/dashboard_enhanced",
|
||||
|
|
3
x-pack/plugins/cloud_integrations/cloud_data_migration/README.md
Executable file
3
x-pack/plugins/cloud_integrations/cloud_data_migration/README.md
Executable file
|
@ -0,0 +1,3 @@
|
|||
# Cloud Data Migration
|
||||
|
||||
Static migration page where self-managed users can see text/copy about migrating to Elastic Cloud
|
13
x-pack/plugins/cloud_integrations/cloud_data_migration/common/index.ts
Executable file
13
x-pack/plugins/cloud_integrations/cloud_data_migration/common/index.ts
Executable file
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
* 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 { i18n } from '@kbn/i18n';
|
||||
|
||||
export const PLUGIN_ID = 'migrate_data';
|
||||
export const PLUGIN_NAME = i18n.translate('xpack.cloudDataMigration.name', {
|
||||
defaultMessage: 'Migrate',
|
||||
});
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"prefix": "cloudDataMigration",
|
||||
"paths": {
|
||||
"cloudDataMigration": "."
|
||||
},
|
||||
"translations": []
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
preset: '@kbn/test',
|
||||
rootDir: '../../../../',
|
||||
roots: ['<rootDir>/x-pack/plugins/cloud_integrations/cloud_data_migration'],
|
||||
coverageDirectory:
|
||||
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/cloud_integrations/cloud_data_migration',
|
||||
coverageReporters: ['text', 'html'],
|
||||
collectCoverageFrom: [
|
||||
'<rootDir>/x-pack/plugins/cloud_integrations/cloud_data_migration/{common,public}/**/*.{ts,tsx}',
|
||||
],
|
||||
};
|
15
x-pack/plugins/cloud_integrations/cloud_data_migration/kibana.json
Executable file
15
x-pack/plugins/cloud_integrations/cloud_data_migration/kibana.json
Executable file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"id": "cloudDataMigration",
|
||||
"version": "1.0.0",
|
||||
"kibanaVersion": "kibana",
|
||||
"owner": {
|
||||
"name": "Platform Onboarding",
|
||||
"githubTeam": "platform-onboarding"
|
||||
},
|
||||
"description": "Static migration page where self-managed users can see text/copy about migrating to Elastic Cloud",
|
||||
"server": true,
|
||||
"ui": true,
|
||||
"configPath": ["xpack", "cloud_integrations", "data_migration"],
|
||||
"requiredPlugins": ["cloud", "management", "kibanaReact", "features"],
|
||||
"requiredBundles": [ "kibanaReact" ]
|
||||
}
|
|
@ -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; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { css } from '@emotion/react';
|
||||
import { EuiThemeComputed } from '@elastic/eui';
|
||||
|
||||
export const getAppStyles = (euiTheme: EuiThemeComputed) => {
|
||||
return {
|
||||
listItemCss: css`
|
||||
font-weight: ${euiTheme.font.weight.light};
|
||||
`,
|
||||
panelCss: css`
|
||||
padding: calc(${euiTheme.size.xxxl});
|
||||
margin: ${euiTheme.size.l} auto;
|
||||
width: 100%;
|
||||
max-width: 875px;
|
||||
`,
|
||||
illustrationCss: css`
|
||||
max-width: 75%;
|
||||
`,
|
||||
layoutCss: css`
|
||||
max-width: 500px;
|
||||
margin: 0 auto;
|
||||
`,
|
||||
};
|
||||
};
|
|
@ -0,0 +1,146 @@
|
|||
/*
|
||||
* 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 { i18n } from '@kbn/i18n';
|
||||
import React, { useEffect } from 'react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
||||
import {
|
||||
EuiButton,
|
||||
EuiFlexGroup,
|
||||
EuiFlexItem,
|
||||
EuiImage,
|
||||
EuiListGroup,
|
||||
EuiListGroupItem,
|
||||
EuiPanel,
|
||||
EuiSpacer,
|
||||
EuiText,
|
||||
EuiTitle,
|
||||
useEuiTheme,
|
||||
} from '@elastic/eui';
|
||||
|
||||
import { CoreStart, CoreTheme } from '@kbn/core/public';
|
||||
|
||||
import { Observable } from 'rxjs';
|
||||
import { getAppStyles } from '../../app.styles';
|
||||
import { BreadcrumbService } from '../services/breadcrumbs';
|
||||
|
||||
interface CloudDataMigrationAppDeps {
|
||||
http: CoreStart['http'];
|
||||
breadcrumbService: BreadcrumbService;
|
||||
theme$: Observable<CoreTheme>;
|
||||
}
|
||||
|
||||
export const CloudDataMigrationApp = ({ http, breadcrumbService }: CloudDataMigrationAppDeps) => {
|
||||
const basePath = http.basePath.get() ?? '';
|
||||
const { euiTheme } = useEuiTheme();
|
||||
const listItemProps = {
|
||||
iconType: 'checkInCircleFilled',
|
||||
iconProps: { color: 'success' },
|
||||
wrapText: true,
|
||||
};
|
||||
const styles = getAppStyles(euiTheme);
|
||||
|
||||
useEffect(() => {
|
||||
breadcrumbService.setBreadcrumbs('home');
|
||||
}, [breadcrumbService]);
|
||||
|
||||
return (
|
||||
<EuiPanel css={styles.panelCss} color="subdued">
|
||||
<EuiFlexGroup
|
||||
direction="column"
|
||||
alignItems="center"
|
||||
gutterSize="xl"
|
||||
justifyContent="spaceBetween"
|
||||
css={styles.layoutCss}
|
||||
>
|
||||
<EuiFlexItem>
|
||||
<EuiImage
|
||||
alt={i18n.translate('xpack.cloudDataMigration.illustration.alt.text', {
|
||||
defaultMessage: 'Illustration for cloud data migration',
|
||||
})}
|
||||
css={styles.illustrationCss}
|
||||
src={`${basePath}/plugins/kibanaReact/assets/` + 'illustration_cloud_migration.png'}
|
||||
/>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
<EuiTitle size="s">
|
||||
<h1>
|
||||
<FormattedMessage
|
||||
id="xpack.cloudDataMigration.migrateToCloudTitle"
|
||||
defaultMessage="Elastic Cloud helps your data work harder."
|
||||
/>
|
||||
</h1>
|
||||
</EuiTitle>
|
||||
|
||||
<EuiSpacer size="xl" />
|
||||
|
||||
<EuiListGroup maxWidth={700}>
|
||||
<EuiListGroupItem
|
||||
{...listItemProps}
|
||||
label={
|
||||
<EuiText css={styles.listItemCss} size="s" color="subdued">
|
||||
<FormattedMessage
|
||||
id="xpack.cloudDataMigration.deployInSeconds.text"
|
||||
defaultMessage="Deploy Elastic quickly and scale up to petabytes of data with a click."
|
||||
/>
|
||||
</EuiText>
|
||||
}
|
||||
/>
|
||||
|
||||
<EuiListGroupItem
|
||||
{...listItemProps}
|
||||
label={
|
||||
<EuiText css={styles.listItemCss} size="s" color="subdued">
|
||||
<FormattedMessage
|
||||
id="xpack.cloudDataMigration.freeUpEngineering.text"
|
||||
defaultMessage="Streamline your Elastic workflow and free up your team. Manage multiple deployments from a single view and centralize your monitoring data."
|
||||
/>
|
||||
</EuiText>
|
||||
}
|
||||
/>
|
||||
|
||||
<EuiListGroupItem
|
||||
{...listItemProps}
|
||||
label={
|
||||
<EuiText css={styles.listItemCss} size="s" color="subdued">
|
||||
<FormattedMessage
|
||||
id="xpack.cloudDataMigration.getHelpFromCreators.text"
|
||||
defaultMessage="Get support from the creators of Elastic to help you ingest all sorts of data and tune your performance."
|
||||
/>
|
||||
</EuiText>
|
||||
}
|
||||
/>
|
||||
|
||||
<EuiListGroupItem
|
||||
{...listItemProps}
|
||||
label={
|
||||
<EuiText css={styles.listItemCss} size="s" color="subdued">
|
||||
<FormattedMessage
|
||||
id="xpack.cloudDataMigration.getInstantAccess.text"
|
||||
defaultMessage="Access the latest version of Elastic with features you want, like anomaly detection, searchable snapshots, advanced security, and so much more."
|
||||
/>
|
||||
</EuiText>
|
||||
}
|
||||
/>
|
||||
</EuiListGroup>
|
||||
|
||||
<EuiSpacer size="l" />
|
||||
|
||||
<div>
|
||||
<EuiButton fill={true} target="_blank" href="https://ela.st/cloud-migration">
|
||||
<FormattedMessage
|
||||
id="xpack.cloudDataMigration.readInstructionsButtonLabel"
|
||||
defaultMessage="Help me move"
|
||||
/>
|
||||
</EuiButton>
|
||||
</div>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</EuiPanel>
|
||||
);
|
||||
};
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* 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 React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { CoreStart } from '@kbn/core/public';
|
||||
import { ManagementAppMountParams } from '@kbn/management-plugin/public';
|
||||
import { KibanaContextProvider, KibanaThemeProvider } from '@kbn/kibana-react-plugin/public';
|
||||
import { BreadcrumbService } from './services/breadcrumbs';
|
||||
import { CloudDataMigrationApp } from './components/app';
|
||||
|
||||
export const renderApp = (
|
||||
{ http }: CoreStart,
|
||||
breadcrumbService: BreadcrumbService,
|
||||
{ element, theme$ }: ManagementAppMountParams
|
||||
) => {
|
||||
ReactDOM.render(
|
||||
<KibanaThemeProvider theme$={theme$}>
|
||||
<KibanaContextProvider
|
||||
services={{
|
||||
breadcrumbService,
|
||||
}}
|
||||
>
|
||||
<CloudDataMigrationApp http={http} theme$={theme$} breadcrumbService={breadcrumbService} />
|
||||
</KibanaContextProvider>
|
||||
</KibanaThemeProvider>,
|
||||
element
|
||||
);
|
||||
|
||||
return () => ReactDOM.unmountComponentAtNode(element);
|
||||
};
|
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* 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 { BreadcrumbService } from './breadcrumbs';
|
||||
|
||||
export const createBreadcrumbsMock = () => {
|
||||
const breadcrumbService = new BreadcrumbService();
|
||||
breadcrumbService.setup(jest.fn());
|
||||
return breadcrumbService;
|
||||
};
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* 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 { i18n } from '@kbn/i18n';
|
||||
import { ManagementAppMountParams } from '@kbn/management-plugin/public';
|
||||
|
||||
type SetBreadcrumbs = ManagementAppMountParams['setBreadcrumbs'];
|
||||
|
||||
interface Breadcrumb {
|
||||
text: string;
|
||||
href?: string;
|
||||
}
|
||||
|
||||
interface Breadcrumbs {
|
||||
home: Breadcrumb;
|
||||
}
|
||||
|
||||
const breadcrumbs: Breadcrumbs = {
|
||||
home: {
|
||||
text: i18n.translate('xpack.cloudDataMigration.breadcrumb.label', {
|
||||
defaultMessage: 'Migrate to Elastic Cloud',
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
export class BreadcrumbService {
|
||||
private setBreadcrumbsHandler?: SetBreadcrumbs;
|
||||
|
||||
public setup(setBreadcrumbsHandler: SetBreadcrumbs): void {
|
||||
this.setBreadcrumbsHandler = setBreadcrumbsHandler;
|
||||
}
|
||||
|
||||
public setBreadcrumbs(type: keyof typeof breadcrumbs): void {
|
||||
if (!this.setBreadcrumbsHandler) {
|
||||
throw new Error(`BreadcrumbService#setup() must be called first!`);
|
||||
}
|
||||
|
||||
this.setBreadcrumbsHandler([breadcrumbs.home]);
|
||||
}
|
||||
}
|
16
x-pack/plugins/cloud_integrations/cloud_data_migration/public/index.ts
Executable file
16
x-pack/plugins/cloud_integrations/cloud_data_migration/public/index.ts
Executable file
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* 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 { CloudDataMigrationPlugin } from './plugin';
|
||||
|
||||
// This exports static code and TypeScript types,
|
||||
// as well as, Kibana Platform `plugin()` initializer.
|
||||
export function plugin() {
|
||||
return new CloudDataMigrationPlugin();
|
||||
}
|
||||
|
||||
export type { CloudDataMigrationPluginSetup, CloudDataMigrationPluginStart } from './types';
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* 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 { coreMock } from '@kbn/core/public/mocks';
|
||||
import { CloudDataMigrationPlugin } from './plugin';
|
||||
import { cloudMock } from '@kbn/cloud-plugin/public/mocks';
|
||||
import { managementPluginMock } from '@kbn/management-plugin/public/mocks';
|
||||
import { createBreadcrumbsMock } from './application/services/breadcrumb.mock';
|
||||
|
||||
describe('Cloud Data Migration Plugin', () => {
|
||||
describe('#setup', () => {
|
||||
it('returns expected public contract', () => {
|
||||
const coreSetup = coreMock.createSetup();
|
||||
const plugin = new CloudDataMigrationPlugin();
|
||||
const cloud = cloudMock.createSetup();
|
||||
const management = managementPluginMock.createSetupContract();
|
||||
const breadcrumbService = createBreadcrumbsMock();
|
||||
expect(
|
||||
plugin.setup(coreSetup, {
|
||||
cloud,
|
||||
management,
|
||||
breadcrumbService,
|
||||
})
|
||||
).toMatchInlineSnapshot(`undefined`);
|
||||
expect(management.sections.section.data.registerApp).not.toBeCalled();
|
||||
});
|
||||
|
||||
it('returns expected public contract when cloud NOT enabled', () => {
|
||||
const coreSetup = coreMock.createSetup();
|
||||
const plugin = new CloudDataMigrationPlugin();
|
||||
const management = managementPluginMock.createSetupContract();
|
||||
const breadcrumbService = createBreadcrumbsMock();
|
||||
expect(
|
||||
plugin.setup(coreSetup, {
|
||||
cloud: { ...cloudMock.createSetup(), isCloudEnabled: false },
|
||||
management,
|
||||
breadcrumbService,
|
||||
})
|
||||
).toMatchInlineSnapshot(`undefined`);
|
||||
expect(management.sections.section.data.registerApp).toHaveBeenCalledTimes(1);
|
||||
expect(management.sections.section.data.registerApp).toHaveBeenCalledWith({
|
||||
id: 'migrate_data',
|
||||
mount: expect.any(Function),
|
||||
order: 8,
|
||||
title: 'Migrate',
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
49
x-pack/plugins/cloud_integrations/cloud_data_migration/public/plugin.ts
Executable file
49
x-pack/plugins/cloud_integrations/cloud_data_migration/public/plugin.ts
Executable file
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* 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 { CoreSetup, CoreStart, Plugin } from '@kbn/core/public';
|
||||
import { ManagementAppMountParams } from '@kbn/management-plugin/public';
|
||||
import { CloudDataMigrationPluginSetup, CloudDataMigrationPluginStart } from './types';
|
||||
import { PLUGIN_ID, PLUGIN_NAME } from '../common';
|
||||
import { BreadcrumbService } from './application/services/breadcrumbs';
|
||||
|
||||
export class CloudDataMigrationPlugin implements Plugin<void, CloudDataMigrationPluginStart> {
|
||||
private breadcrumbService = new BreadcrumbService();
|
||||
|
||||
public setup(core: CoreSetup, { cloud, management }: CloudDataMigrationPluginSetup) {
|
||||
// Only be applies to self-managed instances of Kibana. Any Kibana instance running on
|
||||
// Elastic Cloud should not show any information related to migration.
|
||||
if (!cloud.isCloudEnabled) {
|
||||
management.sections.section.data.registerApp({
|
||||
id: PLUGIN_ID,
|
||||
title: PLUGIN_NAME,
|
||||
order: 8,
|
||||
mount: async (params: ManagementAppMountParams) => {
|
||||
const [coreStart] = await core.getStartServices();
|
||||
const { setBreadcrumbs } = params;
|
||||
|
||||
// Initialize services
|
||||
this.breadcrumbService.setup(setBreadcrumbs);
|
||||
|
||||
const { renderApp } = await import('./application');
|
||||
// Render the application
|
||||
const unmountAppCallback = renderApp(coreStart, this.breadcrumbService, params);
|
||||
|
||||
return () => {
|
||||
unmountAppCallback();
|
||||
};
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public start(core: CoreStart): CloudDataMigrationPluginStart {
|
||||
return {};
|
||||
}
|
||||
|
||||
public stop() {}
|
||||
}
|
20
x-pack/plugins/cloud_integrations/cloud_data_migration/public/types.ts
Executable file
20
x-pack/plugins/cloud_integrations/cloud_data_migration/public/types.ts
Executable file
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* 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 { ManagementSetup } from '@kbn/management-plugin/public';
|
||||
|
||||
import { CloudSetup } from '@kbn/cloud-plugin/public';
|
||||
import { BreadcrumbService } from './application/services/breadcrumbs';
|
||||
|
||||
export interface CloudDataMigrationPluginSetup {
|
||||
cloud: CloudSetup;
|
||||
management: ManagementSetup;
|
||||
breadcrumbService: BreadcrumbService;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||
export interface CloudDataMigrationPluginStart {}
|
|
@ -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; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { CloudDataMigrationPlugin } from './plugin';
|
||||
|
||||
export const plugin = () => new CloudDataMigrationPlugin();
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* 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 { CoreSetup, Plugin } from '@kbn/core/server';
|
||||
import { PLUGIN_ID } from '../common';
|
||||
|
||||
import { Dependencies } from './types';
|
||||
|
||||
export class CloudDataMigrationPlugin implements Plugin<void, void, any, any> {
|
||||
public setup(coreSetup: CoreSetup, { features }: Dependencies) {
|
||||
features.registerElasticsearchFeature({
|
||||
id: PLUGIN_ID,
|
||||
management: {
|
||||
data: [PLUGIN_ID],
|
||||
},
|
||||
catalogue: [PLUGIN_ID],
|
||||
privileges: [
|
||||
{
|
||||
requiredClusterPrivileges: ['manage'],
|
||||
ui: [],
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
public start() {}
|
||||
|
||||
public stop() {}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* 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 { PluginSetupContract as FeaturesPluginSetup } from '@kbn/features-plugin/server';
|
||||
|
||||
export interface Dependencies {
|
||||
features: FeaturesPluginSetup;
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"extends": "../../../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./target/types",
|
||||
"emitDeclarationOnly": true,
|
||||
"declaration": true
|
||||
},
|
||||
"include": [
|
||||
"common/**/*",
|
||||
"public/**/*",
|
||||
"server/**/*",
|
||||
"../../../../typings/**/*"
|
||||
],
|
||||
"kbn_references": [
|
||||
{ "path": "../../../../src/core/tsconfig.json" },
|
||||
// required plugins
|
||||
{ "path": "../../cloud/tsconfig.json" },
|
||||
{ "path": "../../../../src/plugins/management/tsconfig.json" },
|
||||
{ "path": "../../features/tsconfig.json" },
|
||||
// required bundles
|
||||
{ "path": "../../../../src/plugins/kibana_react/tsconfig.json" },
|
||||
]
|
||||
}
|
|
@ -71,6 +71,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
'transform',
|
||||
'cross_cluster_replication',
|
||||
'remote_clusters',
|
||||
'migrate_data',
|
||||
],
|
||||
});
|
||||
});
|
||||
|
|
|
@ -70,6 +70,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
'rollup_jobs',
|
||||
'transform',
|
||||
'remote_clusters',
|
||||
'migrate_data',
|
||||
],
|
||||
});
|
||||
});
|
||||
|
|
|
@ -18,6 +18,7 @@ export default function catalogueTests({ getService }: FtrProviderContext) {
|
|||
const esFeatureExceptions = [
|
||||
'security',
|
||||
'index_lifecycle_management',
|
||||
'migrate_data',
|
||||
'snapshot_restore',
|
||||
'rollup_jobs',
|
||||
'reporting',
|
||||
|
|
|
@ -18,6 +18,7 @@ export default function catalogueTests({ getService }: FtrProviderContext) {
|
|||
const esFeatureExceptions = [
|
||||
'security',
|
||||
'index_lifecycle_management',
|
||||
'migrate_data',
|
||||
'snapshot_restore',
|
||||
'rollup_jobs',
|
||||
'reporting',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue