Change telemetry optIn to default to true (#50490)
* Change optIn to default to true * Update snapshot * Fix eslint errors
This commit is contained in:
parent
9212eb2d5f
commit
bff235bf77
|
@ -50,10 +50,8 @@ const telemetry = (kibana: any) => {
|
||||||
allowChangingOptInStatus: Joi.boolean().default(true),
|
allowChangingOptInStatus: Joi.boolean().default(true),
|
||||||
optIn: Joi.when('allowChangingOptInStatus', {
|
optIn: Joi.when('allowChangingOptInStatus', {
|
||||||
is: false,
|
is: false,
|
||||||
then: Joi.valid(true).required(),
|
then: Joi.valid(true).default(true),
|
||||||
otherwise: Joi.boolean()
|
otherwise: Joi.boolean().default(true),
|
||||||
.allow(null)
|
|
||||||
.default(null),
|
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// `config` is used internally and not intended to be set
|
// `config` is used internally and not intended to be set
|
||||||
|
|
|
@ -35,7 +35,7 @@ exports[`TelemetryForm renders as expected when allows to change optIn status 1`
|
||||||
setting={
|
setting={
|
||||||
Object {
|
Object {
|
||||||
"ariaName": "Provide usage statistics",
|
"ariaName": "Provide usage statistics",
|
||||||
"defVal": false,
|
"defVal": true,
|
||||||
"description": <React.Fragment>
|
"description": <React.Fragment>
|
||||||
<p>
|
<p>
|
||||||
Help us improve the Elastic Stack by providing usage statistics for basic features. We will not share this data outside of Elastic.
|
Help us improve the Elastic Stack by providing usage statistics for basic features. We will not share this data outside of Elastic.
|
||||||
|
|
|
@ -117,7 +117,7 @@ export class TelemetryForm extends Component {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
value: telemetryOptInProvider.getOptIn() || false,
|
value: telemetryOptInProvider.getOptIn() || false,
|
||||||
description: this.renderDescription(),
|
description: this.renderDescription(),
|
||||||
defVal: false,
|
defVal: true,
|
||||||
ariaName: i18n.translate('telemetry.provideUsageStatisticsLabel', { defaultMessage: 'Provide usage statistics' })
|
ariaName: i18n.translate('telemetry.provideUsageStatisticsLabel', { defaultMessage: 'Provide usage statistics' })
|
||||||
}}
|
}}
|
||||||
save={this.toggleOptIn}
|
save={this.toggleOptIn}
|
||||||
|
|
|
@ -44,7 +44,7 @@ export const getTelemetryOptIn: GetTelemetryOptIn = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (telemetrySavedObject === null || typeof telemetrySavedObject.enabled !== 'boolean') {
|
if (telemetrySavedObject === null || typeof telemetrySavedObject.enabled !== 'boolean') {
|
||||||
return null;
|
return configTelemetryOptIn;
|
||||||
}
|
}
|
||||||
|
|
||||||
const savedOptIn = telemetrySavedObject.enabled;
|
const savedOptIn = telemetrySavedObject.enabled;
|
||||||
|
|
Loading…
Reference in a new issue