mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
## [Security Solution] Fixes the formatting of the Alert Summary View in Timeline This PR fixes a formatting issue in Timeline resulting from redundant actions, (see <https://github.com/elastic/kibana/issues/120181> for repro steps), as shown in the Before / After screenshots below: **Before**  _Above: Before - The Alert summary view in Timeline renders redundant actions, resulting in the formatting above_ **After**  _Above: After - The redundant hover actions are gone, and the formatting is correct_ ### No changes to the `Security > Alerts` view The Security Alerts view is **unchanged**, per the screenshots below: **Before**  _Above: Before - Hover actions in the Alert summary in Security > Alerts before the fix_ **After**  _Above: After - `noop` The Alert summary in Security > Alerts remains **unchanged** after the fix_ Co-authored-by: Andrew Goldstein <andrew-goldstein@users.noreply.github.com>
This commit is contained in:
parent
33c132edf1
commit
c6c043b69d
2 changed files with 31 additions and 10 deletions
|
@ -14,6 +14,7 @@ import { TimelineEventsDetailsItem } from '../../../../common/search_strategy';
|
|||
import { useRuleWithFallback } from '../../../detections/containers/detection_engine/rules/use_rule_with_fallback';
|
||||
|
||||
import { TestProviders, TestProvidersComponent } from '../../mock';
|
||||
import { TimelineId } from '../../../../common';
|
||||
import { mockBrowserFields } from '../../containers/source/mock';
|
||||
|
||||
jest.mock('../../lib/kibana');
|
||||
|
@ -49,6 +50,24 @@ describe('AlertSummaryView', () => {
|
|||
expect(getByTestId('summary-view')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('it renders the action cell by default', () => {
|
||||
const { getAllByTestId } = render(
|
||||
<TestProviders>
|
||||
<AlertSummaryView {...props} />
|
||||
</TestProviders>
|
||||
);
|
||||
expect(getAllByTestId('hover-actions-filter-for').length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
test('it does NOT render the action cell for the active timeline', () => {
|
||||
const { queryAllByTestId } = render(
|
||||
<TestProviders>
|
||||
<AlertSummaryView {...props} timelineId={TimelineId.active} />
|
||||
</TestProviders>
|
||||
);
|
||||
expect(queryAllByTestId('hover-actions-filter-for').length).toEqual(0);
|
||||
});
|
||||
|
||||
test("render no investigation guide if it doesn't exist", async () => {
|
||||
(useRuleWithFallback as jest.Mock).mockReturnValue({
|
||||
rule: {
|
||||
|
|
|
@ -14,7 +14,7 @@ import { AlertSummaryRow, getSummaryColumns, SummaryRow } from './helpers';
|
|||
|
||||
import { ActionCell } from './table/action_cell';
|
||||
import { FieldValueCell } from './table/field_value_cell';
|
||||
import { TimelineEventsDetailsItem } from '../../../../common';
|
||||
import { TimelineEventsDetailsItem, TimelineId } from '../../../../common';
|
||||
|
||||
import { getSummaryRows } from './get_alert_summary_rows';
|
||||
|
||||
|
@ -37,15 +37,17 @@ const getDescription = ({
|
|||
isDraggable={isDraggable}
|
||||
values={values}
|
||||
/>
|
||||
<ActionCell
|
||||
contextId={timelineId}
|
||||
data={data}
|
||||
eventId={eventId}
|
||||
fieldFromBrowserField={fieldFromBrowserField}
|
||||
linkValue={linkValue}
|
||||
timelineId={timelineId}
|
||||
values={values}
|
||||
/>
|
||||
{timelineId !== TimelineId.active && (
|
||||
<ActionCell
|
||||
contextId={timelineId}
|
||||
data={data}
|
||||
eventId={eventId}
|
||||
fieldFromBrowserField={fieldFromBrowserField}
|
||||
linkValue={linkValue}
|
||||
timelineId={timelineId}
|
||||
values={values}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue