-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Uptime] Migrate client to New Platform #55086
Changes from 47 commits
84d3941
77f0186
a6caa0c
66873c1
4660e36
a9764c4
c5bd00f
e885abd
8d8e77e
a1d53d9
64bc7e4
824647c
ab9d5c9
b322a18
9565e6a
6300206
c50e949
5cd39dc
4b35b4e
d190e42
ce96694
805661f
624c0c4
1e02b8f
49f9d25
1380d69
ece7b4c
d61f1c0
f3ded76
9019d1b
55da8c0
f7c7830
1a75ae0
9a72af4
38c4553
ba164ce
d98cafb
21bdffc
484c3ed
8794013
3da60f4
1c42cc8
93e421c
159e66c
f9aee04
a792b57
365b915
d77978f
3b9dfb2
d9cd2f5
7fff70f
04ce6cc
4db4d9c
2c30f34
8fc53eb
eaa40e9
b11b4e6
e467d5a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export { UptimePlugin } from './plugin'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
import { LegacyCoreStart, AppMountParameters } from 'src/core/public'; | ||
import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from 'kibana/public'; | ||
import { UMFrontendLibs } from '../lib/lib'; | ||
import { PLUGIN } from '../../common'; | ||
import { FeatureCatalogueCategory } from '../../../../../src/plugins/home/public'; | ||
import { getKibanaFrameworkAdapter } from '../lib/adapters/framework/new_platform_adapter'; | ||
import { HomePublicPluginSetup } from '../../../../../src/plugins/home/public'; | ||
import { EmbeddableStart } from '../../../../../src/plugins/embeddable/public'; | ||
import { TriggersAndActionsUIPublicPluginSetup } from '../../../triggers_actions_ui/public'; | ||
import { DataPublicPluginSetup } from '../../../../../src/plugins/data/public'; | ||
|
||
export interface StartObject { | ||
core: LegacyCoreStart; | ||
plugins: any; | ||
} | ||
|
||
export interface ClientPluginsSetup { | ||
data: DataPublicPluginSetup; | ||
home: HomePublicPluginSetup; | ||
triggers_actions_ui: TriggersAndActionsUIPublicPluginSetup; | ||
} | ||
|
||
export interface ClientPluginsStart { | ||
embeddable: EmbeddableStart; | ||
} | ||
|
||
export class UptimePlugin implements Plugin<void, void, ClientPluginsSetup, ClientPluginsStart> { | ||
constructor(_context: PluginInitializerContext) {} | ||
|
||
public async setup( | ||
core: CoreSetup<ClientPluginsStart, unknown>, | ||
plugins: ClientPluginsSetup | ||
): Promise<void> { | ||
if (plugins.home) { | ||
plugins.home.featureCatalogue.register({ | ||
id: PLUGIN.ID, | ||
title: PLUGIN.TITLE, | ||
description: PLUGIN.DESCRIPTION, | ||
icon: 'uptimeApp', | ||
path: '/app/uptime#/', | ||
showOnHomePage: true, | ||
category: FeatureCatalogueCategory.DATA, | ||
}); | ||
} | ||
|
||
core.application.register({ | ||
appRoute: '/app/uptime#/', | ||
id: PLUGIN.ID, | ||
euiIconType: 'uptimeApp', | ||
order: 8900, | ||
title: PLUGIN.TITLE, | ||
async mount(params: AppMountParameters) { | ||
const [coreStart, corePlugins] = await core.getStartServices(); | ||
const { element } = params; | ||
const libs: UMFrontendLibs = { | ||
framework: getKibanaFrameworkAdapter(coreStart, plugins, corePlugins), | ||
}; | ||
libs.framework.render(element); | ||
return () => {}; | ||
}, | ||
}); | ||
} | ||
|
||
public start(_start: CoreStart, _plugins: {}): void {} | ||
|
||
public stop(): void {} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
import React from 'react'; | ||
import DateMath from '@elastic/datemath'; | ||
import { DurationChartComponent } from '../duration_chart'; | ||
import { MonitorDurationResult } from '../../../../../common/types'; | ||
import { MonitorDurationResult } from '../../../../../common'; | ||
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. AS much as i love short imports, but i think in this case, it make sense to keep types, runtimetype and constants separate. I fully realize this impact many files in this PR, so reverting it will be quite an effort. Let me know your thoughts about this? cc @andrewvc 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. No worries - I had thought we discussed using just 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. ahan, i must have forgotten it, for me i think keeping types and constants make more sense, but if you guys feel different, i have no objection to importing them via 'common'. 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. |
||
import { shallowWithRouter } from '../../../../lib'; | ||
|
||
describe('MonitorCharts component', () => { | ||
|
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.
We should change this default description text.
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.
This is the text that will be shown in the feature catalogue - I changed the description a bit to reflect that. LMK if you have a recommendation.