-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
2 changed files
with
55 additions
and
38 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
x-pack/plugins/transform/public/app/mount_management_section.ts
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,52 @@ | ||
/* | ||
* 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 { CoreSetup } from 'src/core/public'; | ||
import { ManagementAppMountParams } from '../../../../../src/plugins/management/public/'; | ||
import { Storage } from '../../../../../src/plugins/kibana_utils/public'; | ||
|
||
import { PluginsDependencies } from '../plugin'; | ||
|
||
import { AppDependencies } from './app_dependencies'; | ||
import { breadcrumbService } from './services/navigation'; | ||
import { docTitleService } from './services/navigation'; | ||
import { textService } from './services/text'; | ||
import { renderApp } from './app'; | ||
|
||
const localStorage = new Storage(window.localStorage); | ||
|
||
export async function mountManagementSection( | ||
coreSetup: CoreSetup<PluginsDependencies>, | ||
params: ManagementAppMountParams | ||
) { | ||
const { element, setBreadcrumbs } = params; | ||
const { http, notifications, getStartServices } = coreSetup; | ||
const startServices = await getStartServices(); | ||
const [core, plugins] = startServices; | ||
const { chrome, docLinks, i18n, overlays, savedObjects, uiSettings } = core; | ||
const { data } = plugins; | ||
const { docTitle } = chrome; | ||
|
||
// Initialize services | ||
textService.init(); | ||
docTitleService.init(docTitle.change); | ||
breadcrumbService.setup(setBreadcrumbs); | ||
|
||
// AppCore/AppPlugins to be passed on as React context | ||
const appDependencies: AppDependencies = { | ||
chrome, | ||
data, | ||
docLinks, | ||
http, | ||
i18n, | ||
notifications, | ||
overlays, | ||
savedObjects, | ||
storage: localStorage, | ||
uiSettings, | ||
}; | ||
|
||
return renderApp(element, appDependencies); | ||
} |
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