feat(14550): Added isParentMutable to pass the scope permission to the filters - #26816
Open
zeeklop wants to merge 6 commits into
Open
feat(14550): Added isParentMutable to pass the scope permission to the filters#26816zeeklop wants to merge 6 commits into
zeeklop wants to merge 6 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for propagating “parent entity mutability” into pluggable search filter UI for event definitions, so filter UIs can become read-only when the parent entity is not mutable (e.g., ILLUMINATE-scoped content).
Changes:
- Extends the pluggable
SearchBarControlcomponent type to accept an optionalisParentMutableprop. - Fetches scope permissions for an event definition and forwards mutability into
SearchFiltersFormControls. - Updates
SearchFiltersFormControlsto passisParentMutablethrough to the pluggable search-filters component and adjusts a related test to mockuseScopePermissions.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
graylog2-web-interface/src/views/types.ts |
Updates the SearchBarControl type so pluggable controls can receive isParentMutable. |
graylog2-web-interface/src/components/event-definitions/event-definition-types/FilterForm.tsx |
Determines mutability via useScopePermissions(eventDefinition) and passes it to SearchFiltersFormControls. |
graylog2-web-interface/src/components/event-definitions/event-definition-types/FilterAggregationForm.test.tsx |
Mocks useScopePermissions to keep tests stable after the new hook usage. |
graylog2-web-interface/src/components/common/SearchFiltersFormControls.tsx |
Accepts isParentMutable and forwards it to the pluggable search filters component. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+222
to
+224
| const { scopePermissions } = useScopePermissions(eventDefinition); | ||
| const isMutable = useMemo(() => scopePermissions?.is_mutable, [scopePermissions]); | ||
|
|
|
|
||
| export interface SearchBarControl { | ||
| component: React.ComponentType; | ||
| component: React.ComponentType<{ isParentMutable?: boolean }>; |
…t/14550-scoped-search-filters-ui
…t/14550-scoped-search-filters-ui
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added isParentMutable to pass the scope permission to the filters
closes: Graylog2/graylog-plugin-enterprise#14550
/prd Graylog2/graylog-plugin-enterprise#14994
/nocl
Description
Search filters bar has a new prop that allows to check if the parent entity is mutable checking the scope permissions.
We are now starting to ship with ILLUMINATE packages search filters on event definitions. These filters are there for the user to use but they are Read Only. This change is to check if the parent entity is mutable since if it isn't then we don't want users to change any of the configuration.
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: