diff --git a/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/account_switches_tile/account_switches_tile.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/account_switches_tile/account_switches_tile.tsx index 84d0c24f6bad6..de6f204c5b3e4 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/account_switches_tile/account_switches_tile.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/account_switches_tile/account_switches_tile.tsx @@ -8,6 +8,7 @@ import React from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import type { DataViewSpec } from '@kbn/data-views-plugin/public'; +import { i18n } from '@kbn/i18n'; import { getAccountSwitchesEsqlCount } from './esql_query'; import { KeyInsightsTile } from '../common/key_insights_tile'; @@ -17,18 +18,12 @@ export const AccountSwitchesTile: React.FC<{ spaceId: string; sourcerDataView: D }) => { return ( - } - label={ - - } + title={i18n.translate('xpack.securitySolution.privmon.accountSwitches.title', { + defaultMessage: 'Account Switches', + })} + label={i18n.translate('xpack.securitySolution.privmon.accountSwitches.label', { + defaultMessage: 'Account Switches', + })} getEsqlQuery={(namespace) => getAccountSwitchesEsqlCount(namespace, sourcerDataView)} id="privileged-user-monitoring-account-switches" spaceId={spaceId} diff --git a/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/active_privileged_users_tile/active_privileged_users_tile.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/active_privileged_users_tile/active_privileged_users_tile.tsx index ceb7f10ec8683..607e31e802dd1 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/active_privileged_users_tile/active_privileged_users_tile.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/active_privileged_users_tile/active_privileged_users_tile.tsx @@ -8,6 +8,7 @@ import React from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import type { DataViewSpec } from '@kbn/data-views-plugin/public'; +import { i18n } from '@kbn/i18n'; import { getActivePrivilegedUsersEsqlCount } from './esql_query'; import { KeyInsightsTile } from '../common/key_insights_tile'; @@ -17,18 +18,12 @@ export const ActivePrivilegedUsersTile: React.FC<{ }> = ({ spaceId, sourcerDataView }) => { return ( - } - label={ - - } + title={i18n.translate('xpack.securitySolution.privmon.activePrivilegedUsers.title', { + defaultMessage: 'Active Privileged Users', + })} + label={i18n.translate('xpack.securitySolution.privmon.activePrivilegedUsers.label', { + defaultMessage: 'Active Privileged Users', + })} getEsqlQuery={(namespace: string) => getActivePrivilegedUsersEsqlCount(namespace, sourcerDataView) } diff --git a/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/alerts_triggered_tile/alerts_triggered_tile.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/alerts_triggered_tile/alerts_triggered_tile.tsx index 6dd0711ee774f..d62ef4e576842 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/alerts_triggered_tile/alerts_triggered_tile.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/alerts_triggered_tile/alerts_triggered_tile.tsx @@ -7,6 +7,7 @@ import React from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; +import { i18n } from '@kbn/i18n'; import { getAlertsTriggeredEsqlCount } from './esql_query'; import { KeyInsightsTile } from '../common/key_insights_tile'; import { useSignalIndex } from '../../../../../../detections/containers/detection_engine/alerts/use_signal_index'; @@ -15,18 +16,12 @@ export const AlertsTriggeredTile: React.FC<{ spaceId: string }> = ({ spaceId }) const { signalIndexName: alertsIndexName } = useSignalIndex(); return ( - } - label={ - - } + title={i18n.translate('xpack.securitySolution.privmon.alertsTriggered.title', { + defaultMessage: 'Alerts Triggered', + })} + label={i18n.translate('xpack.securitySolution.privmon.alertsTriggered.label', { + defaultMessage: 'Alerts Triggered', + })} getEsqlQuery={(namespace) => getAlertsTriggeredEsqlCount(namespace, alertsIndexName)} id="privileged-user-monitoring-alerts-triggered" spaceId={spaceId} diff --git a/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/anomalies_detected_tile/anomalies_detected_tile.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/anomalies_detected_tile/anomalies_detected_tile.tsx index d46c2f36098b7..5bab1fd09b2c5 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/anomalies_detected_tile/anomalies_detected_tile.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/anomalies_detected_tile/anomalies_detected_tile.tsx @@ -7,24 +7,19 @@ import React from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; +import { i18n } from '@kbn/i18n'; import { getAnomaliesDetectedEsqlQuery } from './esql_query'; import { KeyInsightsTile } from '../common/key_insights_tile'; export const AnomaliesDetectedTile: React.FC<{ spaceId: string }> = ({ spaceId }) => { return ( - } - label={ - - } + title={i18n.translate('xpack.securitySolution.privmon.anomaliesDetected.title', { + defaultMessage: 'Anomalies Detected', + })} + label={i18n.translate('xpack.securitySolution.privmon.anomaliesDetected.label', { + defaultMessage: 'Anomalies Detected', + })} getEsqlQuery={(namespace) => getAnomaliesDetectedEsqlQuery(namespace)} id="privileged-user-monitoring-anomalies-detected" spaceId={spaceId} diff --git a/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/authentications_tile/authentications_tile.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/authentications_tile/authentications_tile.tsx index f229ddd4444d5..403d02c520198 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/authentications_tile/authentications_tile.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/authentications_tile/authentications_tile.tsx @@ -8,6 +8,7 @@ import React from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import type { DataViewSpec } from '@kbn/data-views-plugin/public'; +import { i18n } from '@kbn/i18n'; import { getAuthenticationsEsqlCount } from './esql_query'; import { KeyInsightsTile } from '../common/key_insights_tile'; @@ -17,18 +18,12 @@ export const AuthenticationsTile: React.FC<{ spaceId: string; sourcerDataView: D }) => { return ( - } - label={ - - } + title={i18n.translate('xpack.securitySolution.privmon.authentications.title', { + defaultMessage: 'Authentications', + })} + label={i18n.translate('xpack.securitySolution.privmon.authentications.label', { + defaultMessage: 'Authentications', + })} getEsqlQuery={(namespace) => getAuthenticationsEsqlCount(namespace, sourcerDataView)} id="privileged-user-monitoring-authentications" spaceId={spaceId} diff --git a/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/common/key_insights_tile.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/common/key_insights_tile.tsx index 079bfda1ccd65..40c48fed7ec06 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/common/key_insights_tile.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/common/key_insights_tile.tsx @@ -20,8 +20,8 @@ const LENS_VISUALIZATION_HEIGHT = 150; const LENS_VISUALIZATION_MIN_WIDTH = 220; interface KeyInsightsTileProps { - title: ReactElement; - label: ReactElement; + title: string; + label: string; getEsqlQuery: (namespace: string) => string; id: string; inspectTitle: ReactElement; @@ -43,13 +43,9 @@ export const KeyInsightsTile: React.FC = ({ // Use prop spaceId if provided, otherwise use hook spaceId, fallback to 'default' const effectiveSpaceId = propSpaceId || hookSpaceId || 'default'; - // Extract the defaultMessage from FormattedMessage elements - const titleString = title.props.defaultMessage; - const labelString = label.props.defaultMessage; - const lensAttributes = createKeyInsightsPanelLensAttributes({ - title: titleString, - label: labelString, + title, + label, esqlQuery: getEsqlQuery(effectiveSpaceId), dataViewId: 'default-dataview', filterQuery, @@ -91,7 +87,7 @@ export const KeyInsightsTile: React.FC = ({ > -

{titleString}

+

{title}

diff --git a/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/granted_rights_tile/granted_rights_tile.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/granted_rights_tile/granted_rights_tile.tsx index badc2bca1a0b9..5aa0f239a2de2 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/granted_rights_tile/granted_rights_tile.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/granted_rights_tile/granted_rights_tile.tsx @@ -8,6 +8,7 @@ import React from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import type { DataViewSpec } from '@kbn/data-views-plugin/public'; +import { i18n } from '@kbn/i18n'; import { getGrantedRightsEsqlCount } from './esql_query'; import { KeyInsightsTile } from '../common/key_insights_tile'; @@ -17,18 +18,12 @@ export const GrantedRightsTile: React.FC<{ spaceId: string; sourcerDataView: Dat }) => { return ( - } - label={ - - } + title={i18n.translate('xpack.securitySolution.privmon.grantedRights.title', { + defaultMessage: 'Granted Rights', + })} + label={i18n.translate('xpack.securitySolution.privmon.grantedRights.label', { + defaultMessage: 'Granted Rights', + })} getEsqlQuery={(namespace) => getGrantedRightsEsqlCount(namespace, sourcerDataView)} id="privileged-user-monitoring-granted-rights" spaceId={spaceId}