forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugin.tsx
62 lines (55 loc) · 2.06 KB
/
plugin.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* 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 { SharePluginSetup, SharePluginStart } from '@kbn/share-plugin/public';
import { Plugin, CoreSetup, AppMountParameters, AppNavLinkStatus } from '@kbn/core/public';
import { DeveloperExamplesSetup } from '@kbn/developer-examples-plugin/public';
interface SetupDeps {
developerExamples: DeveloperExamplesSetup;
share: SharePluginSetup;
}
interface StartDeps {
share: SharePluginStart;
}
export class LocatorExplorerPlugin implements Plugin<void, void, SetupDeps, StartDeps> {
public setup(core: CoreSetup<StartDeps>, { developerExamples, share }: SetupDeps) {
core.application.register({
id: 'locatorExplorer',
title: 'Locator explorer',
navLinkStatus: AppNavLinkStatus.hidden,
async mount(params: AppMountParameters) {
const { renderApp } = await import('./app');
return renderApp(
{
share,
},
params
);
},
});
developerExamples.register({
title: 'URL locators',
description: `Locators offer are a backward compatible safe way to persist a URL in a saved object.
Store the locator ID and params, instead of the href string. When the link is recreated at run time, the service
will run the state through any necessary migrations. Registrators can change their URL structure
without breaking these links stored in saved objects.
`,
appId: 'locatorExplorer',
links: [
{
label: 'README',
href: 'https://github.com/elastic/kibana/blob/main/src/plugins/share/common/url_service/locators/README.md',
iconType: 'logoGithub',
size: 's',
target: '_blank',
},
],
});
}
public start() {}
public stop() {}
}