Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events page refactoring with entity data table usage #20831

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

maxiadlovskii
Copy link
Contributor

@maxiadlovskii maxiadlovskii commented Oct 30, 2024

Description

This PR implements an events page on a general perspective with Entity Data Table usage
Now we can choose which columns to show. The rest is hidden under the expanded row
Screenshot 2024-11-05 at 11 50 49
Event actions are in the action column now
Screenshot 2024-11-05 at 11 58 02
We have the option to filtrate events by type and timestamp
Screenshot 2024-11-05 at 12 00 25
And now it's possible to sort events by some of the fields

Screenshot 2024-11-05 at 12 02 40

The changes also touch the default event details of the events widget
Screenshot 2024-11-05 at 12 05 41

Motivation and Context

As the current implementation of the Events page uses the legacy code, we need to do refactoring first before implementing the new functionality. We need to use Entity Data Table on the page as we use it on other pages. This would allow us to use common approaches. We have to do refactoring for the general approach first and then reuse it on a security perspective as well.
fix: #20881

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

/jpd https://github.com/Graylog2/graylog-plugin-enterprise/pull/9020

@maxiadlovskii maxiadlovskii marked this pull request as ready for review November 5, 2024 11:07
@maxiadlovskii maxiadlovskii changed the title Refactoring/events general perspective preparation Events page refactoring with entity data table usage Nov 5, 2024
Comment on lines +35 to +40
const hasReplayInfo = !!event.replay_info;

const moreActions = [
hasReplayInfo ? <MenuItem key="replay_info"><LinkToReplaySearch id={event.id} isEvent /></MenuItem> : null,
pluggableActions.length && hasReplayInfo ? <MenuItem divider key="divider" /> : null,
pluggableActions.length ? pluggableActions : null,
Copy link
Contributor

@kingzacko1 kingzacko1 Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const hasReplayInfo = !!event.replay_info;
const moreActions = [
hasReplayInfo ? <MenuItem key="replay_info"><LinkToReplaySearch id={event.id} isEvent /></MenuItem> : null,
pluggableActions.length && hasReplayInfo ? <MenuItem divider key="divider" /> : null,
pluggableActions.length ? pluggableActions : null,
const hasReplayInfo = !!event.replay_info;
const isNotSystemEvent= !event.event_definition_type.startsWith('system-notifications');
const moreActions = [
hasReplayInfo ? <MenuItem key="replay_info"><LinkToReplaySearch id={event.id} isEvent /></MenuItem> : null,
pluggableActions.length && hasReplayInfo && isNotSystemEvent ? <MenuItem divider key="divider" /> : null,
pluggableActions.length && isNotSystemEvent ? pluggableActions : null,

I recently made a change to show the pluggable actions independent of replay_info being available. These pluggable actions should actually be available for all non-system-notification events. This may be able to be done in a prettier way, but using the isNotSystemEvent logic should correctly display the actions menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace current implementation with Entity data table on general perspective
2 participants