Improve layout switching#26185
Conversation
|
|
||
| # Show predefined table layouts for alerts data table | ||
| show_alerts_predefined_layouts=off | ||
| show_alerts_predefined_layouts=on |
There was a problem hiding this comment.
Did you make this change on purpose?
There was a problem hiding this comment.
Yes, that is the last PR so we can turn it on or even remove completely
| ); | ||
| }; | ||
|
|
||
| export default PaginatedEntityTableFilterContextProvider; |
There was a problem hiding this comment.
Usually we just call these "PaginatedEntityTableFilterProvider".
| onChangeFilters: (newFilters: UrlQueryFilters) => void; | ||
| onChangeSlicingFilter: (slice?: string) => void; | ||
| paginationState: PaginationQueryParameterResult; | ||
| resetFilters: () => void; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Since we call the other context TableFetchContext, let's call this one TableFilterContext?
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
Checklist:
/jpd https://github.com/Graylog2/graylog-plugin-enterprise/pull/14350
/nocl