diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_table.test.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_table.test.tsx index 939c2a03547d71..cda7e4e200877d 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_table.test.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_table.test.tsx @@ -8,6 +8,7 @@ import React from 'react'; import { noop } from 'lodash/fp'; import { render, screen } from '@testing-library/react'; +import { coreMock } from '@kbn/core/public/mocks'; import { TestProviders } from '../../../../../common/mock'; import { useRuleDetailsContextMock } from '../__mocks__/rule_details_context'; @@ -22,6 +23,8 @@ jest.mock('../../../../../common/containers/sourcerer'); jest.mock('../../../../rule_monitoring/components/execution_results_table/use_execution_results'); jest.mock('../rule_details_context'); +const coreStart = coreMock.createStart(); + const mockUseSourcererDataView = useSourcererDataView as jest.Mock; mockUseSourcererDataView.mockReturnValue({ indexPattern: { fields: [] }, @@ -42,7 +45,7 @@ describe('ExecutionLogTable', () => { test('Shows total events returned', () => { const ruleDetailsContext = useRuleDetailsContextMock.create(); (useRuleDetailsContext as jest.Mock).mockReturnValue(ruleDetailsContext); - render(, { + render(, { wrapper: TestProviders, }); expect(screen.getByTestId('executionsShowing')).toHaveTextContent('Showing 7 rule executions'); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_table.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_table.tsx index 1171c22fbcea2f..77705480755111 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_table.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_table.tsx @@ -26,7 +26,10 @@ import { import type { Filter, Query } from '@kbn/es-query'; import { buildFilter, FILTERS } from '@kbn/es-query'; import { MAX_EXECUTION_EVENTS_DISPLAYED } from '@kbn/securitysolution-rules'; -import { mountReactNode } from '@kbn/core-mount-utils-browser-internal'; +import { toMountPoint } from '@kbn/react-kibana-mount'; +import type { AnalyticsServiceStart } from '@kbn/core-analytics-browser'; +import type { I18nStart } from '@kbn/core-i18n-browser'; +import type { ThemeServiceStart } from '@kbn/core-theme-browser'; import { InputsModelId } from '../../../../../common/store/inputs/constants'; @@ -82,7 +85,13 @@ const DatePickerEuiFlexItem = styled(EuiFlexItem)` max-width: 582px; `; -interface ExecutionLogTableProps { +interface StartServices { + analytics: AnalyticsServiceStart; + i18n: I18nStart; + theme: ThemeServiceStart; +} + +interface ExecutionLogTableProps extends StartServices { ruleId: string; selectAlertsTab: () => void; } @@ -96,6 +105,7 @@ interface CachedGlobalQueryState { const ExecutionLogTableComponent: React.FC = ({ ruleId, selectAlertsTab, + ...startServices }) => { const { docLinks, @@ -299,7 +309,7 @@ const ExecutionLogTableComponent: React.FC = ({ successToastId.current = addSuccess( { title: i18n.ACTIONS_SEARCH_FILTERS_HAVE_BEEN_UPDATED_TITLE, - text: mountReactNode( + text: toMountPoint( <>

{i18n.ACTIONS_SEARCH_FILTERS_HAVE_BEEN_UPDATED_DESCRIPTION}

@@ -309,7 +319,8 @@ const ExecutionLogTableComponent: React.FC = ({ - + , + startServices ), }, // Essentially keep toast around till user dismisses via 'x' @@ -333,6 +344,7 @@ const ExecutionLogTableComponent: React.FC = ({ selectAlertsTab, timerange, uuidDataViewField, + startServices, ] ); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/index.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/index.tsx index e99e6d6659034e..2dacd37f7d2451 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/index.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/index.tsx @@ -179,6 +179,9 @@ const RuleDetailsPageComponent: React.FC = ({ clearSelected, }) => { const { + analytics, + i18n: i18nStart, + theme, application: { navigateToApp, capabilities: { actions }, @@ -769,7 +772,13 @@ const RuleDetailsPageComponent: React.FC = ({ /> - + diff --git a/x-pack/plugins/security_solution/tsconfig.json b/x-pack/plugins/security_solution/tsconfig.json index 68351d1dd48a12..0a74be06da7d02 100644 --- a/x-pack/plugins/security_solution/tsconfig.json +++ b/x-pack/plugins/security_solution/tsconfig.json @@ -105,7 +105,6 @@ "@kbn/react-field", "@kbn/field-types", "@kbn/securitysolution-rules", - "@kbn/core-mount-utils-browser-internal", "@kbn/cases-components", "@kbn/event-log-plugin", "@kbn/task-manager-plugin", @@ -203,6 +202,9 @@ "@kbn/search-types", "@kbn/field-utils", "@kbn/core-saved-objects-api-server-mocks", - "@kbn/langchain" + "@kbn/langchain", + "@kbn/core-analytics-browser", + "@kbn/core-i18n-browser", + "@kbn/core-theme-browser" ] }