Fix invalid license info link (#143836)

**Relates to:** [#137148](https://github.com/elastic/kibana/issues/137148)

## Summary

Fixes an invalid link to the Platinum license info from the disabled ML rule card.

*Before:*

https://user-images.githubusercontent.com/3775283/197490117-b209250a-5fb9-49c8-bbd4-163aa649fd18.mov

*After:*

https://user-images.githubusercontent.com/3775283/197489478-ef7b428e-cc15-4f62-857b-1f53d5ae1325.mov


### Checklist

- [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
- [x] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
This commit is contained in:
Maxim Palenov 2022-10-25 14:36:21 +03:00 committed by GitHub
parent a30f691a43
commit c53909f6d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 13 deletions

View file

@ -18,7 +18,6 @@ import {
isNewTermsRule,
} from '../../../../../common/detection_engine/utils';
import type { FieldHook } from '../../../../shared_imports';
import { useKibana } from '../../../../common/lib/kibana';
import * as i18n from './translations';
import { MlCardDescription } from './ml_card_description';
@ -50,9 +49,6 @@ export const SelectRuleType: React.FC<SelectRuleTypeProps> = ({
const setThreshold = useCallback(() => setType('threshold'), [setType]);
const setThreatMatch = useCallback(() => setType('threat_match'), [setType]);
const setNewTerms = useCallback(() => setType('new_terms'), [setType]);
const licensingUrl = useKibana().services.application.getUrlForApp('kibana', {
path: '#/management/stack/license_management',
});
const eqlSelectableConfig = useMemo(
() => ({
@ -130,12 +126,7 @@ export const SelectRuleType: React.FC<SelectRuleTypeProps> = ({
data-test-subj="machineLearningRuleType"
title={i18n.ML_TYPE_TITLE}
titleSize="xs"
description={
<MlCardDescription
subscriptionUrl={licensingUrl}
hasValidLicense={hasValidLicense}
/>
}
description={<MlCardDescription hasValidLicense={hasValidLicense} />}
icon={<EuiIcon size="l" type="machineLearningApp" />}
isDisabled={mlSelectableConfig.isDisabled && !mlSelectableConfig.isSelected}
selectable={mlSelectableConfig}

View file

@ -13,7 +13,6 @@ import React from 'react';
import { ML_TYPE_DESCRIPTION } from './translations';
interface MlCardDescriptionProps {
subscriptionUrl: string;
hasValidLicense?: boolean;
}
@ -22,7 +21,6 @@ const SmallText = styled.span`
`;
const MlCardDescriptionComponent: React.FC<MlCardDescriptionProps> = ({
subscriptionUrl,
hasValidLicense = false,
}) => (
<SmallText>
@ -34,7 +32,7 @@ const MlCardDescriptionComponent: React.FC<MlCardDescriptionProps> = ({
defaultMessage="Access to ML requires a {subscriptionsLink}."
values={{
subscriptionsLink: (
<EuiLink href={subscriptionUrl} target="_blank">
<EuiLink href="https://www.elastic.co/subscriptions" target="_blank">
<FormattedMessage
id="xpack.securitySolution.components.stepDefineRule.ruleTypeField.subscriptionsLink"
defaultMessage="Platinum subscription"