forked from opensearch-project/dashboards-flow-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin.ts
56 lines (52 loc) · 1.49 KB
/
plugin.ts
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
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import {
AppMountParameters,
CoreSetup,
CoreStart,
Plugin,
} from '../../../src/core/public';
import {
FlowFrameworkDashboardsPluginSetup,
FlowFrameworkDashboardsPluginStart,
} from './types';
import { PLUGIN_ID } from '../common';
import { setCore, setRouteService } from './services';
import { configureRoutes } from './route_service';
export class FlowFrameworkDashboardsPlugin
implements
Plugin<
FlowFrameworkDashboardsPluginSetup,
FlowFrameworkDashboardsPluginStart
> {
public setup(core: CoreSetup): FlowFrameworkDashboardsPluginSetup {
// Register the plugin in the side navigation
core.application.register({
id: PLUGIN_ID,
title: 'Flow Framework',
category: {
id: 'opensearch',
label: 'OpenSearch plugins',
// TODO: this may change after plugin position is finalized
order: 2000,
},
// TODO: can i remove this below order
order: 5000,
async mount(params: AppMountParameters) {
const { renderApp } = await import('./render_app');
const [coreStart] = await core.getStartServices();
const routeServices = configureRoutes(coreStart);
setCore(coreStart);
setRouteService(routeServices);
return renderApp(coreStart, params);
},
});
return {};
}
public start(core: CoreStart): FlowFrameworkDashboardsPluginStart {
return {};
}
public stop() {}
}