mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
* fix: link to the correct subscription upgrade "page/flow"
* test: fix tests
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 25ba3c758f
)
Co-authored-by: Jan Monschke <jan.monschke@elastic.co>
This commit is contained in:
parent
729da476a5
commit
d4dadf0752
3 changed files with 19 additions and 14 deletions
|
@ -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();
|
||||
});
|
||||
|
||||
|
@ -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();
|
||||
});
|
||||
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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 (
|
||||
<UpsellContainer>
|
||||
<EuiFlexGroup alignItems="center" gutterSize="none">
|
||||
|
@ -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>
|
||||
|
|
|
@ -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',
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue