Skip to content

Commit

Permalink
[telemetry] add spacesEnabled config back to xpack_main (#43312)
Browse files Browse the repository at this point in the history
* add spacesEnabled config back to xpack

* move some variables back to xpack_main

* fix import path
  • Loading branch information
Bamieh authored Aug 14, 2019
1 parent 7aa7f5a commit 09196aa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 0 additions & 3 deletions x-pack/legacy/plugins/telemetry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
10 changes: 10 additions & 0 deletions x-pack/legacy/plugins/xpack_main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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`
Expand Down

0 comments on commit 09196aa

Please sign in to comment.