From 42912ae1837d1c5029502f53ba472843862dd84d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20C=C3=B4t=C3=A9?= Date: Wed, 13 Nov 2019 18:31:58 -0500 Subject: [PATCH] Fix merge conflicts (#50531) --- src/legacy/core_plugins/telemetry/index.ts | 6 ++---- .../components/__snapshots__/telemetry_form.test.js.snap | 2 +- .../telemetry/public/components/telemetry_form.js | 2 +- .../server/telemetry_config/get_telemetry_opt_in.ts | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/legacy/core_plugins/telemetry/index.ts b/src/legacy/core_plugins/telemetry/index.ts index 149fa99938563..cb8df5dba1e60 100644 --- a/src/legacy/core_plugins/telemetry/index.ts +++ b/src/legacy/core_plugins/telemetry/index.ts @@ -50,10 +50,8 @@ const telemetry = (kibana: any) => { allowChangingOptInStatus: Joi.boolean().default(true), optIn: Joi.when('allowChangingOptInStatus', { is: false, - then: Joi.valid(true).required(), - otherwise: Joi.boolean() - .allow(null) - .default(null), + then: Joi.valid(true).default(true), + otherwise: Joi.boolean().default(true), }), // `config` is used internally and not intended to be set diff --git a/src/legacy/core_plugins/telemetry/public/components/__snapshots__/telemetry_form.test.js.snap b/src/legacy/core_plugins/telemetry/public/components/__snapshots__/telemetry_form.test.js.snap index b96313fd700ac..268616f7115d4 100644 --- a/src/legacy/core_plugins/telemetry/public/components/__snapshots__/telemetry_form.test.js.snap +++ b/src/legacy/core_plugins/telemetry/public/components/__snapshots__/telemetry_form.test.js.snap @@ -34,7 +34,7 @@ exports[`TelemetryForm renders as expected when allows to change optIn status 1` save={[Function]} setting={ Object { - "defVal": false, + "defVal": true, "description":

Help us improve the Elastic Stack by providing usage statistics for basic features. We will not share this data outside of Elastic. diff --git a/src/legacy/core_plugins/telemetry/public/components/telemetry_form.js b/src/legacy/core_plugins/telemetry/public/components/telemetry_form.js index 80eb2da59c47e..e92f2266fa15f 100644 --- a/src/legacy/core_plugins/telemetry/public/components/telemetry_form.js +++ b/src/legacy/core_plugins/telemetry/public/components/telemetry_form.js @@ -116,7 +116,7 @@ export class TelemetryForm extends Component { type: 'boolean', value: telemetryOptInProvider.getOptIn() || false, description: this.renderDescription(), - defVal: false, + defVal: true, }} save={this.toggleOptIn} clear={this.toggleOptIn} diff --git a/src/legacy/core_plugins/telemetry/server/telemetry_config/get_telemetry_opt_in.ts b/src/legacy/core_plugins/telemetry/server/telemetry_config/get_telemetry_opt_in.ts index 057a8b0c47958..d83ffdf69b576 100644 --- a/src/legacy/core_plugins/telemetry/server/telemetry_config/get_telemetry_opt_in.ts +++ b/src/legacy/core_plugins/telemetry/server/telemetry_config/get_telemetry_opt_in.ts @@ -44,7 +44,7 @@ export const getTelemetryOptIn: GetTelemetryOptIn = ({ } if (telemetrySavedObject === null || typeof telemetrySavedObject.enabled !== 'boolean') { - return null; + return configTelemetryOptIn; } const savedOptIn = telemetrySavedObject.enabled;