[8.x] [Security Solution][Notes] - fix column width on events table on host, user and network pages (#193460) (#193580)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Security Solution][Notes] - fix column width on events table on
host, user and network pages
(#193460)](https://github.com/elastic/kibana/pull/193460)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Philippe
Oberti","email":"philippe.oberti@elastic.co"},"sourceCommit":{"committedDate":"2024-09-20T13:38:05Z","message":"[Security
Solution][Notes] - fix column width on events table on host, user and
network pages
(#193460)","sha":"2a98d1af37ca8aca570b3c44728087b6271c3444","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","v9.0.0","Team:Threat
Hunting:Investigations","v8.16.0"],"title":"[Security Solution][Notes] -
fix column width on events table on host, user and network
pages","number":193460,"url":"https://github.com/elastic/kibana/pull/193460","mergeCommit":{"message":"[Security
Solution][Notes] - fix column width on events table on host, user and
network pages
(#193460)","sha":"2a98d1af37ca8aca570b3c44728087b6271c3444"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193460","number":193460,"mergeCommit":{"message":"[Security
Solution][Notes] - fix column width on events table on host, user and
network pages
(#193460)","sha":"2a98d1af37ca8aca570b3c44728087b6271c3444"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Philippe Oberti <philippe.oberti@elastic.co>
This commit is contained in:
Kibana Machine 2024-09-21 01:29:57 +10:00 committed by GitHub
parent d7f685399d
commit f94a88f0d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,6 +12,7 @@ import { EuiCheckbox } from '@elastic/eui';
import type { Filter } from '@kbn/es-query';
import { dataTableActions } from '@kbn/securitysolution-data-table';
import type { TableId } from '@kbn/securitysolution-data-table';
import { useIsExperimentalFeatureEnabled } from '../../hooks/use_experimental_features';
import type { CustomBulkAction } from '../../../../common/types';
import { RowRendererValues } from '../../../../common/api/timeline';
import { StatefulEventsViewer } from '../events_viewer';
@ -73,7 +74,13 @@ const EventsQueryTabBodyComponent: React.FC<EventsQueryTabBodyComponentProps> =
const { globalFullScreen } = useGlobalFullScreen();
const [defaultNumberFormat] = useUiSetting$<string>(DEFAULT_NUMBER_FORMAT);
const isEnterprisePlus = useLicense().isEnterprise();
const ACTION_BUTTON_COUNT = isEnterprisePlus ? 5 : 4;
let ACTION_BUTTON_COUNT = isEnterprisePlus ? 6 : 5;
const securitySolutionNotesEnabled = useIsExperimentalFeatureEnabled(
'securitySolutionNotesEnabled'
);
if (!securitySolutionNotesEnabled) {
ACTION_BUTTON_COUNT--;
}
const leadingControlColumns = useMemo(
() => getDefaultControlColumn(ACTION_BUTTON_COUNT),
[ACTION_BUTTON_COUNT]