From 22285a73cbbae1ebd6eb75249d1d6a80e03428be Mon Sep 17 00:00:00 2001 From: Ben Skelker Date: Thu, 10 Oct 2019 17:40:24 +0300 Subject: [PATCH 1/7] Add button with link to license management in ML popup --- .../upgrade_contents.test.tsx.snap | 27 ++++++++++---- .../components/ml_popover/translations.ts | 6 +++- .../ml_popover/upgrade_contents.tsx | 36 ++++++++++++++----- .../translations/translations/ja-JP.json | 2 +- .../translations/translations/zh-CN.json | 2 +- 5 files changed, 54 insertions(+), 19 deletions(-) diff --git a/x-pack/legacy/plugins/siem/public/components/ml_popover/__snapshots__/upgrade_contents.test.tsx.snap b/x-pack/legacy/plugins/siem/public/components/ml_popover/__snapshots__/upgrade_contents.test.tsx.snap index 338c416b5d847..ab23f42103014 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml_popover/__snapshots__/upgrade_contents.test.tsx.snap +++ b/x-pack/legacy/plugins/siem/public/components/ml_popover/__snapshots__/upgrade_contents.test.tsx.snap @@ -32,13 +32,26 @@ exports[`FilterGroup renders correctly against snapshot 1`] = ` /> - - Subscription options - + + Subscription plans + + + Manage license + + `; diff --git a/x-pack/legacy/plugins/siem/public/components/ml_popover/translations.ts b/x-pack/legacy/plugins/siem/public/components/ml_popover/translations.ts index 724d2c29cec79..0ea9960edc16a 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml_popover/translations.ts +++ b/x-pack/legacy/plugins/siem/public/components/ml_popover/translations.ts @@ -25,7 +25,11 @@ export const UPGRADE_TITLE = i18n.translate('xpack.siem.components.mlPopup.upgra }); export const UPGRADE_BUTTON = i18n.translate('xpack.siem.components.mlPopup.upgradeButtonLabel', { - defaultMessage: 'Subscription options', + defaultMessage: 'Subscription plans', +}); + +export const LICENSE_BUTTON = i18n.translate('xpack.siem.components.mlPopup.licenseButtonLabel', { + defaultMessage: 'Manage license', }); export const FILTER_PLACEHOLDER = i18n.translate( diff --git a/x-pack/legacy/plugins/siem/public/components/ml_popover/upgrade_contents.tsx b/x-pack/legacy/plugins/siem/public/components/ml_popover/upgrade_contents.tsx index 5b1787eec66d2..b3fff6b9ab4cc 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml_popover/upgrade_contents.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml_popover/upgrade_contents.tsx @@ -5,9 +5,17 @@ */ import React from 'react'; +import chrome from 'ui/chrome'; import styled from 'styled-components'; -import { EuiButton, EuiPopoverTitle, EuiSpacer, EuiText, EuiLink } from '@elastic/eui'; +import { + EuiButton, + EuiPopoverTitle, + EuiSpacer, + EuiText, + EuiLink, + EuiFlexGroup, +} from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import * as i18n from './translations'; @@ -38,14 +46,24 @@ export const UpgradeContents = React.memo(() => { /> - - {i18n.UPGRADE_BUTTON} - + + + {i18n.UPGRADE_BUTTON} + + + {i18n.LICENSE_BUTTON} + + ); }); diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index b37e7747c22f6..54a9073b9e451 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -11157,4 +11157,4 @@ "xpack.fileUpload.fileParser.errorReadingFile": "ファイルの読み込み中にエラーが発生しました", "xpack.fileUpload.fileParser.noFileProvided": "エラー、ファイルが提供されていません" } -} +} \ No newline at end of file diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 5ed0b97077298..4e910466565b0 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -11323,4 +11323,4 @@ "xpack.fileUpload.fileParser.errorReadingFile": "读取文件时出错", "xpack.fileUpload.fileParser.noFileProvided": "错误,未提供任何文件" } -} +} \ No newline at end of file From df91e6717b7129407b19403630203aec405e53e7 Mon Sep 17 00:00:00 2001 From: Ben Skelker Date: Thu, 10 Oct 2019 20:22:10 +0300 Subject: [PATCH 2/7] Corrections to button styling --- .../upgrade_contents.test.tsx.snap | 39 +++++++++++-------- .../ml_popover/upgrade_contents.tsx | 38 ++++++++++-------- 2 files changed, 44 insertions(+), 33 deletions(-) diff --git a/x-pack/legacy/plugins/siem/public/components/ml_popover/__snapshots__/upgrade_contents.test.tsx.snap b/x-pack/legacy/plugins/siem/public/components/ml_popover/__snapshots__/upgrade_contents.test.tsx.snap index ab23f42103014..cff019b33cb19 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml_popover/__snapshots__/upgrade_contents.test.tsx.snap +++ b/x-pack/legacy/plugins/siem/public/components/ml_popover/__snapshots__/upgrade_contents.test.tsx.snap @@ -33,25 +33,32 @@ exports[`FilterGroup renders correctly against snapshot 1`] = ` - - Subscription plans - - + Subscription plans + + + - Manage license - + + Manage license + + `; diff --git a/x-pack/legacy/plugins/siem/public/components/ml_popover/upgrade_contents.tsx b/x-pack/legacy/plugins/siem/public/components/ml_popover/upgrade_contents.tsx index b3fff6b9ab4cc..8e3b41f9f0c60 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml_popover/upgrade_contents.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml_popover/upgrade_contents.tsx @@ -15,6 +15,7 @@ import { EuiText, EuiLink, EuiFlexGroup, + EuiFlexItem, } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import * as i18n from './translations'; @@ -46,23 +47,26 @@ export const UpgradeContents = React.memo(() => { /> - - - {i18n.UPGRADE_BUTTON} - - - {i18n.LICENSE_BUTTON} - + + + + {i18n.UPGRADE_BUTTON} + + + + + {i18n.LICENSE_BUTTON} + + ); From 85e88e87846c54fe392c252753679c3215a75469 Mon Sep 17 00:00:00 2001 From: Ben Skelker Date: Thu, 10 Oct 2019 21:13:45 +0300 Subject: [PATCH 3/7] Updated button icon --- .../siem/public/components/ml_popover/upgrade_contents.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/siem/public/components/ml_popover/upgrade_contents.tsx b/x-pack/legacy/plugins/siem/public/components/ml_popover/upgrade_contents.tsx index 8e3b41f9f0c60..45ea80d6a303e 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml_popover/upgrade_contents.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml_popover/upgrade_contents.tsx @@ -61,7 +61,7 @@ export const UpgradeContents = React.memo(() => { {i18n.LICENSE_BUTTON} From 4c1633900a556e9ac9308ba6ff986a0126282325 Mon Sep 17 00:00:00 2001 From: Ben Skelker Date: Thu, 10 Oct 2019 22:00:24 +0300 Subject: [PATCH 4/7] Update snapshots --- .../ml_popover/__snapshots__/upgrade_contents.test.tsx.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/siem/public/components/ml_popover/__snapshots__/upgrade_contents.test.tsx.snap b/x-pack/legacy/plugins/siem/public/components/ml_popover/__snapshots__/upgrade_contents.test.tsx.snap index cff019b33cb19..fbad5012f1e5e 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml_popover/__snapshots__/upgrade_contents.test.tsx.snap +++ b/x-pack/legacy/plugins/siem/public/components/ml_popover/__snapshots__/upgrade_contents.test.tsx.snap @@ -53,7 +53,7 @@ exports[`FilterGroup renders correctly against snapshot 1`] = ` > Manage license From b8808fe0fc84d3da70e5c716fcd9d4e757c683f6 Mon Sep 17 00:00:00 2001 From: Ben Skelker Date: Thu, 10 Oct 2019 23:37:32 +0300 Subject: [PATCH 5/7] Correcting json translation files --- x-pack/plugins/translations/translations/ja-JP.json | 2 +- x-pack/plugins/translations/translations/zh-CN.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 54a9073b9e451..b37e7747c22f6 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -11157,4 +11157,4 @@ "xpack.fileUpload.fileParser.errorReadingFile": "ファイルの読み込み中にエラーが発生しました", "xpack.fileUpload.fileParser.noFileProvided": "エラー、ファイルが提供されていません" } -} \ No newline at end of file +} diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 4e910466565b0..8c9f8c28a6d0b 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -1,4 +1,4 @@ -{ +SIEM_license_button_ML_popup{ "formats": { "number": { "currency": { @@ -11323,4 +11323,4 @@ "xpack.fileUpload.fileParser.errorReadingFile": "读取文件时出错", "xpack.fileUpload.fileParser.noFileProvided": "错误,未提供任何文件" } -} \ No newline at end of file +} From 2cda215dc797f78c54c947c79149162da298241b Mon Sep 17 00:00:00 2001 From: Ben Skelker Date: Fri, 11 Oct 2019 09:52:42 +0300 Subject: [PATCH 6/7] Fix zh_CN json file --- x-pack/plugins/translations/translations/zh-CN.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 8c9f8c28a6d0b..b79f1dc78959c 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -1,4 +1,5 @@ -SIEM_license_button_ML_popup{ +{ + SIEM_license_button_ML_popup{ "formats": { "number": { "currency": { From d56a2f631cbe7be14c067d98295e7ee8b1a11f2f Mon Sep 17 00:00:00 2001 From: Ben Skelker Date: Fri, 11 Oct 2019 10:41:36 +0300 Subject: [PATCH 7/7] And now fixing the translation file properly --- x-pack/plugins/translations/translations/zh-CN.json | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index b79f1dc78959c..5ed0b97077298 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -1,5 +1,4 @@ { - SIEM_license_button_ML_popup{ "formats": { "number": { "currency": {