Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasneirynck committed Mar 11, 2021
1 parent 40d3f90 commit 5b4b6c7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
12 changes: 2 additions & 10 deletions src/plugins/maps_ems/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ import { getServiceSettings } from './lazy_load_bundle/get_service_settings';
* @public
*/

export const bindSetupCoreAndPlugins = (
core: CoreSetup,
config: MapsEmsConfig,
kibanaVersion: string
) => {
setKibanaVersion(kibanaVersion);
setMapsEmsConfig(config);
};

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface MapsEmsStartDependencies {}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
Expand All @@ -46,7 +37,8 @@ export class MapsEmsPlugin implements Plugin<MapsEmsPluginSetup, MapsEmsPluginSt
const config = this._initializerContext.config.get<MapsEmsConfig>();
const kibanaVersion = this._initializerContext.env.packageInfo.version;

bindSetupCoreAndPlugins(core, config, kibanaVersion);
setKibanaVersion(kibanaVersion);
setMapsEmsConfig(config);

return {
getServiceSettings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,11 @@ export class ServiceSettings implements IServiceSettings {
this._showZoomMessage = false;
}

__debugStubManifestCalls(manifestRetrieval: () => Promise<any>): { removeStub: () => void } {
__debugStubManifestCalls(manifestRetrieval: () => Promise<unknown>): { removeStub: () => void } {
const oldGetManifest = this._emsClient.getManifest;

// This legacy code used for debugging/testing only.
// @ts-expect-error
this._emsClient.getManifest = manifestRetrieval;
return {
removeStub: () => {
Expand Down
5 changes: 4 additions & 1 deletion src/plugins/maps_legacy/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ export class MapsLegacyPlugin implements Plugin<MapsLegacyPluginSetup, MapsLegac
}

public setup(core: CoreSetup, plugins: MapsLegacySetupDependencies) {
bindSetupCoreAndPlugins(core, plugins.mapsEms.config, plugins.mapsEms.getServiceSettings);
setToasts(core.notifications.toasts);
setUiSettings(core.uiSettings);
setMapsEmsConfig(plugins.mapsEms.config);
setGetServiceSettings(plugins.mapsEms.getServiceSettings);

const getBaseMapsVis = () => new BaseMapsVisualizationProvider();

Expand Down

0 comments on commit 5b4b6c7

Please sign in to comment.