From 9277d4058268b6258e69afb955f8298698b610d9 Mon Sep 17 00:00:00 2001 From: Ahmad Bamieh Date: Wed, 14 Aug 2019 22:55:16 +0300 Subject: [PATCH 1/3] add spacesEnabled config back to xpack --- x-pack/legacy/plugins/xpack_main/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/x-pack/legacy/plugins/xpack_main/index.js b/x-pack/legacy/plugins/xpack_main/index.js index 5f6286a26dbaf..7f3488ff65dc2 100644 --- a/x-pack/legacy/plugins/xpack_main/index.js +++ b/x-pack/legacy/plugins/xpack_main/index.js @@ -59,6 +59,14 @@ export const xpackMain = (kibana) => { 'plugins/xpack_main/hacks/check_xpack_info_change', ], replaceInjectedVars, + injectDefaultVars(server) { + const config = server.config(); + + return { + activeSpace: null, + spacesEnabled: config.get('xpack.spaces.enabled'), + }; + }, __webpackPluginProvider__(webpack) { return new webpack.BannerPlugin({ banner: dedent` From aea7d740bb6203fcd8e58526c9f1578d0d1c1f8f Mon Sep 17 00:00:00 2001 From: Ahmad Bamieh Date: Wed, 14 Aug 2019 23:44:35 +0300 Subject: [PATCH 2/3] move some variables back to xpack_main --- x-pack/legacy/plugins/telemetry/index.ts | 3 --- x-pack/legacy/plugins/xpack_main/index.js | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) 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 7f3488ff65dc2..bdaa0f1f4e1b2 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.ts'; import { mirrorPluginStatus } from '../../server/lib/mirror_plugin_status'; import { replaceInjectedVars } from './server/lib/replace_injected_vars'; import { setupXPackMain } from './server/lib/setup_xpack_main'; @@ -63,6 +64,7 @@ export const xpackMain = (kibana) => { const config = server.config(); return { + telemetryEnabled: getXpackConfigWithDeprecated(config, 'telemetry.enabled'), activeSpace: null, spacesEnabled: config.get('xpack.spaces.enabled'), }; From 3493a1f4f0281c2a8a0598ffccbf021922a97e88 Mon Sep 17 00:00:00 2001 From: Ahmad Bamieh Date: Thu, 15 Aug 2019 00:49:33 +0300 Subject: [PATCH 3/3] fix import path --- x-pack/legacy/plugins/xpack_main/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/xpack_main/index.js b/x-pack/legacy/plugins/xpack_main/index.js index bdaa0f1f4e1b2..b4a4693112bb6 100644 --- a/x-pack/legacy/plugins/xpack_main/index.js +++ b/x-pack/legacy/plugins/xpack_main/index.js @@ -9,7 +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.ts'; +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';