[8.16] [SecuritySolution] Add tooltip to entities table (#197430) (#197491)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[SecuritySolution] Add tooltip to entities table
(#197430)](https://github.com/elastic/kibana/pull/197430)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Pablo
Machado","email":"pablo.nevesmachado@elastic.co"},"sourceCommit":{"committedDate":"2024-10-23T14:52:16Z","message":"[SecuritySolution]
Add tooltip to entities table (#197430)\n\n## Summary\r\n\r\nAdd a
tooltip to the entities table.\r\n\r\n![Screenshot 2024-10-23 at 14
58\r\n52](https://github.com/user-attachments/assets/4766e3bd-9e88-4c9a-9d8f-653c56de6fdd)","sha":"ab021a52668203d19fb2651fcada0720da9c5120","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","v9.0.0","Team:
SecuritySolution","Theme: entity_analytics","Feature:Entity
Analytics","Team:Entity
Analytics","v8.16.0","backport:version","v8.17.0"],"number":197430,"url":"https://github.com/elastic/kibana/pull/197430","mergeCommit":{"message":"[SecuritySolution]
Add tooltip to entities table (#197430)\n\n## Summary\r\n\r\nAdd a
tooltip to the entities table.\r\n\r\n![Screenshot 2024-10-23 at 14
58\r\n52](https://github.com/user-attachments/assets/4766e3bd-9e88-4c9a-9d8f-653c56de6fdd)","sha":"ab021a52668203d19fb2651fcada0720da9c5120"}},"sourceBranch":"main","suggestedTargetBranches":["8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197430","number":197430,"mergeCommit":{"message":"[SecuritySolution]
Add tooltip to entities table (#197430)\n\n## Summary\r\n\r\nAdd a
tooltip to the entities table.\r\n\r\n![Screenshot 2024-10-23 at 14
58\r\n52](https://github.com/user-attachments/assets/4766e3bd-9e88-4c9a-9d8f-653c56de6fdd)","sha":"ab021a52668203d19fb2651fcada0720da9c5120"}},{"branch":"8.16","label":"v8.16.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","labelRegex":"^v8.17.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/197470","number":197470,"state":"OPEN"}]}]
BACKPORT-->
This commit is contained in:
Pablo Machado 2024-10-24 14:36:49 +02:00 committed by GitHub
parent 5e9b979149
commit b254359d8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 12 deletions

View file

@ -6,9 +6,8 @@
*/
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { EuiFilterGroup, EuiFlexGroup, EuiFlexItem, EuiTitle } from '@elastic/eui';
import { EuiFilterGroup, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { noop } from 'lodash/fp';
import { FormattedMessage } from '@kbn/i18n-react';
import { i18n } from '@kbn/i18n';
import { useErrorToast } from '../../../common/hooks/use_error_toast';
import type { CriticalityLevels } from '../../../../common/constants';
@ -116,16 +115,19 @@ export const EntitiesList: React.FC = () => {
activePage={(data?.page ?? 1) - 1}
columns={columns}
headerCount={data?.total ?? 0}
headerTitle={
<EuiTitle size="s">
<h2>
<FormattedMessage
id="xpack.securitySolution.entityAnalytics.entityStore.entitiesList.tableTitle"
defaultMessage="Entities"
/>
</h2>
</EuiTitle>
}
titleSize="s"
headerTitle={i18n.translate(
'xpack.securitySolution.entityAnalytics.entityStore.entitiesList.tableTitle',
{
defaultMessage: 'Entities',
}
)}
headerTooltip={i18n.translate(
'xpack.securitySolution.entityAnalytics.entityStore.entitiesList.tableTooltip',
{
defaultMessage: 'Entity data can take a couple of minutes to appear',
}
)}
limit={limit}
loading={isLoading || isRefetching}
isInspect={false}

View file

@ -9,6 +9,7 @@ import type {
EuiBasicTableProps,
EuiGlobalToastListToast as Toast,
EuiTableRowCellProps,
EuiTitleSize,
} from '@elastic/eui';
import {
EuiBasicTable,
@ -107,6 +108,7 @@ export interface BasicTableProps<T> {
dataTestSubj?: string;
headerCount: number;
headerFilters?: string | React.ReactNode;
titleSize?: EuiTitleSize;
headerSupplement?: React.ReactElement;
headerTitle: string | React.ReactElement;
headerTooltip?: string;
@ -148,6 +150,7 @@ const PaginatedTableComponent: FC<SiemTables> = ({
dataTestSubj = DEFAULT_DATA_TEST_SUBJ,
headerCount,
headerFilters,
titleSize,
headerSupplement,
headerTitle,
headerTooltip,
@ -277,6 +280,7 @@ const PaginatedTableComponent: FC<SiemTables> = ({
<InspectButtonContainer show={!loadingInitial}>
<Panel data-test-subj={`${dataTestSubj}-loading-${loading}`} loading={loading}>
<HeaderSection
titleSize={titleSize}
toggleStatus={toggleStatus}
toggleQuery={toggleQuery}
headerFilters={headerFilters}