From 4824c6f2b9b33c114eece1b2a3c7f48aece1b669 Mon Sep 17 00:00:00 2001 From: Jan Monschke Date: Tue, 4 Oct 2022 17:32:28 +0200 Subject: [PATCH 1/3] fix: link to the correct subscription upgrade "page/flow" --- .../insights/related_alerts_upsell.tsx | 23 +++++++++++-------- .../event_details/insights/translations.ts | 4 ++-- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/insights/related_alerts_upsell.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/insights/related_alerts_upsell.tsx index 37ac07e3c03d0..ba225495a032b 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/insights/related_alerts_upsell.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/insights/related_alerts_upsell.tsx @@ -5,11 +5,12 @@ * 2.0. */ -import React from 'react'; +import React, { useCallback } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiLink, EuiIcon, EuiText } from '@elastic/eui'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; -import { ALERT_UPSELL } from './translations'; +import { INSIGHTS_UPSELL } from './translations'; +import { useNavigation } from '../../../lib/kibana'; const UpsellContainer = euiStyled.div` border: 1px solid ${({ theme }) => theme.eui.euiColorLightShade}; @@ -22,6 +23,15 @@ const StyledIcon = euiStyled(EuiIcon)` `; export const RelatedAlertsUpsell = React.memo(() => { + const { getAppUrl, navigateTo } = useNavigation(); + const subscriptionUrl = getAppUrl({ + appId: 'management', + path: 'stack/license_management', + }); + const goToSubscription = useCallback(() => { + navigateTo({ url: subscriptionUrl }); + }, [navigateTo, subscriptionUrl]); + return ( @@ -30,13 +40,8 @@ export const RelatedAlertsUpsell = React.memo(() => { - - {ALERT_UPSELL} + + {INSIGHTS_UPSELL} diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/insights/translations.ts b/x-pack/plugins/security_solution/public/common/components/event_details/insights/translations.ts index e839003e1f7f9..10d9efca4682d 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/insights/translations.ts +++ b/x-pack/plugins/security_solution/public/common/components/event_details/insights/translations.ts @@ -136,9 +136,9 @@ export const SIMPLE_ALERT_TABLE_LIMITED = i18n.translate( } ); -export const ALERT_UPSELL = i18n.translate( +export const INSIGHTS_UPSELL = i18n.translate( 'xpack.securitySolution.alertDetails.overview.insights.alertUpsellTitle', { - defaultMessage: 'Get more insights with a subscription', + defaultMessage: 'Get more insights with a platinum subscription', } ); From cba7809570e91d3c14a4853fe2deed64ce440e08 Mon Sep 17 00:00:00 2001 From: Jan Monschke Date: Tue, 4 Oct 2022 18:38:07 +0200 Subject: [PATCH 2/3] test: fix tests --- .../components/event_details/insights/insights.test.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/insights/insights.test.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/insights/insights.test.tsx index 747b2ec939f71..5db051ccf89bd 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/insights/insights.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/insights/insights.test.tsx @@ -134,7 +134,7 @@ describe('Insights', () => { expect(screen.getByTestId('related-alerts-by-ancestry')).toBeInTheDocument(); expect( - screen.queryByRole('link', { name: new RegExp(i18n.ALERT_UPSELL) }) + screen.queryByRole('button', { name: new RegExp(i18n.INSIGHTS_UPSELL) }) ).not.toBeInTheDocument(); }); }); @@ -150,7 +150,7 @@ describe('Insights', () => { ); expect( - screen.getByRole('link', { name: new RegExp(i18n.ALERT_UPSELL) }) + screen.getByRole('button', { name: new RegExp(i18n.INSIGHTS_UPSELL) }) ).toBeInTheDocument(); expect(screen.queryByTestId('related-alerts-by-ancestry')).not.toBeInTheDocument(); }); @@ -169,7 +169,7 @@ describe('Insights', () => { expect(screen.queryByTestId('related-alerts-by-ancestry')).not.toBeInTheDocument(); expect( - screen.queryByRole('link', { name: new RegExp(i18n.ALERT_UPSELL) }) + screen.queryByRole('button', { name: new RegExp(i18n.INSIGHTS_UPSELL) }) ).not.toBeInTheDocument(); }); }); From 9e44ca24226b4fac0a6b3a9149303a93ecb49ce9 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 5 Oct 2022 11:25:32 +0000 Subject: [PATCH 3/3] [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs' --- docs/developer/plugin-list.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index 407261c6f1d7e..4853d859b371a 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -71,7 +71,7 @@ as uiSettings within the code. |{kib-repo}blob/{branch}/src/plugins/data_views/README.mdx[dataViews] |The data views API provides a consistent method of structuring and formatting documents -and field lists across the various Kibana apps. Its typically used in conjunction with +and field lists across the various Kibana apps. It's typically used in conjunction with for composing queries.