Skip to content

Improve layout switching#26185

Merged
maxiadlovskii merged 41 commits into
masterfrom
feat/improve-layout-switching
Jun 5, 2026
Merged

Improve layout switching#26185
maxiadlovskii merged 41 commits into
masterfrom
feat/improve-layout-switching

Conversation

@maxiadlovskii

@maxiadlovskii maxiadlovskii commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

NOTE: this PR is follow-up of #25947 and should be merged after

Description

Motivation and Context

This PR improves filters usage in PaginatedEntityTable. We move filters setters, getters and adds reset filters function to a separate context, which would make it easier to use them from different place of PaginatedEntityTable. For example, we need a reset filter method to run on switching between layout variants. This PR also set feature flag on by default.

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 requested a documentation update.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

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

maxiadlovskii and others added 30 commits May 8, 2026 10:07
@maxiadlovskii maxiadlovskii marked this pull request as ready for review June 2, 2026 09:14
@maxiadlovskii maxiadlovskii added the e2e-tests Run PR build with e2e tests. label Jun 2, 2026

# Show predefined table layouts for alerts data table
show_alerts_predefined_layouts=off
show_alerts_predefined_layouts=on

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did you make this change on purpose?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, that is the last PR so we can turn it on or even remove completely

);
};

export default PaginatedEntityTableFilterContextProvider;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Usually we just call these "PaginatedEntityTableFilterProvider".

onChangeFilters: (newFilters: UrlQueryFilters) => void;
onChangeSlicingFilter: (slice?: string) => void;
paginationState: PaginationQueryParameterResult;
resetFilters: () => void;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like creating a context for these values.

What will be confusing for others in the future: We have fetchOptions in this context and searchParams in the TableFetchContext, which contain the same information. I would have no idea why this is the case or which context to consume. It adds adds unnecessary mental overhead.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since we call the other context TableFetchContext, let's call this one TableFilterContext?

@maxiadlovskii maxiadlovskii requested a review from linuspahl June 2, 2026 14:53
@maxiadlovskii maxiadlovskii merged commit 04fa1e8 into master Jun 5, 2026
25 checks passed
@maxiadlovskii maxiadlovskii deleted the feat/improve-layout-switching branch June 5, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e-tests Run PR build with e2e tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants