Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SecuritySolution] Link to the correct subscription upgrade "page/flow" #142630

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
<DocLink id="kibDevTutorialDataSearchAndSessions" section="high-level-search" text="SearchSource" /> for composing queries.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,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();
});

Expand Down Expand Up @@ -179,7 +179,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();
});
Expand All @@ -198,7 +198,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();
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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 (
<UpsellContainer>
<EuiFlexGroup alignItems="center" gutterSize="none">
Expand All @@ -30,13 +40,8 @@ export const RelatedAlertsUpsell = React.memo(() => {
</EuiFlexItem>
<EuiFlexItem>
<EuiText size="s">
<EuiLink
color="subdued"
href="https://www.elastic.co/pricing/"
rel="noopener noreferrer"
target="_blank"
>
{ALERT_UPSELL}
<EuiLink color="subdued" onClick={goToSubscription} target="_blank">
{INSIGHTS_UPSELL}
</EuiLink>
</EuiText>
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
);