[SIEM] Link ML Rule card CTA to license_management (#63210)
* Link ML Rule card CTA to license_management Taking the user directly to the license management page within kibana (where they could immediately start a trial subscription) is much more actionable than taking them to the subscriptions marketing page. * Revert translation key change Neither of these is totally accurate, and there've already been translations written for the old one.
This commit is contained in:
parent
aed5253b53
commit
d8a295dcbc
1 changed files with 15 additions and 3 deletions
|
@ -19,9 +19,16 @@ import {
|
||||||
import { isMlRule } from '../../../../../../common/detection_engine/ml_helpers';
|
import { isMlRule } from '../../../../../../common/detection_engine/ml_helpers';
|
||||||
import { RuleType } from '../../../../../../common/detection_engine/types';
|
import { RuleType } from '../../../../../../common/detection_engine/types';
|
||||||
import { FieldHook } from '../../../../../shared_imports';
|
import { FieldHook } from '../../../../../shared_imports';
|
||||||
|
import { useKibana } from '../../../../../lib/kibana';
|
||||||
import * as i18n from './translations';
|
import * as i18n from './translations';
|
||||||
|
|
||||||
const MlCardDescription = ({ hasValidLicense = false }: { hasValidLicense?: boolean }) => (
|
const MlCardDescription = ({
|
||||||
|
subscriptionUrl,
|
||||||
|
hasValidLicense = false,
|
||||||
|
}: {
|
||||||
|
subscriptionUrl: string;
|
||||||
|
hasValidLicense?: boolean;
|
||||||
|
}) => (
|
||||||
<EuiText size="s">
|
<EuiText size="s">
|
||||||
{hasValidLicense ? (
|
{hasValidLicense ? (
|
||||||
i18n.ML_TYPE_DESCRIPTION
|
i18n.ML_TYPE_DESCRIPTION
|
||||||
|
@ -31,7 +38,7 @@ const MlCardDescription = ({ hasValidLicense = false }: { hasValidLicense?: bool
|
||||||
defaultMessage="Access to ML requires a {subscriptionsLink}."
|
defaultMessage="Access to ML requires a {subscriptionsLink}."
|
||||||
values={{
|
values={{
|
||||||
subscriptionsLink: (
|
subscriptionsLink: (
|
||||||
<EuiLink href="https://www.elastic.co/subscriptions" target="_blank">
|
<EuiLink href={subscriptionUrl} target="_blank">
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id="xpack.siem.components.stepDefineRule.ruleTypeField.subscriptionsLink"
|
id="xpack.siem.components.stepDefineRule.ruleTypeField.subscriptionsLink"
|
||||||
defaultMessage="Platinum subscription"
|
defaultMessage="Platinum subscription"
|
||||||
|
@ -69,6 +76,9 @@ export const SelectRuleType: React.FC<SelectRuleTypeProps> = ({
|
||||||
const setMl = useCallback(() => setType('machine_learning'), [setType]);
|
const setMl = useCallback(() => setType('machine_learning'), [setType]);
|
||||||
const setQuery = useCallback(() => setType('query'), [setType]);
|
const setQuery = useCallback(() => setType('query'), [setType]);
|
||||||
const mlCardDisabled = isReadOnly || !hasValidLicense || !isMlAdmin;
|
const mlCardDisabled = isReadOnly || !hasValidLicense || !isMlAdmin;
|
||||||
|
const licensingUrl = useKibana().services.application.getUrlForApp('kibana', {
|
||||||
|
path: '#/management/elasticsearch/license_management',
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<EuiFormRow
|
<EuiFormRow
|
||||||
|
@ -95,7 +105,9 @@ export const SelectRuleType: React.FC<SelectRuleTypeProps> = ({
|
||||||
<EuiCard
|
<EuiCard
|
||||||
data-test-subj="machineLearningRuleType"
|
data-test-subj="machineLearningRuleType"
|
||||||
title={i18n.ML_TYPE_TITLE}
|
title={i18n.ML_TYPE_TITLE}
|
||||||
description={<MlCardDescription hasValidLicense={hasValidLicense} />}
|
description={
|
||||||
|
<MlCardDescription subscriptionUrl={licensingUrl} hasValidLicense={hasValidLicense} />
|
||||||
|
}
|
||||||
icon={<EuiIcon size="l" type="machineLearningApp" />}
|
icon={<EuiIcon size="l" type="machineLearningApp" />}
|
||||||
isDisabled={mlCardDisabled}
|
isDisabled={mlCardDisabled}
|
||||||
selectable={{
|
selectable={{
|
||||||
|
|
Loading…
Reference in a new issue