-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Entity data table to security events (#21091)
* Add Entity data table to security events * Add event definitions * Refactoring of expand row content * fix alert filter * Add event definition filter * fix tsc errors * fix tests * add feature flag * fix linter errors * fix linter errors * fix linter errors * Fixing formatting. --------- Co-authored-by: Dennis Oelkers <[email protected]>
- Loading branch information
1 parent
dab4dbe
commit a18ee23
Showing
10 changed files
with
222 additions
and
115 deletions.
There are no files selected for viewing
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
42 changes: 42 additions & 0 deletions
42
graylog2-web-interface/src/components/events/events/EventDefinitionLink.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,42 @@ | ||
/* | ||
* Copyright (C) 2020 Graylog, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the Server Side Public License, version 1, | ||
* as published by MongoDB, Inc. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* Server Side Public License for more details. | ||
* | ||
* You should have received a copy of the Server Side Public License | ||
* along with this program. If not, see | ||
* <http://www.mongodb.com/licensing/server-side-public-license>. | ||
*/ | ||
import React from 'react'; | ||
|
||
import useCurrentUser from 'hooks/useCurrentUser'; | ||
import { isPermitted } from 'util/PermissionsMixin'; | ||
import { Link } from 'components/common/router'; | ||
import Routes from 'routing/Routes'; | ||
|
||
const EventDefinitionLink = ({ title, id }: { title: string | undefined, id: string }) => { | ||
const { permissions } = useCurrentUser(); | ||
|
||
if (!title) { | ||
return <em>{id}</em>; | ||
} | ||
|
||
if (isPermitted(permissions, `eventdefinitions:edit:${id}`)) { | ||
return ( | ||
<Link to={Routes.ALERTS.DEFINITIONS.edit(id)}> | ||
{title} | ||
</Link> | ||
); | ||
} | ||
|
||
return <>{title}</>; | ||
}; | ||
|
||
export default EventDefinitionLink; |
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
37 changes: 37 additions & 0 deletions
37
graylog2-web-interface/src/components/events/events/GeneralEventDetailsTable.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,37 @@ | ||
/* | ||
* Copyright (C) 2020 Graylog, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the Server Side Public License, version 1, | ||
* as published by MongoDB, Inc. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* Server Side Public License for more details. | ||
* | ||
* You should have received a copy of the Server Side Public License | ||
* along with this program. If not, see | ||
* <http://www.mongodb.com/licensing/server-side-public-license>. | ||
*/ | ||
import React from 'react'; | ||
|
||
import type { Event, EventsAdditionalData } from 'components/events/events/types'; | ||
import useColumnRenderers from 'components/events/events/ColumnRenderers'; | ||
import EventDetailsTable from 'components/events/events/EventDetailsTable'; | ||
|
||
type Props = { | ||
attributesList: Array<{ id: string, title: string}>, | ||
event: Event, | ||
meta: EventsAdditionalData, | ||
} | ||
|
||
const GeneralEventDetailsTable = ({ event, attributesList, meta }: Props) => { | ||
const { attributes: attributesRenderers } = useColumnRenderers(); | ||
|
||
return ( | ||
<EventDetailsTable<Event> event={event} meta={meta} attributesRenderers={attributesRenderers} attributesList={attributesList} /> | ||
); | ||
}; | ||
|
||
export default GeneralEventDetailsTable; |
Oops, something went wrong.