mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[Security Solution][Alert flyout] Fix dual hover actions in table tab (#212316)
## Summary Ref: https://github.com/elastic/kibana/issues/212138 This PR fixed a bug where the fields in the table tab have 2 hover actions, by pruning an unused branch in formatted fields (the [original logic](https://github.com/elastic/kibana/pull/207959/files#diff-ccbcd249520d7f127960805d59a0ebfd00613785a2dd5b047545bb8b4e565e26L331) was if the field is not draggable, show the value as text)  ### Checklist - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [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 - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
f8e31e5fcb
commit
f7b7a6cafa
4 changed files with 7 additions and 31 deletions
|
@ -226,7 +226,7 @@ describe('Events', () => {
|
|||
expect(wrapper.find('[data-test-subj="truncatable-message"]').exists()).toEqual(true);
|
||||
});
|
||||
|
||||
test('it does NOT render the truncatable message style when fieldName is NOT message', () => {
|
||||
test('it does NOT render the truncatable message style when truncate is false', () => {
|
||||
const wrapper = mount(
|
||||
<TestProviders>
|
||||
<FormattedFieldValue
|
||||
|
@ -234,6 +234,7 @@ describe('Events', () => {
|
|||
contextId="test"
|
||||
fieldName="NOT-message"
|
||||
fieldType="text"
|
||||
truncate={false}
|
||||
value={'a NON-message value'}
|
||||
/>
|
||||
</TestProviders>
|
||||
|
|
|
@ -22,7 +22,6 @@ import {
|
|||
} from '../../../../../../common/field_maps/field_names';
|
||||
import { AgentStatus } from '../../../../../common/components/endpoint/agents/agent_status';
|
||||
import { INDICATOR_REFERENCE } from '../../../../../../common/cti/constants';
|
||||
import { DefaultDraggable } from '../../../../../common/components/draggables';
|
||||
import { Bytes, BYTES_FORMAT } from './bytes';
|
||||
import { Duration, EVENT_DURATION_FIELD_NAME } from '../../../duration';
|
||||
import { getOrEmptyTagFromValue } from '../../../../../common/components/empty_value';
|
||||
|
@ -38,7 +37,6 @@ import {
|
|||
EVENT_URL_FIELD_NAME,
|
||||
GEO_FIELD_TYPE,
|
||||
IP_FIELD_TYPE,
|
||||
MESSAGE_FIELD_NAME,
|
||||
REFERENCE_URL_FIELD_NAME,
|
||||
RULE_REFERENCE_FIELD_NAME,
|
||||
SIGNAL_RULE_NAME_FIELD_NAME,
|
||||
|
@ -51,9 +49,6 @@ import { UserName } from './user_name';
|
|||
import { AssetCriticalityLevel } from './asset_criticality_level';
|
||||
import { ServiceName } from './service_name';
|
||||
|
||||
// simple black-list to prevent dragging and dropping fields such as message name
|
||||
const columnNamesNotDraggable = [MESSAGE_FIELD_NAME];
|
||||
|
||||
// Offset top-aligned tooltips so that cell actions are more visible
|
||||
const dataGridToolTipOffset = css`
|
||||
&[data-position='top'] {
|
||||
|
@ -226,7 +221,7 @@ const FormattedFieldValueComponent: React.FC<{
|
|||
title,
|
||||
value,
|
||||
});
|
||||
} else if (isUnifiedDataTable || columnNamesNotDraggable.includes(fieldName)) {
|
||||
} else {
|
||||
return truncate && !isEmpty(value) ? (
|
||||
<TruncatableText data-test-subj="truncatable-message">
|
||||
<EuiToolTip
|
||||
|
@ -248,27 +243,7 @@ const FormattedFieldValueComponent: React.FC<{
|
|||
</EuiToolTip>
|
||||
</TruncatableText>
|
||||
) : (
|
||||
<span data-test-subj={`formatted-field-${fieldName}`}>{value}</span>
|
||||
);
|
||||
} else {
|
||||
// This should not be reached for the unified data table
|
||||
const contentValue = getOrEmptyTagFromValue(value);
|
||||
const content = truncate ? <TruncatableText>{contentValue}</TruncatableText> : contentValue;
|
||||
return (
|
||||
<DefaultDraggable
|
||||
field={fieldName}
|
||||
id={`event-details-value-default-draggable-${contextId}-${eventId}-${fieldName}-${value}`}
|
||||
fieldType={fieldType ?? ''}
|
||||
isAggregatable={isAggregatable}
|
||||
value={`${value}`}
|
||||
tooltipContent={
|
||||
fieldType === DATE_FIELD_TYPE || fieldType === EVENT_DURATION_FIELD_NAME
|
||||
? null
|
||||
: fieldName
|
||||
}
|
||||
>
|
||||
{content}
|
||||
</DefaultDraggable>
|
||||
<span data-test-subj={`formatted-field-${fieldName}`}>{getOrEmptyTagFromValue(value)}</span>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -27,9 +27,9 @@ export const ALERT_GRID_CELL = '[data-test-subj="dataGridRowCell"]';
|
|||
|
||||
export const ALERT_RULE_NAME = '[data-test-subj="formatted-field-kibana.alert.rule.name"]';
|
||||
|
||||
export const ALERT_RISK_SCORE = '[data-test-subj="render-content-kibana.alert.risk_score"]';
|
||||
export const ALERT_RISK_SCORE = '[data-test-subj="formatted-field-kibana.alert.risk_score"]';
|
||||
|
||||
export const ALERT_SEVERITY = '[data-test-subj="render-content-kibana.alert.severity"]';
|
||||
export const ALERT_SEVERITY = '[data-test-subj="formatted-field-kibana.alert.severity"]';
|
||||
|
||||
export const ALERT_DATA_GRID = '[data-test-subj="euiDataGridBody"]';
|
||||
|
||||
|
|
|
@ -268,7 +268,7 @@ export const TIMESTAMP_HOVER_ACTION_OVERFLOW_BTN =
|
|||
export const TIMELINE_STATUS = '[data-test-subj="timeline-save-status"]';
|
||||
|
||||
export const ALERT_TABLE_SEVERITY_VALUES =
|
||||
'[data-test-subj="render-content-kibana.alert.severity"]';
|
||||
'[data-test-subj="formatted-field-kibana.alert.severity"]';
|
||||
|
||||
export const ALERT_TABLE_FILE_NAME_HEADER = '[data-gridcell-column-id="file.name"]';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue