-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution] [Timelines] Notes table links (#187868)
## Summary This pr changes the timeline id cell to be a link to open the saved timeline a note is a part of if timelineId exists, instead of just showing the id as a plain string. Also updates the event column to a link that opens a new timeline containing just the event a note is associated with. ![image](https://github.com/elastic/kibana/assets/56408403/e1c577e6-deb6-4daf-8d94-78fcc400c041) ### Checklist Delete any items that are not applicable to this PR. - [x] 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/packages/kbn-i18n/README.md) - [x] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- Loading branch information
1 parent
32f6a78
commit 209b0c5
Showing
6 changed files
with
91 additions
and
66 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
x-pack/plugins/security_solution/public/notes/components/open_event_in_timeline.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
import React, { memo } from 'react'; | ||
import { EuiLink } from '@elastic/eui'; | ||
import type { EcsSecurityExtension as Ecs } from '@kbn/securitysolution-ecs'; | ||
import { useInvestigateInTimeline } from '../../detections/components/alerts_table/timeline_actions/use_investigate_in_timeline'; | ||
import * as i18n from './translations'; | ||
|
||
export const OpenEventInTimeline: React.FC<{ eventId?: string | null }> = memo(({ eventId }) => { | ||
const ecsRowData = { event: { id: [eventId] }, _id: eventId } as Ecs; | ||
const { investigateInTimelineAlertClick } = useInvestigateInTimeline({ ecsRowData }); | ||
|
||
return ( | ||
<EuiLink onClick={investigateInTimelineAlertClick} data-test-subj="open-event-in-timeline"> | ||
{i18n.VIEW_EVENT_IN_TIMELINE} | ||
</EuiLink> | ||
); | ||
}); | ||
|
||
OpenEventInTimeline.displayName = 'OpenEventInTimeline'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters