diff --git a/x-pack/legacy/plugins/telemetry/index.ts b/x-pack/legacy/plugins/telemetry/index.ts index 6d4e9be67fb98..71e80cb2bd02f 100644 --- a/x-pack/legacy/plugins/telemetry/index.ts +++ b/x-pack/legacy/plugins/telemetry/index.ts @@ -65,12 +65,9 @@ export const telemetry = (kibana: any) => { injectDefaultVars(server: Server) { const config = server.config(); return { - telemetryEnabled: getXpackConfigWithDeprecated(config, 'telemetry.enabled'), telemetryUrl: getXpackConfigWithDeprecated(config, 'telemetry.url'), - spacesEnabled: config.get('xpack.spaces.enabled'), telemetryBanner: config.get('xpack.telemetry.banner'), telemetryOptedIn: null, - activeSpace: null, }; }, hacks: ['plugins/telemetry/hacks/telemetry_init', 'plugins/telemetry/hacks/telemetry_opt_in'], diff --git a/x-pack/legacy/plugins/xpack_main/index.js b/x-pack/legacy/plugins/xpack_main/index.js index 5f6286a26dbaf..b4a4693112bb6 100644 --- a/x-pack/legacy/plugins/xpack_main/index.js +++ b/x-pack/legacy/plugins/xpack_main/index.js @@ -9,6 +9,7 @@ import dedent from 'dedent'; import { XPACK_INFO_API_DEFAULT_POLL_FREQUENCY_IN_MILLIS } from '../../server/lib/constants'; +import { getXpackConfigWithDeprecated } from '../telemetry/common/get_xpack_config_with_deprecated'; import { mirrorPluginStatus } from '../../server/lib/mirror_plugin_status'; import { replaceInjectedVars } from './server/lib/replace_injected_vars'; import { setupXPackMain } from './server/lib/setup_xpack_main'; @@ -59,6 +60,15 @@ export const xpackMain = (kibana) => { 'plugins/xpack_main/hacks/check_xpack_info_change', ], replaceInjectedVars, + injectDefaultVars(server) { + const config = server.config(); + + return { + telemetryEnabled: getXpackConfigWithDeprecated(config, 'telemetry.enabled'), + activeSpace: null, + spacesEnabled: config.get('xpack.spaces.enabled'), + }; + }, __webpackPluginProvider__(webpack) { return new webpack.BannerPlugin({ banner: dedent`