-
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
* Remove depdency on legacy interface. * Remove custom interface, use common breadcrumb type. * Add HTML template for app react entry point. * Update app props. * Add constant for react app entry point. * Remove dependency on legacy capabilities provider. * Delete legacy kibana framework adapter. * Add New Platform adapter, reference in startup code. * Remove dependency on legacy capabilities function. * Delete reference to obsolete interface. * Fix busted types in new adapter. * Add new plugin class, delete old bootstrap code. * Provide default for potentially-undefined value. * Delete obsolete file. * Update plugin constructor and start interfaces. * Add @ts-ignore for unused constructor parameter. * Import autocomplete provider from new platform.
- Loading branch information
1 parent
fa2d0c7
commit fa16d78
Showing
16 changed files
with
190 additions
and
214 deletions.
There are no files selected for viewing
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
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
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
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,58 @@ | ||
/* | ||
* 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, PluginInitializerContext } from 'src/core/public'; | ||
import { PluginsStart } from 'ui/new_platform/new_platform'; | ||
import { Chrome } from 'ui/chrome'; | ||
import { UMFrontendLibs } from '../lib/lib'; | ||
import { PLUGIN } from '../../common/constants'; | ||
import { getKibanaFrameworkAdapter } from '../lib/adapters/framework/new_platform_adapter'; | ||
import template from './template.html'; | ||
import { UptimeApp } from '../uptime_app'; | ||
import { createApolloClient } from '../lib/adapters/framework/apollo_client_adapter'; | ||
|
||
export interface StartObject { | ||
core: LegacyCoreStart; | ||
plugins: PluginsStart; | ||
} | ||
|
||
export class Plugin { | ||
constructor( | ||
// @ts-ignore this is added to satisfy the New Platform typing constraint, | ||
// but we're not leveraging any of its functionality yet. | ||
private readonly initializerContext: PluginInitializerContext, | ||
private readonly chrome: Chrome | ||
) { | ||
this.chrome = chrome; | ||
} | ||
|
||
public start(start: StartObject): void { | ||
const { | ||
core, | ||
plugins: { | ||
data: { autocomplete }, | ||
}, | ||
} = start; | ||
const libs: UMFrontendLibs = { | ||
framework: getKibanaFrameworkAdapter(core, autocomplete), | ||
}; | ||
// @ts-ignore improper type description | ||
this.chrome.setRootTemplate(template); | ||
const checkForRoot = () => { | ||
return new Promise(resolve => { | ||
const ready = !!document.getElementById(PLUGIN.APP_ROOT_ID); | ||
if (ready) { | ||
resolve(); | ||
} else { | ||
setTimeout(() => resolve(checkForRoot()), 10); | ||
} | ||
}); | ||
}; | ||
checkForRoot().then(() => { | ||
libs.framework.render(UptimeApp, createApolloClient); | ||
}); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
<div id="react-uptime-root"></div> |
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
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
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
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
140 changes: 0 additions & 140 deletions
140
x-pack/legacy/plugins/uptime/public/lib/adapters/framework/kibana_framework_adapter.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.