From 70467f8c6131d97f56983ac4410daba191453576 Mon Sep 17 00:00:00 2001
From: Patrick Mueller
Date: Tue, 12 Nov 2019 18:17:23 -0500
Subject: [PATCH 1/2] remove exclamation from CN telemetry.welcomeBanner.title
---
.../telemetry/common/constants.ts | 2 +-
.../opt_in_message.test.tsx.snap | 24 +++++++
.../__snapshots__/telemetry_form.test.js.snap | 2 +-
.../components/opt_in_banner_component.tsx | 12 +++-
.../public/components/opt_in_message.test.tsx | 29 ++++++++
.../public/components/opt_in_message.tsx | 69 ++++---------------
.../telemetry_opt_in.test.js.snap | 4 +-
.../translations/translations/zh-CN.json | 6 +-
8 files changed, 84 insertions(+), 64 deletions(-)
create mode 100644 src/legacy/core_plugins/telemetry/public/components/__snapshots__/opt_in_message.test.tsx.snap
create mode 100644 src/legacy/core_plugins/telemetry/public/components/opt_in_message.test.tsx
diff --git a/src/legacy/core_plugins/telemetry/common/constants.ts b/src/legacy/core_plugins/telemetry/common/constants.ts
index b80396aac62a1..7b0c62276f290 100644
--- a/src/legacy/core_plugins/telemetry/common/constants.ts
+++ b/src/legacy/core_plugins/telemetry/common/constants.ts
@@ -51,7 +51,7 @@ export const LOCALSTORAGE_KEY = 'telemetry.data';
/**
* Link to the Elastic Telemetry privacy statement.
*/
-export const PRIVACY_STATEMENT_URL = `https://www.elastic.co/legal/telemetry-privacy-statement`;
+export const PRIVACY_STATEMENT_URL = `https://www.elastic.co/legal/privacy-statement`;
/**
* The type name used within the Monitoring index to publish localization stats.
diff --git a/src/legacy/core_plugins/telemetry/public/components/__snapshots__/opt_in_message.test.tsx.snap b/src/legacy/core_plugins/telemetry/public/components/__snapshots__/opt_in_message.test.tsx.snap
new file mode 100644
index 0000000000000..c80485332fa8a
--- /dev/null
+++ b/src/legacy/core_plugins/telemetry/public/components/__snapshots__/opt_in_message.test.tsx.snap
@@ -0,0 +1,24 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`OptInMessage renders as expected 1`] = `
+
+
+
+ ,
+ }
+ }
+ />
+
+`;
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 e1aead3798de7..b96313fd700ac 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
@@ -52,7 +52,7 @@ exports[`TelemetryForm renders as expected when allows to change optIn status 1`
{
const title = (
);
return (
@@ -45,12 +45,18 @@ export class OptInBanner extends React.PureComponent {
this.props.optInClick(true)}>
-
+
this.props.optInClick(false)}>
-
+
diff --git a/src/legacy/core_plugins/telemetry/public/components/opt_in_message.test.tsx b/src/legacy/core_plugins/telemetry/public/components/opt_in_message.test.tsx
new file mode 100644
index 0000000000000..1a9fabceda907
--- /dev/null
+++ b/src/legacy/core_plugins/telemetry/public/components/opt_in_message.test.tsx
@@ -0,0 +1,29 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import React from 'react';
+import { shallowWithIntl } from 'test_utils/enzyme_helpers';
+import { OptInMessage } from './opt_in_message';
+
+describe('OptInMessage', () => {
+ it('renders as expected', () => {
+ expect(
+ shallowWithIntl( [])} />)
+ ).toMatchSnapshot();
+ });
+});
diff --git a/src/legacy/core_plugins/telemetry/public/components/opt_in_message.tsx b/src/legacy/core_plugins/telemetry/public/components/opt_in_message.tsx
index 928bb1015b715..4221d78516e10 100644
--- a/src/legacy/core_plugins/telemetry/public/components/opt_in_message.tsx
+++ b/src/legacy/core_plugins/telemetry/public/components/opt_in_message.tsx
@@ -21,8 +21,7 @@ import * as React from 'react';
import { EuiLink } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
-import { getConfigTelemetryDesc, PRIVACY_STATEMENT_URL } from '../../common/constants';
-import { OptInExampleFlyout } from './opt_in_details_component';
+import { PRIVACY_STATEMENT_URL } from '../../common/constants';
interface Props {
fetchTelemetry: () => Promise;
@@ -46,60 +45,22 @@ export class OptInMessage extends React.PureComponent {
};
render() {
- const { showDetails, showExample } = this.state;
-
- const getDetails = () => (
-
-
-
- ),
- telemetryPrivacyStatementLink: (
-
-
-
- ),
- }}
- />
- );
-
- const getFlyoutDetails = () => (
- this.setState({ showExample: false })}
- fetchTelemetry={this.props.fetchTelemetry}
- />
- );
-
- const getReadMore = () => (
- this.setState({ showDetails: true })}>
-
-
- );
-
return (
- {getConfigTelemetryDesc()} {!showDetails && getReadMore()}
- {showDetails && (
-
- {getDetails()}
- {showExample && getFlyoutDetails()}
-
- )}
+
+
+
+ ),
+ }}
+ />
);
}
diff --git a/x-pack/legacy/plugins/license_management/__jest__/__snapshots__/telemetry_opt_in.test.js.snap b/x-pack/legacy/plugins/license_management/__jest__/__snapshots__/telemetry_opt_in.test.js.snap
index f82e8b03527c0..575c47205f9c0 100644
--- a/x-pack/legacy/plugins/license_management/__jest__/__snapshots__/telemetry_opt_in.test.js.snap
+++ b/x-pack/legacy/plugins/license_management/__jest__/__snapshots__/telemetry_opt_in.test.js.snap
@@ -188,7 +188,7 @@ exports[`TelemetryOptIn should display when telemetry not opted in 1`] = `
/>
,
"telemetryPrivacyStatementLink":
,
"telemetryPrivacyStatementLink":
Date: Wed, 13 Nov 2019 09:39:52 -0500
Subject: [PATCH 2/2] remove unused i18n keys via `scripts/i18n_check.js --fix`
---
x-pack/plugins/translations/translations/ja-JP.json | 5 -----
x-pack/plugins/translations/translations/zh-CN.json | 5 -----
2 files changed, 10 deletions(-)
diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json
index 81a6dff3b85f1..b3204345e9238 100644
--- a/x-pack/plugins/translations/translations/ja-JP.json
+++ b/x-pack/plugins/translations/translations/ja-JP.json
@@ -11809,12 +11809,7 @@
"telemetry.telemetryErrorNotificationMessageDescription.unableToSaveTelemetryPreferenceText": "遠隔測定設定を保存できません。",
"telemetry.telemetryErrorNotificationMessageTitle": "遠隔測定エラー",
"telemetry.usageDataTitle": "使用データ",
- "telemetry.welcomeBanner.noButtonLabel": "いいえ",
- "telemetry.welcomeBanner.telemetryConfigDescription.readMoreLinkText": "続きを読む",
- "telemetry.welcomeBanner.telemetryConfigDetailsDescription": "ユーザーが処理したり保管したりするデータに関する情報は一切送信されません。この機能は定期的に基本的な機能の利用状況に関する統計情報を送信します。{exampleLink} をご覧いただくか、{telemetryPrivacyStatementLink} をお読みください。この機能はいつでも無効にできます。",
- "telemetry.welcomeBanner.telemetryConfigDetailsDescription.exampleLinkText": "例",
"telemetry.welcomeBanner.telemetryConfigDetailsDescription.telemetryPrivacyStatementLinkText": "遠隔測定に関するプライバシーステートメント",
- "telemetry.welcomeBanner.yesButtonLabel": "はい",
"telemetry.optInErrorToastText": "使用状況統計設定の設定中にエラーが発生しました。",
"telemetry.optInErrorToastTitle": "エラー",
"telemetry.welcomeBanner.title": "Elastic Stack の改善にご協力ください",
diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json
index 0f26c77b2e34d..1db116ace6165 100644
--- a/x-pack/plugins/translations/translations/zh-CN.json
+++ b/x-pack/plugins/translations/translations/zh-CN.json
@@ -11899,12 +11899,7 @@
"telemetry.telemetryErrorNotificationMessageDescription.unableToSaveTelemetryPreferenceText": "无法保存遥测首选项。",
"telemetry.telemetryErrorNotificationMessageTitle": "遥测错误",
"telemetry.usageDataTitle": "使用情况数据",
- "telemetry.welcomeBanner.noButtonLabel": "否",
- "telemetry.welcomeBanner.telemetryConfigDescription.readMoreLinkText": "阅读更多内容",
- "telemetry.welcomeBanner.telemetryConfigDetailsDescription": "不会发送有关所处理或存储数据的信息。此功能将定期发送基本功能使用情况统计信息。请参阅{exampleLink}或阅读我们的{telemetryPrivacyStatementLink}。您可以随时禁用此功能。",
- "telemetry.welcomeBanner.telemetryConfigDetailsDescription.exampleLinkText": "示例",
"telemetry.welcomeBanner.telemetryConfigDetailsDescription.telemetryPrivacyStatementLinkText": "遥测隐私声明",
- "telemetry.welcomeBanner.yesButtonLabel": "是",
"telemetry.optInErrorToastText": "尝试设置使用统计信息首选项时发生错误。",
"telemetry.optInErrorToastTitle": "错误",
"telemetry.welcomeBanner.title": "帮助我们改进 Elastic Stack",